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
| ## Install homebrew: | |
| ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
| ## Run brew doctor to make sure everything is ok | |
| brew doctor | |
| ## Install mutt | |
| brew install mutt | |
| ## Setup your .muttrc file with the gmail smtp info: |
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
| #!/usr/bin/env ruby | |
| require 'mysql2' | |
| mysql = Mysql2::Client.new(:default_file => '/root/.my.cnf', :default_group => 'client') | |
| mysql.query_options.merge!(:symbolize_keys => true) | |
| result = mysql.query("SELECT siteid,servername,port FROM qa34ga.SiteUrls;") | |
| result.each { |x| p x } | |
| # {:siteid=>1, :servername=>"www.qa34ga.mydomain.com", :port=>80} | |
| # {:siteid=>502, :servername=>"graduationtest.qa34ga.mydomain.com", :port=>80} |
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
| require 'io/console' | |
| print "Please enter your password: " | |
| password = STDIN.noecho(&:gets).chomp | |
| puts ## This is here to add a line break after grabbing the user input |
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
| #!/bin/bash | |
| CACERTS_KEYSTORE="/usr/java/latest/jre/lib/security/cacerts" | |
| wget http://www.startssl.com/certs/ca.pem | |
| keytool -import -trustcacerts -file ca.pem -alias startssl_ca -keystore ${CACERTS_KEYSTORE} |
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
| file { '/etc/opendkim.conf': | |
| ensure => present, | |
| owner => root, | |
| group => root, | |
| mode => 644, | |
| source => 'puppet:///modules/postfix/etc/opendkim.conf', | |
| notify => [ Exec['execName'], Service['opendkim'] ], | |
| } |
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
| require 'optparse' | |
| options = {} | |
| optparse = OptionParser.new do |opts| | |
| opts.banner = "Usage: #{File.basename($0)} [options]" | |
| opts.on("-d", "--debug", | |
| "Enables some helpful debugging output." | |
| ) { |value| options[:debug] = 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
| # Example use: | |
| # | |
| # 1.9.3p392 :000 > equal_div(432,239842934,22) | |
| # => [[432, 10902364], [10902365, 21804297], [21804298, 32706230], [32706231, 43608163], [43608164, 54510096], [54510097, 65412029], [65412030, 76313962], [76313963, 87215895], [87215896, 98117828], [98117829, 109019761], [109019762, 119921694], [119921695, 130823627], [130823628, 141725560], [141725561, 152627493], [152627494, 163529426], [163529427, 174431359], [174431360, 185333292], [185333293, 196235225], [196235226, 207137158], [207137159, 218039091], [218039092, 228941024], [228941025, 239842934]] | |
| # | |
| # 1.9.3p392 :001 > equal_div(432,239842934,4) | |
| # => [[432, 59961058], [59961059, 119921685], [119921686, 179882312], [179882313, 239842934]] | |
| # | |
| def equal_div(first, last, num_of_groups) |
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
| #!/bin/bash | |
| # on centos minimal | |
| yum install gcc | |
| yum install make | |
| yum install ncurses-devel | |
| yum install lua lua-devel | |
| yum install ruby ruby-devel | |
| yum install python python-devel | |
| yum install perl perl-devel |
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
| #!/bin/bash | |
| srpm_url=$1 | |
| srpm=`basename $srpm_url` | |
| srpm_name=`echo $srpm | sed -r 's|-[0-9]+.*$||g'` | |
| cat <<EOF | |
| ## Setting up tree for: ## | |
| ########################## |
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
| server { | |
| listen 80; | |
| server_name accessphase.mydomain.com; | |
| rewrite ^ https://accessphase.mydomain.com$request_uri permanent; | |
| } | |
| server { | |
| listen 192.168.97.208:443; | |
| server_name accessphase.mydomain.com; | |
| root /opt/nginx/accessphase.mydomain.com/public_html; |