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
| RUBY_VERSION="1.9.3-p362" | |
| ###Use this for global readline for later reuse | |
| # OPT_DIR=/usr/local/ruby-opt/ | |
| OPT_DIR=${HOME}/.rbenv/versions/${RUBY_VERSION}/ | |
| git clone git://github.com/sstephenson/rbenv.git ~/.rbenv | |
| cd ~/.rbenv/plugins | |
| git clone git://github.com/sstephenson/ruby-build.git | |
| cd /tmp |
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 'aws-sdk' | |
| def get_aws_account_id(access_key_id, secret_access_key) | |
| begin | |
| iam = AWS::IAM.new(:access_key_id => access_key_id, | |
| :secret_access_key => secret_access_key) | |
| iam = iam.client.get_user | |
| id, user = iam[:user][:arn].match('^arn:aws:iam::([0-9]{12}):(.*)$').captures | |
| rescue AWS::IAM::Errors::AccessDenied | |
| result = $! |
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 'xmlrpc/client' | |
| class SMS | |
| def self.deliver(phonenumber, text) | |
| user = Rack::Utils.escape(SIPGATE_USER_NAME) | |
| url = "https://#{user}:#{SIPGATE_PASSWORD}@api.sipgate.net/RPC2" | |
| client = XMLRPC::Client.new2(url) | |
| client.call('samurai.ClientIdentify', {'ClientName' => 'Ruby-Client'} ) | |
| number = strip_phonenumber(phonenumber) |
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 'rubygems' | |
| require 'savon' | |
| require 'tempfile' | |
| require 'base64' | |
| USER = 'PRT_001' | |
| PASS = 'YOUR_PASSWORD_GOES_HERE' | |
| SAP_BASE_URL = 'https://my012345.sapbydesign.com' |
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 'rubygems' | |
| require 'aws-sdk' | |
| require 'highline/import' | |
| def get_aws_account_data(iam) | |
| begin | |
| iam = iam.client.get_user | |
| id, user = iam[:user][:arn].match('^arn:aws:iam::([0-9]{12}):(.*)$').captures |
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/ruby | |
| require 'openssl' | |
| require 'date' | |
| Dir.chdir('/Users/thomas/Desktop/certs') | |
| Dir.glob('./*.pem') do |file| | |
| next if file =~ /.k.pem$/ | |
| puts file |
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
| SET termout OFF | |
| ALTER SESSION SET NLS_DATE_FORMAT = 'dd.mm.yyyy HH24:mi:ss'; | |
| SET termout ON | |
| SET sqlprompt "_USER'@'_CONNECT_IDENTIFIER _PRIVILEGE> " | |
| set pagesize 50000 | |
| SET linesize 190 |
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
| tell application "OmniGraffle Professional 5" | |
| --Setup export options | |
| set current export settings's area type to selected graphics | |
| set current export settings's draws background to false | |
| set current export settings's export scale to 1 | |
| set current export settings's include border to false | |
| set current export settings's resolution to 2.0 | |
| --Retrieve the desired output export path | |
| set myFolder to POSIX path of (choose folder) |
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
| on replace(sourcetext, search, replacement) | |
| set oldDelim to AppleScript's text item delimiters | |
| set AppleScript's text item delimiters to the search | |
| set the textItemList to every text item of the sourcetext | |
| set AppleScript's text item delimiters to the replacement | |
| set the output to the textItemList as string | |
| set AppleScript's text item delimiters to oldDelim | |
| return output | |
| end replace |
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
| ruby -r oci8 -e "OCI8.new('xms01','R1launch','//my.cool.host:1521/ORACM.BLA').exec('select sysdate from dual') do |r| puts r.join(','); end" |
OlderNewer