-
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
| data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> | |
| <!-- | |
| For other language: Instead of `ace/mode/ruby`, Use | |
| Markdown -> `ace/mode/markdown` | |
| Python -> `ace/mode/python` | |
| C/C++ -> `ace/mode/c_cpp` | |
| Javscript -> `ace/mode/javascript` | |
| Java -> `ace/mode/java` | |
| Scala- -> `ace/mode/scala` |
| # Check for an interactive session | |
| [ -z "$PS1" ] && return | |
| alias ls='ls --color=auto' | |
| PS1='[\u@\h \W]\$ ' | |
| bash_prompt() { | |
| local NONE="\[\033[0m\]" # unsets color to term's fg color | |
| #!/usr/bin/env ruby | |
| require 'net/telnet' | |
| require 'lib/trollop' | |
| opts = Trollop::options do | |
| banner <<-EOS | |
| Command line tool to list memcache keys and to get the value of a specific key | |
| Usage: | |
| memcache [options] |
| #Slows down selenium so you can see what's going on | |
| #http://stackoverflow.com/questions/4815516/how-can-i-run-selenium-used-through-capybara-at-a-lower-speed/5150855#5150855 | |
| #require 'selenium-webdriver' | |
| #module ::Selenium::WebDriver::Remote | |
| # class Bridge | |
| # def execute(*args) | |
| # result = raw_execute(*args)['value'] | |
| # sleep 0.1 | |
| # result | |
| # end |
As configured in my dotfiles.
start new:
tmux
start new with session name:
NOTE: You can check, if your config here:
http://www.sslshopper.com/ssl-checker.html
Decrypt the private key using the password you entered when you created your key:
openssl rsa -in ssl.key -out /etc/nginx/conf/ssl.key
Protect your key from prying eyes:
chmod 600 /etc/nginx/conf/ssl.key
| #!/usr/bin/env ruby | |
| # List all keys stored in memcache. | |
| # Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place. | |
| require 'net/telnet' | |
| headings = %w(id expires bytes cache_key) | |
| rows = [] |