This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo bash | |
| echo "password" | wpa_passphrase "My Essid" > /etc/wpa_supplicant.conf | |
| wpa_supplicant -D wext -c /etc/wpa_supplicant.conf -i wlan0 | |
| dhclient wlan0 | |
| #or | |
| #iwconfig wlan0 192.168.1.123/24 up && ip ro add 0/0 via 192.168.1.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D | |
| rails_env = ENV['RAILS_ENV'] || 'production' | |
| # 16 workers and 1 master | |
| worker_processes (rails_env == 'production' ? 16 : 4) | |
| # Load rails+github.git into the master before forking workers | |
| # for super-fast worker spawn times | |
| preload_app true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def form_tag(url, options={}, &block) | |
| desired_method = options[:method].to_s | |
| options.delete(:method) unless desired_method =~ /get|post/i | |
| options.reverse_merge!(:method => 'post', :action => url) | |
| options[:enctype] = 'multipart/form-data' if options.delete(:multipart) | |
| options['accept-charset'] ||= 'UTF-8' | |
| inner_form_html = hidden_form_method_field(desired_method) | |
| inner_form_html << csrf_token_field unless desired_method =~ /get/i | |
| inner_form_html << mark_safe(capture_html(&block)) | |
| concat_content content_tag(:form, inner_form_html, options) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ history | awk {'print $2, $3, $4'} | sort | uniq -c | sort -k1 -rn | head -n 30 | |
| 610 git status | |
| 568 git commit -m | |
| 491 git add . | |
| 252 git push origin | |
| 176 bundle | |
| 138 rails s | |
| 128 ls | |
| 120 git commit --amend | |
| 114 git reset --hard |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| openssl genrsa -des3 -out server.key 1024 | |
| openssl req -new -key server.key -out server.csr | |
| cp server.key server.key.org | |
| openssl rsa -in server.key.org -out server.key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| history | awk '{print $2}' | sort | uniq -c | sort -rn | head |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for i in {1..200}; do wget http://www.example.com/captcha.php -O $i.png;done; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #uninstall all gems | |
| gem list | cut -d" " -f1 | xargs gem uninstall -aIx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install cmake libgtk2.0-dev python-numpy | |
| wget http://ufpr.dl.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.6.1/opencv-2.4.6.1.tar.gz #(or link here: http://sourceforge.net/projects/opencvlibrary/?source=dlp) | |
| cd OpenCv-2-4-0 | |
| tar xf opencv* | |
| cd opencv* | |
| cmake -D CMAKE_BUILD_TYPE=RELEASE -D BUILD_NEW_PYTHON_SUPPORT=ON -D CMAKE_INSTALL_PREFIX=/usr/local ./ | |
| make && sudo make install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Capybara.register_driver :selenium do |app| | |
| profile = Selenium::WebDriver::Firefox::Profile.new | |
| profile["network.proxy.type"] = 1 # manual proxy config | |
| profile["network.proxy.http"] = "localhost" | |
| profile["network.proxy.http_port"] = 8080 | |
| Capybara::Selenium::Driver.new(app, :profile => profile) | |
| end |