Install Arcanist Phabricator on Fedora 28

$ mkdir $HOME/arctools
$ cd $HOME/arctools
$ git clone https://github.com/phacility/libphutil.git
$ git clone https://github.com/phacility/arcanist.git
$ mv $HOME/arctools /opt
$ echo 'export PATH=$PATH:/opt/arctools/arcanist/bin' >> ~/.bash_profile
$ source ~/.bash_profile
$ sudo dnf install php php-json
$ arc --help
$ arc install-certificate
# and follow the rest of the instruction from the arc

Nginx config for staging application

resolver 172.17.0.1;
resolver_timeout 10s;

server {
    listen 80;

    server_name staging.app.com;

    charset utf-8;
    gzip_vary on;
    access_log /var/log/nginx/app.access.log;
    error_log /var/log/nginx/app.error.log;
    add_header 'Access-Control-Allow-Origin' '*' always;
    add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE' always;
    add_header X-Frame-Options "SAMEORIGIN";
    set $appweb http://app-web.service.consul;
    location / {
        proxy_pass $appweb:5002;
        proxy_redirect     off;
        proxy_set_header   Host $host;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Host $server_name;
        auth_basic "Private Property";
        auth_basic_user_file /tmp/.htpasswd;
        #allow xxx.xxx.xxx.xxx; # xxx
        #deny all;
    }
}

How to convert putty ppk file to pem file

Basically when you working on windows, you most likely use putty to connect to the server. Putty generates the ppk file as the private key.

But the ppk file cannot be using to connect classic linux server or ec2 in AWS. You need to convert this ppk file to pem first in order to use it.

for ubuntu:

$ sudo apt install putty-tools

for centos and other linux:

$ sudo yum install putty

Start converting the ppk to pem

$ puttygen key.ppk -O private-openssh -o key.pem

And you might want to set the permission

$ chmod 600 key.pem

Now the key.pem is ready to use.

Docker command cheatsheet

docker build image

$ sudo docker build -t image-name .

docker to start a container from image

$ sudo docker run -itd --name jenkins --publish 8080:8080 --publish 50000:50000 jenkins

docker to get inside the container

$ sudo docker exec -it jenkins bash

docker stop container

$ sudo docker stop image-id/name

docker remove container

$ sudo docker rm image-id/name

docker remove image

$ sudo docker rmi image-id

docker remove images with no tag

$ sudo docker rmi $(sudo docker images --filter "dangling=true" -q --no-trunc)