Skip to content

Instantly share code, notes, and snippets.

View lovelock's full-sized avatar
🏠
Working from home

Frost Wong lovelock

🏠
Working from home
  • http://www.weibo.com
  • Beijing, China
View GitHub Profile
@lovelock
lovelock / svndiff.sh
Created January 26, 2015 08:40
svn-diff advanced configuration
# This is the configuration of Wang Qingchun, who uses local Vim7.4
# instead of the system wide Vim 7.0
DIFF="$HOME/.local/bin/vimdiff +colo\molokai"
# Subversion provides the paths we need as the sixth and seventh
# parameters.
LEFT=${6}
RIGHT=${7}
# Call the diff command (change the following line to make sense for
@lovelock
lovelock / nginx.service
Created January 21, 2015 02:25
systemd service file for nginx
[Unit]
Description=The nginx HTTP and reverse proxy server
After=sys.og.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/usr/local/openresty/nginx/logs/nginx.pid
ExecStartPre=/usr/local/openresty/nginx/sbin/nginx -t
ExecStart=/usr/local/openresty/nginx/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
@lovelock
lovelock / .Xdefaults
Last active August 29, 2015 14:10 — forked from yevgenko/.Xdefaults
!-------------------------------------------------------------------------------
! Xft settings
!-------------------------------------------------------------------------------
Xft.dpi: 96
Xft.antialias: false
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
@lovelock
lovelock / gist:d282ee401862ece816da
Created December 6, 2014 01:34
start x at login
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
@lovelock
lovelock / ctex-xecjk-winfonts.def
Created April 27, 2014 07:09
definition for font configuration with texlive
% ctex-xecjk-winfonts.def: Windows 的 xeCJK 字体设置,默认为六种中易字体
% vim:ft=tex
\setCJKmainfont[BoldFont={SimHei},ItalicFont={KaiTi}]{SimSun}
\setCJKsansfont{SimHei}
\setCJKmonofont{FangSong}
!-------------------------------------------------------------------------------
! Xft settings
!-------------------------------------------------------------------------------
Xft.dpi: 96
Xft.antialias: false
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
@lovelock
lovelock / ibus-fix.sh
Last active December 28, 2015 12:09
Python 2.6.6 is installed in CentOS/RHEL/Scientific 6.4, while a lot of applications depend on python2.7 or later. After python2.7 is installed, ibus throws an error. This script can sort of solve the problem.
#!/bin/sh
# Please run this script as root
# This script is to solve the ibus errors after python2.7 or later has been installed.
for FILE in /usr/libexec/ibus-engine-table /usr/libexec/ibus-ui-gtk /usr/bin/ibus-setup /usr/bin/table-createdb
do
sed -i 's/python/python2.6/g' $FILE
done
@lovelock
lovelock / gist:7191364
Created October 28, 2013 04:15
/usr/share/polkit-1/rules.d/10-drivers.rules fix for automount internal hard drive.
polkit.addRule(function(action, subject) {
if (action.id.indexOf("org.freedesktop.udisks2.") == 0){
return polkit.Result.YES;
}
}
);
@lovelock
lovelock / compton.conf
Created October 26, 2013 13:40
Configuration for compton, a composer for X11, both for XFCE4 and LXDE, which has no window manager supporting openGL. With this in your ~/.config/, you can enjoy a tear-free Desktop environment. You can access the origin post here: http://duncanlock.net/blog/2013/06/07/how-to-switch-to-compton-for-beautiful-tear-free-compositing-in-xfce/
#################################
#
# Backend
#
#################################
# Backend to use: "xrender" or "glx".
# GLX backend is typically much faster but depends on a sane driver.
backend = "glx";
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static