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
from re import A | |
from PIL import Image, ImageDraw | |
width = 180 | |
height = 240 | |
diff_start=0x80 | |
first_array_start = diff_start | |
first_array_end = diff_start + width * height - 1 | |
second_array_start = diff_start + width * height |
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
[sam@server ~]$ whois -s -h whois.iana.org service.gov.uk | grep refer: | |
refer: whois.nic.uk | |
[sam@server ~]$ whois -s -h whois.nic.uk service.gov.uk | grep refer: # note there is no referral answer | |
[sam@server ~]$ whois -s -h whois.nic.uk service.gov.uk | head # in fact it's showing gov.uk, not service.gov.uk | |
[Querying whois.nic.uk] | |
[whois.nic.uk] | |
Domain name: | |
gov.uk |
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
--- | |
foo: "%{hiera('bar')}" | |
bar: "%{hiera('baz')}" | |
baz: "blah" |
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
Enable Access for Assistive Devices (For Spectacle.app and Stay.app) | |
http://www.tekrevue.com/2013/06/25/how-to-enable-access-for-assistive-devices-in-os-x-mavericks/ |
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
$7 ~ /(without|with|base)-js/ { | |
split($7,array,"-"); | |
target_string=array[2]; | |
split(target_string,array2,"/"); | |
image=array2[2]; | |
switch (image) { | |
case "with": | |
WITH+=1 | |
break | |
case "without": |
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 'fastly' | |
service_id = 'deadbeefdeadbeef' | |
fastly = Fastly.new(:api_key => 'deadbeefdeadbeefdeadbeef') | |
service = fastly.get_service(service_id) | |
latest_version = service.version |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "puppetlabs/centos-7.0-64-nocm" | |
config.vm.provider :rackspace do |rs, override| | |
rs.username = ENV['OS_USERNAME'] | |
rs.api_key = ENV['OS_PASSWORD'] | |
rs.rackspace_region = ENV['OS_REGION_NAME'] |
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://www.gov.uk/government/uploads/system/uploads/attachment_data/file/362257/List_of_gov_uk_domain_names_as_at_1_October_2014.csv | \ | |
cut -d, -f1 | \ | |
while read line; do | |
whois -h whois.ja.net $line > tempfile; | |
OWNER=`egrep -A1 "(Domain Owner|Registered For)" tempfile | awk 'NR==2 {for (i=1; i<=NF; i++) printf("%s%s", $(i), i<NF ? OFS : "\n");}'`; | |
POSTCODE=`/opt/boxen/homebrew/opt/gnu-sed/libexec/gnubin/sed -rn 's/.*(([A-Z]{1,2}[0-9]{1,2}|[A-Z]{1,2}[0-9][A-Z]) [0-9][A-Z]{2}).*/\1/p' tempfile` ; | |
grep -q "No such domain" tempfile || print $line,$OWNER,$POSTCODE; | |
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
[/Users/sam]$ dig @8.8.8.8 lon.samsharpe.net | |
; <<>> DiG 9.8.3-P1 <<>> @8.8.8.8 lon.samsharpe.net | |
; (1 server found) | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 33571 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0 | |
;; QUESTION SECTION: |
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
context "running launch commands" do | |
before(:all) do | |
@test_data = define_test_data | |
@config_yaml = ErbHelper.convert_erb_template_to_yaml(@test_data, File.join(File.dirname(__FILE__), 'data/happy_path.yaml.erb')) | |
@api_interface = Vcloud::Core::ApiInterface.new | |
end | |
context "which exit with success" do | |
Vcloud::Launcher::Launch.new(@config_yaml, { "continue-on-error" => false, "post-launch-cmd" => 'data/true_cmd'}).run | |
@vapp_query_result = @api_interface.get_vapp_by_name_and_vdc_name(@test_data[:vapp_name], @test_data[:vdc_name]) |
NewerOlder