Skip to content

Instantly share code, notes, and snippets.

@ii0
ii0 / setup_mosh_centos.sh
Last active September 2, 2015 07:31 — forked from tancnle/setup_mosh_centos.sh
Setup mosh on Centos 6.x
#!/bin/sh
# Update latest epel
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -Uvh epel-release-6-8.noarch.rpm
# Download and build mosh
sudo yum -y install rpm-build rpmdevtools protobuf-compiler protobuf-devel libutempter-devel zlib-devel ncurses-devel openssh-clients perl-IO-Tty openssl-devel gcc gcc-c++
rpmdev-setuptree
cd ~/rpmbuild/SOURCES
@ii0
ii0 / mac_xwindows_x11_xvfb_headless_firefox_howto.md
Last active September 16, 2015 02:52 — forked from textarcana/mac_xwindows_x11_xvfb_headless_firefox_howto.md
Headless Selenium on CentOS 6.3 (Mac XWindows / X11 / Xvfb / Headless Firefox / Selenium howto)

XWindows for Headless Selenium

X Wing art by Paul Harckham

How to set up a Headless Selenium Testing environment for CentOS 6.3.

On your CentOS 6.3 host

Follow these steps to set up a CentOS 6.3 host to run headless Selenium tests with Firefox.

@ii0
ii0 / gist:3b32870fd10678264ee2
Created October 13, 2015 02:15 — forked from aaronky/gist:676015
tmux auto lock 5 min
set lock-after-time 300
@ii0
ii0 / tree.md
Created October 27, 2015 06:43 — forked from hrldcpr/tree.md
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@ii0
ii0 / .screenrc
Created November 5, 2015 05:41 — forked from joaopizani/.screenrc
A killer GNU Screen Config
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off
@ii0
ii0 / gist:759c7e98068ce1170803
Created November 29, 2015 05:15 — forked from notsobad/gist:3174626
海信智能电视中使用的网络服务
http://data.house.sina.com.cn/ip/app_addr.php?ip=
http://php.weather.sina.com.cn/xml.php?city=&password=DJOYnieT8234jlsK&day=
http://vip.stock.finance.sina.com.cn/quotes_service/view/HisenseSuggest.php?type=1,2&key=
http://vip.stock.finance.sina.com.cn/quotes_service/view/HisenseABQuotes.php?id=
http://image2.sinajs.cn/newchart/min/n/%s.gif
http://image2.sinajs.cn/newchart/daily/n/%s.gif
http://image2.sinajs.cn/newchart/weekly/n/%s.gif
http://image2.sinajs.cn/newchart/monthly/n/%s.gif
http://tvlist.dnethome.net:8088/cgi-bin/epg_index.fcgi?action=smarttv_ad&id=12
http://tvlist.dnethome.net:8088/cgi-bin/epg_index.fcgi?action=smarttv_ad&id=12
@ii0
ii0 / gist:90b14c6db9a1b5414aa8
Created November 29, 2015 13:00 — forked from bortzmeyer/gist:1284249
The only simple way to do SSH in Python today is to use subprocess + OpenSSH...
#!/usr/bin/python
# All SSH libraries for Python are junk (2011-10-13).
# Too low-level (libssh2), too buggy (paramiko), too complicated
# (both), too poor in features (no use of the agent, for instance)
# Here is the right solution today:
import subprocess
import sys
@ii0
ii0 / script.sh
Created December 1, 2015 01:40 — forked from kapkaev/script.sh
centOS gitosis
#step 1
yum -y install python-setuptools
#step 2
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
# or
# rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
#step 3
# if you using centOS 6.2 enable rpmforge-extras (enabled =1)
@ii0
ii0 / _gitlab_config.md
Created December 7, 2015 02:29 — forked from petermanser/_gitlab_config.md
Gitlab 5.4 - Gmail configuration

Gitlab 5.4 - Gmail configuration

In order to send messages through a Gmail account (also applicable to Google Apps accounts) add the following parts to your config files:

Files:

  • config/environments/production.rb
  • config/gitlab.yml
@ii0
ii0 / gist:afeb7e8dadd40066ec1b
Created December 7, 2015 02:29 — forked from xavierjurado/gist:3138813
Gitlab Gmail configuration

Gitlab Gmail configuration

In Gitlab 2.6 you must edit the following files in order to send messages through a Gmail account (also applicable to Google Apps accounts).

config/environments/production.rb

config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true