Skip to content

Instantly share code, notes, and snippets.

@kimw
kimw / shadowsocks
Last active August 29, 2015 14:27
/etc/init.d/shadowsocks
#!/bin/sh
#
# shadowsocks - this script starts and stops the shadowsocks daemin
#
# Downloaded from:
# https://gist.github.com/kimw/4a119e12191ac6582109
#
### BEGIN INIT INFO
# Provides: shadowsocks
# Required-Start: $remote_fs $network $named
@kimw
kimw / 10-powerline-symbols.conf
Last active March 24, 2016 12:59
PowerlineSymbols fontconfig with Chinese support
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>monospace</family>
<prefer><family>PowerlineSymbols</family></prefer>
</alias>
<alias>
<family>Droid Sans Mono</family>
@kimw
kimw / minttyrc
Last active April 26, 2016 02:45
Colors Adjusted for (MinTTY/Git for Windows)
BoldAsFont=yes
Transparency=medium
CursorType=block
Font=Ubuntu Mono
FontHeight=12
AllowBlinking=yes
Locale=en_US
Charset=UTF-8
Rows=40
@kimw
kimw / install_pyenv_step_by_step.md
Last active November 5, 2017 04:02
Install pyenv Step by Step

Environment: Ubuntu Trusty (14.04), Wily (15.10) & Xenial (16.04)

There're 2 steps.

STEP 1

sudo apt install libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev
@kimw
kimw / shell_execute_sequence_in_ubuntu_without_gui.log
Last active May 22, 2016 20:46
Shell Execute Sequence In Ubuntu Without GUI
system started @2016-05-22T00:23:19,343559719-0400
############################################################
#
# default shell: bash
#
# login from console
.profile begin by -bash @2016-05-22T00:23:25,471714518-0400
.bashrc begin by -bash @2016-05-22T00:23:25,475846161-0400
@kimw
kimw / Auto-Keep-SSH-Passphrase-In-A-Login-Duration.md
Last active October 9, 2016 06:31
Auto Keep SSH Passphrase In A Login Duration

Auto Keep SSH Passphrase In A Login Duration

The Goal

As descripted in the title, I just want a ssh passphrase keeper to:

  1. Keep the passphrase that I typed in a duration, e.g. 10 mins.
  2. Keep the passphrase til I logout even the duration is not reached.
#!/bin/sh
# Reset pantheon-terminal window at specific size and/or position.
#
# Kim <kimw@users.noreply.github.com>, Wed Oct 5 06:15:46 UTC 2016
#
# This script is published in GPLv3.
PATH=/bin:/usr/bin
@kimw
kimw / shutdown-usb-disk.md
Last active October 8, 2016 04:37
Shutdown USB Disk

The package udisks2 is needed.

$ sudo udisksctl power-off -b /dev/sdXX

It's works on Ubuntu.

@kimw
kimw / ss-ctl.conf
Last active February 25, 2017 10:31
dash script: shadowsocks controller
# file: ~/.ss-ctl.conf
# vim: ts=4 sw=4 noet ft=sh
#
# Config file of ss-ctl
# See: https://gist.github.com/kimw/6f30aeddea3e45ad7a282885c8ea5d3f
# Multi config files can be seprated by space
CONF_FILES="/a/path/to/config/file.json"
SS_SERVER_ENABLED=true
@kimw
kimw / how_can_i_remove_a_commit_on_github.md
Created February 13, 2017 01:11
How can I remove a commit on GitHub?

Q: How can I remove a commit on GitHub?

I "accidentally" pushed a commit to GitHub.

Is it possible to remove this commit?

I want to revert my GitHub repository as it was before this commit.

A: