Skip to content

Instantly share code, notes, and snippets.

git branch
git checkout develop
git status
git pull
git submodule init
git submodule update
git diff models/OrderModel.php
git add models/OrderModel.php
git commit -m'修复订单导出BUG'
git pull
@coffeant
coffeant / gist:f9423821ea6c32ed76f8
Created June 3, 2015 01:55
ubuntu modify date timezone to china shanghai
sudo tzconfig,如果命令不存在请使用 dpkg-reconfigure tzdata
然后按照提示选择 Asia对应的序号,选完后会显示一堆新的提示—输入城市名,如Shanghai或Chongqing,最后再用 sudo date -s “” 来修改本地时间
sudo cp /usr/share/zoneinfo/Asia/ShangHai /etc/localtime 防止系统重启后时区改变
sudo apt-get install ntpdate
设置系统时间与网络时间同步 ntpdate cn.pool.ntp.org
将系统时间写入硬件时间 hwclock -w :systohc
@coffeant
coffeant / gist:21040900b80d133f2b14
Created May 6, 2015 09:35
模拟浏览器抓屏功能
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, thread
import gtk, webkit
import ctypes
import warnings
import urllib
import json
from sys import stdin
from time import sleep
#!/usr/bin/expect -f
#Usage
#assume you save this file as "go"
#1 ./go 10.148.137.174 user is default "root"
#2 ./go 10.148.137.174:/usr/local user is default "root" after login,it will open directory /usr/local/ automatically
#3 ./go franklan@10.148.137.174 user is "franklan"
#4 ./go root@10.148.137.174:/usr/local/ after login,it will open directory /usr/local/ automatically
proc try_password { path} {
#import global variables
@coffeant
coffeant / gist:1a665bac73bd3a3d6cd2
Created April 15, 2015 03:03
my vimrc file(适用于python+c)
" vimrc file for following the coding standards specified in PEP 7 & 8.
"
" To use this file, source it in your own personal .vimrc file (``source
" <filename>``) or, if you don't have a .vimrc file, you can just symlink to it
" (``ln -s <this file> ~/.vimrc``). All options are protected by autocmds
" (read below for an explanation of the command) so blind sourcing of this file
" is safe and will not affect your settings for non-Python or non-C files.
"
"
" All setting are protected by 'au' ('autocmd') statements. Only files ending
@coffeant
coffeant / gist:2d114c3e0386723eca46
Created April 13, 2015 08:55
the subtitle of code rush
0:17lots of people
0:19and here are looking for the silicon valley experince arrive one suitcase
0:24and when they head south on the one oh one
0:27hoping to see me at this place they've heard about
0:32is freeways
0:33and its office
0:35and it's strip mall
0:38it looks like every place i've ever been random wondering where the com wanted to
0:42come here was a good price
0:47itself is the underlying
@coffeant
coffeant / gist:50e03cb63acc415693c5
Last active August 29, 2015 14:14
window 实现apt-get 神器之 Chocolatey
https://chocolatey.org/ [Chocolatey: A delicious Windows package manager]
1. What is Chocolatey?
Chocolatey is a command line application installer for Windows based on a developer-centric package manager called NuGet. Unlike manual installations, Chocolatey adds, updates, and uninstalls programs in the background requiring very little user interaction.
Chocolatey has its own package feed that is created and maintained by the project’s community members.
Behind the scenes, most Chocolatey packages simply download a program’s official executable and install it without any further interaction from the user.
2. How to Install?
@coffeant
coffeant / .vimrc
Last active August 29, 2015 14:11 — forked from MauricioCarneiro/.vimrc
" Vundle configuration
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/vundle/ " set the runtime path to include Vundle and initialize
call vundle#begin()
" Plugins
Bundle 'gmarik/vundle'
Bundle 'Valloric/YouCompleteMe'
Bundle 'a.vim'
http://translations.readthedocs.org/en/latest/hacker_howto.html
@coffeant
coffeant / gist:938d509dbcb1eb7788d7
Last active August 29, 2015 14:11
gdb 完全手册
https://sourceware.org/gdb/current/onlinedocs/gdb/index.html