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
# -*- 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]) |
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
git diff | |
[gds/boxes:packer●]$ /opt/boxen/homebrew/bin/packer build -only=precise64_vmware_fusion templates.json | |
precise64_vmware_fusion output will be in this color. | |
==> precise64_vmware_fusion: Downloading or copying ISO | |
precise64_vmware_fusion: Downloading or copying: http://releases.ubuntu.com/12.04/ubuntu-12.04.5-server-amd64.iso | |
==> precise64_vmware_fusion: Creating virtual machine disk | |
==> precise64_vmware_fusion: Building and writing VMX file | |
==> precise64_vmware_fusion: Starting HTTP server on port 8546 | |
==> precise64_vmware_fusion: Starting virtual machine... |
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
$ /opt/boxen/homebrew/bin/packer build -only=precise64_vmware_fusion templates.json | |
precise64_vmware_fusion output will be in this color. | |
==> precise64_vmware_fusion: Downloading or copying ISO | |
precise64_vmware_fusion: Downloading or copying: http://releases.ubuntu.com/12.04/ubuntu-12.04.5-server-amd64.iso | |
precise64_vmware_fusion: Download progress: 4% | |
precise64_vmware_fusion: Download progress: 9% | |
precise64_vmware_fusion: Download progress: 14% | |
precise64_vmware_fusion: Download progress: 19% | |
precise64_vmware_fusion: Download progress: 24% |
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
350,507d349 | |
< window.templates["search/_results_block"]=new Hogan.Template(function(e | |
< t | |
< n){var r=this;return r.b(n=n||"") | |
< r.s(r.f("filter_fields" | |
< e | |
< t | |
< 1) | |
< e | |
< t |
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
/opt/rubies/1.9.3-p545/bin/ruby -S rspec ./spec/puppet-syntax/hiera_spec.rb ./spec/puppet-syntax/manifests_spec.rb ./spec/puppet-syntax/tasks/puppet-syntax_spec.rb ./spec/puppet-syntax/templates_spec.rb ./spec/puppet-syntax_spec.rb | |
PuppetSyntax::Hiera | |
should expect an array of files | |
should return nothing from valid YAML | |
should return an error from invalid YAML | |
PuppetSyntax::Manifests | |
should expect an array of files | |
should return nothing from a valid file |
NewerOlder