Skip to content

Instantly share code, notes, and snippets.

View huangzhichong's full-sized avatar

Smart huangzhichong

  • BlueWhale IoT
  • Xi'an, China
View GitHub Profile
@huangzhichong
huangzhichong / aliyun.sources.list
Created July 7, 2016 07:14 — forked from cloverstd/aliyun.sources.list
阿里云 ubuntu 14.04 镜像
# deb http://mirrors.aliyun.com/ubuntu trusty main restricted
# deb http://mirrors.aliyuncs.com/ubuntu trusty main restricted
# deb http://mirrors.aliyun.com/ubuntu trusty-updates main restricted
# deb http://mirrors.aliyuncs.com/ubuntu trusty-updates main restricted
# deb http://security.ubuntu.com/ubuntu trusty-security main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.aliyun.com/ubuntu trusty main restricted
@huangzhichong
huangzhichong / install-teamcity.md
Last active June 7, 2016 14:55 — forked from sandcastle/install-teamcity.md
Install TeamCity 9.0.3 on Ubuntu with Nginx
@huangzhichong
huangzhichong / PersistentWebdriver.py
Last active September 22, 2015 08:11 — forked from dnedbaylo/PersistentWebdriver.py
PersistentWebdriver
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=''):
command_executor='http://localhost:4444/wd/hub'
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
huangzhichong / gist:3618647
Created September 4, 2012 08:43 — forked from samqiu/railscasts.rb
download railscast video
#!/usr/bin/ruby
require 'rss'
p 'Downloading rss index'
rss_string = open('http://feeds.feedburner.com/railscasts').read
rss = RSS::Parser.parse(rss_string, false)
videos_urls = rss.items.map { |it| it.enclosure.url }.reverse
videos_filenames = videos_urls.map {|url| url.split('/').last }
@huangzhichong
huangzhichong / selenium-webdriver-cheatsheet.md
Created August 7, 2012 12:38
Selenium Webdriver CheatSheet

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
huangzhichong / fast-setup-selenium-framework.rb
Created July 17, 2012 10:06
setup Selenium-Rspec automation framework with this sample script
def write(text="")
puts text
end
def say(message, subitem=false)
write "#{subitem ? " ->" : "--"} #{message}"
end
def say_custom(tag, text)
say "\033[1m\033[36m" + tag.to_s.rjust(10) + "\033[0m" + " #{text}"
@huangzhichong
huangzhichong / BingHome.rb
Created July 17, 2012 09:12
the demo library for cn.Bing.com home page in my Selenium-Rspec project
module BingHome
class SearchKeyInputBox < TextInput
def initialize
TextInput.new("id","sb_form_q","SearchKeyInputBox")
end
end
class SearchButton < Button
def initialize
@huangzhichong
huangzhichong / config.yml
Created July 17, 2012 09:01
demo config file for my Selenium-Rspec automation scrip
plan_name: Camps CUI BVT
owner: smart.huang@test.com
status: completed
created_dt: 2012-1-11
version: 1
last_modified_dt: 2012-1-11
timeout: 300
actions: action
QAS: