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
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 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 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" |
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/sh | |
echo "Statistik für Logfile $1" | |
awk '{sum+=$10} END {printf "%.2f GByte Transfervolumen\n",sum/1073741824}' $1 | |
echo "$(wc -l < "$1" | sed 's/[^[:digit:]]//g') Requests" | |
#echo "$(grep -ivE '(.js|.css|.pdf|.gif|.jpg|.jpeg|.png|.tif|.tiff|.mp3|.mp4a|.aac|.mpg|.mp4|.mov|.flv|.swf|.zip|.gz|.rpm|.tgz|.doc|.xls|.ppt|.wmv|.avi|.wav|.ico|.exe)' "$1" | wc -l | sed 's/[^[:digit:]]//g') Requests auf Assets" |
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/sh | |
# Or try awk '{sum+=$10} END {print sum/1048576}' | |
#export LC_ALL=C | |
#env LC_ALL=en_US sort | |
unset LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME | |
bytes_in_mb=1048576 | |
bytes_in_gb=1073741824 |
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
find . -name "*.extension" -print0 | xargs -0 ruby -i -p -e '$_.gsub! %r{(THIS)}, "THAT was \\1"' |
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
# 1. Generate a model Presence before: | |
# rails generate model presence ap_mac:string client_mac:string last_seen:datetime rssi:integer | |
# | |
# 2. Add a route: | |
# match 'meraki', :to => 'meraki#presenceapi', :as => :meraki | |
# | |
# 3. Test this controller via: | |
# curl -d data="{\"secret\":\"foobar\",\"probing\":[{\"ap_mac\":\"00:aa:bb:cc:dd:ee\",\"client_mac\":\"ff:ee:dd:cc:bb:aa\",\"last_seen\":\"Wed Jan 22 08:34:02.409 UTC 2014\",\"rssi\":\"16\"},{\"ap_mac\":\"11:22:33:44:55:66\",\"client_mac\":\"99:88:77:66:55:44\",\"last_seen\":\"Wed Jan 22 08:34:06.409 UTC 2014\",\"rssi\":\"29\"}]}" https://localhost:3000/meraki | |
# | |
# 4. Point Meraki to https://my.app.name/presenceapi |
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 'rubygems' | |
require 'openssl' | |
require 'digest/sha2' | |
require 'base64' | |
class CryptHelper | |
def self.generate_rsa_key(passphrase, bits = 4096) | |
cipher = OpenSSL::Cipher::AES256.new(:CBC) | |
rsa_key = OpenSSL::PKey::RSA.generate(bits) |
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
# Put this into lib/tasks | |
require 'rubygems' | |
require 'bundler' | |
require 'aws-sdk' | |
require 'socket' | |
require 'os' | |
if Rails.env.development? |
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
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | select(.region=="eu-west-1" or .region == "eu-central-1" or .region == "GLOBAL") | .ip_prefix' | sort -u | sort -n |