This file contains 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 multi_db_commit(tx_id, dbs) | |
prepared = [] | |
dbs.each do |db, pr| | |
db.transaction(:prepare=>tx_id, &pr) | |
prepared << db | |
end | |
rescue | |
prepared.each do |db| | |
begin |
This file contains 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
require "watir-webdriver" | |
caps = Selenium::WebDriver::Remote::Capabilities.firefox | |
caps.platform = :LINUX | |
caps[:name] = "WebDriver" | |
browser = Watir::Browser.new(:remote, url: "http://192.168.119.118:4444/wd/hub", desired_capabilities: caps) | |
browser.goto "http://www.google.com" | |
browser.quit |
This file contains 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
var extend = function(child) { | |
var base = this; | |
if(child) { | |
for(var prop in child) { | |
base[prop] = child[prop]; | |
} | |
for(var prop in child) { | |
base.prototype[prop] = child[prop]; |
This file contains 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
{ with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i } | |
pwd | |
{ with: /\A(?=.*[a-zA-Z])(?=.*[0-9]).{6,}\z/ } |
This file contains 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
config.action_mailer.perform_deliveries = true | |
config.action_mailer.smtp_settings = { | |
address: ENV['SMTP_SERVER'], | |
authentication: :login, | |
domain: 'example.com', | |
port: 25, | |
password: ENV['SMTP_PASSWORD'], | |
user_name: ENV['SMTP_USERNAME'], | |
enable_starttls_auto: true | |
} |
This file contains 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
### BEGIN INIT INFO | |
# Provides: Xvfb | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: | |
# X-Start-Before: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Loads X Virtual Frame Buffer | |
### END INIT INFO | |
# To automatically run on startup use command: |
This file contains 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
worker: QUEUE=* bundle exec rake environment resque:work | |
scheduler: bundle exec rake environment resque:scheduler |
This file contains 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 rkhunter --quiet --checkall --no-mail-on-warning |
This file contains 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
#!/bin/bash | |
# Check your release, none LTS need to apply this script | |
# lsb_release -a | |
cd /tmp && mkdir src && cd src | |
wget http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz | |
#download all patches | |
for i in $(seq -f "%03g" 0 27); do wget http://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-$i; done |
This file contains 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
# Microsoft Windows | |
# (Win 7/Vista/XP/Win ME/Win 2000/Win 98) | |
# - Start -> Run -> type cmd | |
# At the command prompt, type: | |
ipconfig /flushdns | |
# Certain Linux distributions | |
# Restart the nscd daemon | |
/etc/rc.d/init.d/nscd restart |
OlderNewer