Category Archives: English

Posts written in English

How to Push to GitHub with SSH Configuration

Recently I came across a ProxyPool repo, which is a dynamic proxy pool used for web crawling. It is useful for me, so I think I can contribute my effort to benefit others. After adding some other free proxy service providers I found, I need to push my changes to my forked repo on GitHub.com.

I prefer using SSH for convenience and security, so I don’t have to type in my username and password every time. I read about GitHub tutorial on Connecting to GitHub with SSH, and some other sources like Push to github without password using ssh-key and Automatically use correct SSH key for remote Git repo. All the tutorials say to change repo’s remote url to this format:  git remote set-url origin git@github.com:<Username>/<Project>.git but my push fails, and ssh -T git@github.com gives Permission denied (publickey) error. Thankfully  ssh -vvv git@github.com shows some interesting hints:

It seems that with the aforementioned configuration git does not read my /Users/username/.ssh/config file and will only look for ssh keys with default names, i.e. id_*. I have multiple ssh keys for logging in to my VPS servers, and I rename all the keys accordingly, including this github key pairs. I also create an entry for each server in /Users/username/.ssh/config file like

so a simple command like ssh digitalocean will log me into the server. Then how to tell git to look for a Host entry instead? Here is the working remote url format on my machine: git remote set-url origin <Host>:<Username>/<Project>.git, therefore ssh authentication test command changes to  ssh -T github

How to Setup a WordPress Server

I have setup a wordpress site for a friend, but I’m afraid that I cannot remember all the steps and all corresponding commands, so I recorded what I did.

  1. Edit SSH configuration file, change port, password or disable password login for security, then restart ssh:
  2. Change IPTables rules, only allow connections desired ports, close unused ports:
  3. where 12345 is the port number set in the above step.

  4. By default, IPTables rules are not persistent, i.e. they are reverted to the default after system reboot. To save the rules, install iptables-persistent package:
  5. Continue reading How to Setup a WordPress Server

How I Installed Graphic Interface to a Slim Debian System

I searched online for a slim Debian system, but I just could not find one. There are installer CDs and DVDs. As I understand, CD versions contain less packages than DVDs versions, so I think it may better suit my needs. But the only two options available to me are as CDs: netinst iso, which I thought will only work well with internet connection, and xfce iso, which contains a desktop environment already, although a lightweight one. My idea is, I want a slim version of Debian Linux system that has only command line interface and core packages installed by default, and I’ll install a display manager, but I won’t install a whole desktop environment.

But to my satisfaction, as I try to install with the net installer in VirtualBox, it doesn’t necessarily need internet connection, it just gets a confusing name. But there is a step in the installation process where the installer detects the network card automatically, so I have to connect a virtual network card to the virtual machine in settings pane.

It took a little longer as I expected, but it was smooth enough. When I get into the command line interface, it becomes quite easy to install GUI to it, all I have to do is

and then issue a command

to get into graphic interface.

Since I have only one display manager installed, the dwm, so that’s enough for me. As I understand, if multiple display managers exist in the system, one has to create a .xinitrc  file in home directory with the command

in it to specify dwm as the display manager to use.

My .bash_profile on My Mac

Added Jun 25, 2017: Kary, 我衰記性差,好對唔住,唔應該開你玩笑,求你原諒🌹

Original text:

I’m currently using an CUSTOMIZED Mac😁 I like the default Terminal.app shipped within macOS. I have changed the appearance a little bit, so it look nice to me. I also wanted to customize it even more, to enable it to sync command history between all open terminal sessions. I have tried

and some combinations of them in my .bash_profile, but none of them worked for me properly, so I gave up the idea of syncing. Problems include wrong command history number, failing to remove duplicate command, etc.
Continue reading My .bash_profile on My Mac