Skip to content

Instantly share code, notes, and snippets.

View lxneng's full-sized avatar
🎯
Focusing

Eric Luo lxneng

🎯
Focusing
View GitHub Profile
@andreyp
andreyp / gist:1084193
Created July 15, 2011 06:23
screenshot with selenium
#!/usr/bin/env python
from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://lenta.ru/')
browser.save_screenshot('screenie.png')
browser.close()
@kennethreitz
kennethreitz / history.txt
Created September 14, 2011 23:33
Most used commands, in order by usage, since last install
1665 git
1180 mate
912 ls
879 cd
751 gitx
596 python
359 ./manage.py
198 j
180 rm
169 clear
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@PaulusTM
PaulusTM / passenger_status
Created October 27, 2011 08:37
passenger status for munin
#!/usr/bin/env ruby
# by Daniel Paulus | 27 - 10 - 2011
#
# put in /usr/share/munin/plugins/passenger_status
# chmod a+x /usr/share/munin/plugins/passenger_status
# ln -s /usr/share/munin/plugins/passenger_status /etc/munin/plugins/passenger_status
#
# add this to /etc/munin/plugin-conf.d/munin-node:
# [passenger_*]
# user root
@roidrage
roidrage / ebooks.md
Created December 2, 2011 15:15
Self-published and awesome
@turicas
turicas / Makefile
Created December 3, 2011 23:22
Create slugs and abbreviate names using Python
test:
clear
nosetests --with-coverage --cover-package name_utils test_name_utils.py
clean:
find -regex '.*\.pyc' -exec rm {} \;
find -regex '.*~' -exec rm {} \;
.PHONY: test clean
@afternoon
afternoon / git-slim.py
Created December 5, 2011 14:42
Remove large objects from a git repository
#!/usr/bin/python
#
# git-slim
#
# Remove big files from git repo history.
#
# Requires GitPython (https://github.com/gitpython-developers/GitPython)
#
# References:
# - http://help.github.com/remove-sensitive-data/
@dennisreimann
dennisreimann / manual_passenger_nginx.sh
Created December 6, 2011 13:57
Manual Nginx installation via Passenger
# download and untar nginx
wget -O /tmp/nginx.tar.gz http://www.nginx.org/download/nginx-1.0.11.tar.gz
tar xzvf /tmp/nginx.tar.gz
rm /tmp/nginx.tar.gz
# download and untar extra modules
wget -O /tmp/nginx-echo-module.tar.gz https://github.com/agentzh/echo-nginx-module/tarball/v0.38rc1
tar xzvf /tmp/nginx-echo-module.tar.gz
rm /tmp/nginx-echo-module.tar.gz
@lucasdavila
lucasdavila / install_munin_and_passenger_plugins.sh
Created December 21, 2011 16:36
Install Munin and Passenger Plugins
# to use this gist execute: $ rm -f 1506695 && wget https://raw.github.com/gist/1506695 && sh 1506695
# refs to http://www.alfajango.com/blog/how-to-monitor-your-railspassenger-app-with-munin/
echo "Installing munin..."
sudo apt-get install munin munin-node -y
echo ;
echo "Removing previous links for passenger_status and passenger_memory_stats..."
sudo rm /etc/munin/plugins/passenger_memory_stats
sudo rm /etc/munin/plugins/passenger_status
@jdan
jdan / listall.py
Created January 13, 2012 03:19
A python script to recursively list all files in a given directory, newline separated
#!/usr/bin/python
import os
import sys
def listdir(d):
if not os.path.isdir(d):
print d
else:
for item in os.listdir(d):
listdir((d + '/' + item) if d != '/' else '/' + item)