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
wget -q -O - \ | |
https://www.pingdom.com/rss/probe_servers.xml | \ | |
perl -nle 'print $1 if /IP: (([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5]));/' | \ | |
sort -n -t . -k1,1 -k2,2 -k3,3 -k4,4 |
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 'mechanize' | |
m = Mechanize.new | |
users = [] | |
rooms = [] | |
login = m.get('https://secure.live.sipgate.de/settings/setup') | |
login.form do |f| | |
f.username = 'name@company.com' | |
f.password = 'secret_password' |
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 'aws-sdk' | |
AWS.config({ | |
access_key_id: ENV['AWSAccessKeyId'].strip, | |
secret_access_key: ENV['AWSSecretKey'].strip, | |
region: 'eu-west-1', | |
use_ssl: true, | |
}) | |
r53 = AWS::Route53.new |
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
# upload-cert www_myserver_com.crt aws_profile_name SSL123_SecondaryCA.crt SSL123_PrimaryCA.crt | |
function upload-cert() { | |
NAME=`echo "$1" | cut -d'.' -f1` | |
END=`openssl x509 -in $NAME.crt -noout -enddate | cut -f2 -d= | while read x; do date -j -f '%b %d %T %Y %Z' "$x" '+%Y-%m-%d'; done` | |
cat $3 $4 $5 >certchain.pem | |
aws --profile $2 iam upload-server-certificate --server-certificate-name ${NAME}-${END} \ | |
--certificate-body file://$NAME.crt --private-key file://$NAME.key.rsa --certificate-chain file://certchain.pem | |
} |
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
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 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 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 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 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 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 |
OlderNewer