Skip to content

Instantly share code, notes, and snippets.

View edwardtoday's full-sized avatar

Pei Qing 卿培 edwardtoday

View GitHub Profile
%!TEX root = ../thesis.tex
@edwardtoday
edwardtoday / gist:5144006
Last active December 14, 2015 20:29
self introduction template
Good morning, dear teachers.
Thank you so much for providing me this opportunity to introduce myself.
My name is XXX. I was born in Henan province 24 years ago. My parents are both Chinese teachers in middle school.
Talking about my qualifications, I have received my bachelor's degree in July 2012 from Tsinghua University.
My major was Computer Science and Technology.
I have a strong body. In 2008, I managed to finish a half marathon race in The Beijing International Marathon. Basketball is my favorite sport. I have been class team captain since freshman year. I have once led my team into the quarterfinals in department cup.
I am a hard-worker not only when I am playing basketball, but off court as well. Being self-motivated is my strength. Although I have experienced failures in course study, I have learned to face the difficulties, come back to restart and never give up.
@edwardtoday
edwardtoday / install.sh
Last active December 14, 2015 21:19
What I have done to make jekyll run on Mountain Lion.
brew install apple-gcc42 autoconf automake libxml2 libxslt openssl curl-ca-bundle
brew tap raggi/ale
brew install openssl-osx-ca
openssl-osx-ca
# Install rvm with rails
\curl -#L https://get.rvm.io | bash -s stable --rails
# Install ruby
rvm pkg install openssl
@edwardtoday
edwardtoday / init.sh
Last active December 15, 2015 00:39
Ubuntu Server 12.10 AWS init script
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install build-essential libxml2-dev libfuse-dev libcurl4-openssl-dev emacs24-nox
# Install s3fs to mount S3 bucket locally
wget http://s3fs.googlecode.com/files/s3fs-1.63.tar.gz
tar zxf s3fs-1.63.tar.gz
cd s3fs-1.63/
./configure && make && sudo make install
touch ~/.passwd-s3fs
chmod 600 ~/.passwd-s3fs
@edwardtoday
edwardtoday / dropbox
Created March 16, 2013 07:36
/etc/init.d/dropbox
#!/bin/sh
# dropbox service
# Replace with linux users you want to run Dropbox clients for
DROPBOX_USERS="ubuntu"
DAEMON=.dropbox-dist/dropbox
start() {
echo "Starting dropbox..."
for dbuser in $DROPBOX_USERS; do
HOMEDIR=`getent passwd $dbuser | cut -d: -f6`
if [ -x $HOMEDIR/$DAEMON ]; then
@edwardtoday
edwardtoday / encode.sh
Last active May 19, 2025 03:00
ffmpeg encoding command with x264 and fdk_aac
#!/usr/bin/env sh
ffmpeg -i $1 -c:v libx264 -crf 18 -preset veryslow -tune film -c:a libfdk_aac -vbr 5 $2
@edwardtoday
edwardtoday / gist:6658353
Last active December 23, 2015 15:49
Install Homebrew packages I need.
brew tap homebrew/dupes
brew install apple-gcc42
brew reinstall poppler --with-glib
brew install aacgain aspell astyle brew-gem brew-pip curl curl-ca-bundle ditaa emacs faac gist go grc git-flow git-extras graphviz imagemagick jpegoptim mercurial macvim mp3gain node ntfs-3g osxutils pdf2htmlex opencc openssl pdf2svg osxfuse gnuplot pypy python python3 qpdf r ruby scala ssh-copy-id subversion svg2pdf svg2png tree webkit2png wget wireshark youtube-dl yuicompressor zsh zsh-completions zsh-lovers zsh-syntax-highlighting xz coreutils
# oh-my-zsh
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
# install ffmpeg
brew install automake autojump celt faac fdk-aac git lame libass libtool libvorbis libvpx libvo-aacenc opencore-amr openjpeg opus sdl schroedinger shtool speex texi2html theora wget x264 xvid yasm
@edwardtoday
edwardtoday / lang-zh-CN.conf
Created November 28, 2013 00:45
AsciiDoc Simplified Chinese language configuration file.
#
# AsciiDoc Simplified Chinese language configuration file.
# Originally written by Pei Qing
#
[attributes]
# Captions, used by (X)HTML backends.
# Captions on RHS are displayed in outputs.
ifdef::basebackend-html[]
@edwardtoday
edwardtoday / txt2mobi.sh
Last active December 30, 2015 00:19
script to convert file from txt in gb18030 encoding to mobi
#!/bin/sh
echo "convert to utf8"
iconv -c -f GB18030 -t UTF8 $1 > $1.tmp
echo "txt cleanup"
sed 's/.$//' $1.tmp > $1.tmp.tmp && mv $1.tmp.tmp $1.tmp # dos2unix
sed '/^$/d;G' $1.tmp > $1.tmp.tmp && mv $1.tmp.tmp $1.tmp # double spacing
sed 's/^[ \t]*//;s/[ \t]*$//' $1.tmp > $1.tmp.tmp && mv $1.tmp.tmp $1.tmp # delete leading and trailing spaces
sed 's/#//' $1.tmp > $1.tmp.tmp && mv $1.tmp.tmp $1.tmp # delete # char
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
#
# retrieved from: http://dound.com/2009/04/git-forever-remove-files-or-folders-from-history/
#