Skip to content

Instantly share code, notes, and snippets.

@ewangke
ewangke / setup-debian.sh
Created July 14, 2012 20:31
LNMP based Wordpress install script modified from LowEndBox's script
#!/bin/bash
function check_install {
if [ -z "`which "$1" 2>/dev/null`" ]
then
executable=$1
shift
while [ -n "$1" ]
do
DEBIAN_FRONTEND=noninteractive apt-get -q -y install "$1"
@ewangke
ewangke / pptpinstall.sh
Created July 14, 2012 10:19
Install PPTP vpn server on Xen Ubuntu
#!/bin/bash
# Interactive PoPToP install script on a OpenVZ VPS
# Tested on Debian 5, 6, and Ubuntu 11.04
# 2011 v1.1
# Author: Commander Waffles
# http://www.putdispenserhere.com/pptp-debian-ubuntu-openvz-setup-script/
echo "######################################################"
echo "Interactive PoPToP Install Script for OpenVZ VPS"
echo "by Commander Waffles http://www.putdispenserhere.com"
@ewangke
ewangke / subl_shortcut.md
Created June 9, 2012 23:13 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

h1. Sublime Text 2 - Useful Shortcuts (Mac OS X)

h2. General

| ⌘T | go to file | | ⌘⌃P | go to project | | ⌘R | go to methods | | ⌃G | go to line | | ⌘KB | toggle side bar | | ⌘⇧P | command prompt |

@ewangke
ewangke / sublime_text_2_shortcut_cn.txt
Created June 9, 2012 21:50
Sublime Text 2快捷键
打开/前往
⌘T 前往文件
⌘⌃P 前往项目
⌘R 前往 method
⌘⇧P 命令提示
⌃G 前往行
⌘KB 开关侧栏
⌃ ` python 控制台
⌘⇧N 新建窗口
@ewangke
ewangke / GifExportor.m
Created June 9, 2012 21:22 — forked from akisute/gist:1141953
Create an animated gif file from images in iOS
#import <UIKit/UIKit.h>
#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/MobileCoreServices.h>
- (void)exportAnimatedGif
{
UIImage *shacho = [UIImage imageNamed:@"shacho.png"];
UIImage *bucho = [UIImage imageNamed:@"bucho.jpeg"];
NSString *path = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"animated.gif"];
@ewangke
ewangke / manage_simplehttpserver.sh
Created June 9, 2012 21:20 — forked from wxianfeng/manage_simplehttpserver.sh
manage python SimpleHTTPServer for serve page
#!/bin/bash
##
# start|stop|restart python SimpleHTTPServer
#
# TODO:
# use shell Function for DRY
# USAGE:
# ./manage_simplehttpserver.sh start|stop|restart
#