Skip to content

Instantly share code, notes, and snippets.


Smart huangzhichong

  • BlueWhale IoT
  • Xi'an, China
View GitHub Profile
huangzhichong / aliyun.sources.list
Created Jul 7, 2016 — forked from cloverstd/aliyun.sources.list
阿里云 ubuntu 14.04 镜像
View aliyun.sources.list
# deb trusty main restricted
# deb trusty main restricted
# deb trusty-updates main restricted
# deb trusty-updates main restricted
# deb trusty-security main restricted
# See for how to upgrade to
# newer versions of the distribution.
deb trusty main restricted
huangzhichong /
Last active Jun 7, 2016 — forked from sandcastle/
Install TeamCity 9.0.3 on Ubuntu with Nginx


Follow the steps below to install Team City 9.0.3 on Ubuntu with Nginx as the proxy for port 80.

Install Team City:

# will install on port 8111
sudo wget -c -O /tmp/
from selenium import webdriver
from selenium.webdriver.remote.remote_connection import RemoteConnection
from selenium.webdriver.remote.errorhandler import ErrorHandler
from selenium.webdriver.remote.command import Command
class PersistentWebdriver (webdriver.Remote):
def __init__(self, session_id=None, browser_name=''):
View gist:8328352
I recently had to install MySQL 5.6 on Ubuntu 12.04 from a .deb package on the MySQL website. It seems that either the package has been updated recently or nobody uses this method to install so I ended up running into endless problems. Through trial and error I found the following method works for me.
Install libaio-dev:
sudo apt-get install libaio-dev
Now install your package(mine was enterprise edition, community may have a different filename):
sudo dpkg -i mysql-advanced-5.6.10-debian6.0-x86_64.deb
This will install your files to the /opt directory, instead of the more common /etc directory. No worries, all we need to do is point our system at this new directory.
huangzhichong / gist:3618647
Created Sep 4, 2012 — forked from samqiu/railscasts.rb
download railscast video
View gist:3618647
require 'rss'
p 'Downloading rss index'
rss_string = open('').read
rss = RSS::Parser.parse(rss_string, false)
videos_urls = { |it| it.enclosure.url }.reverse
videos_filenames = {|url| url.split('/').last }

API workthough

  1. Open a browser

    # start an instance of firefox with selenium-webdriver
    driver = Selenium::WebDriver.for :firefox
    # :chrome -> chrome
    # :ie     -> iexplore
  • Go to a specified URL
huangzhichong / fast-setup-selenium-framework.rb
Created Jul 17, 2012
setup Selenium-Rspec automation framework with this sample script
View fast-setup-selenium-framework.rb
def write(text="")
puts text
def say(message, subitem=false)
write "#{subitem ? " ->" : "--"} #{message}"
def say_custom(tag, text)
say "\033[1m\033[36m" + tag.to_s.rjust(10) + "\033[0m" + " #{text}"
huangzhichong / BingHome.rb
Created Jul 17, 2012
the demo library for home page in my Selenium-Rspec project
View BingHome.rb
module BingHome
class SearchKeyInputBox < TextInput
def initialize"id","sb_form_q","SearchKeyInputBox")
class SearchButton < Button
def initialize
huangzhichong / config.yml
Created Jul 17, 2012
demo config file for my Selenium-Rspec automation scrip
View config.yml
plan_name: Camps CUI BVT
status: completed
created_dt: 2012-1-11
version: 1
last_modified_dt: 2012-1-11
timeout: 300
actions: action