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
| #!/bin/bash | |
| mkdir -p ubuntu/{dists,pool} | |
| meh=$( | |
| rsync -iaO --exclude ubuntu --exclude pool --exclude dists rsync://archive.ubuntu.com/ubuntu/. ubuntu/ | |
| for a in dists/{lucid,precise}{,-{backports,security,updates}}; do | |
| rsync -iaO --exclude 'installer-*' rsync://archive.ubuntu.com/ubuntu/$a/. ubuntu/$a/ | |
| done |
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
| function d { | |
| did=$(docker run -d precise runsvdir /etc/service) | |
| ip=$(docker inspect $did | grep IpAddress | cut -d'"' -f4) | |
| nc -z $ip 22 && ssh -oStrictHostKeyChecking=no root@$ip | |
| docker kill $did | |
| } | |
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
| cat ec2din.txt | \ | |
| perl -pe ' \ | |
| s{us-east-\S+}{us-east-xx}g; | |
| s{i-[0-9a-f]{8}}{i-xxxxxxxx}g; | |
| s{vol-[0-9a-f]{8}}{vol-xxxxxxxx}g; | |
| s{\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d.\d\d\dZ}{dddd-dd-ddTdd:dd:dd.dddZ}g; | |
| s{(arn:aws:cloudformation):\S+}{$1:xxxxxx}g; | |
| s{/dev/sd\S+}{/dev/sdxxx}g;; | |
| s{(\w)-[0-9a-f]{8}(,?)}{$1-xxxxxxxx$2}g; | |
| s{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-fx]{12}_\S+}{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx_xxxx}g; |
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
| "Ec2Instance" : { | |
| "Type" : "AWS::EC2::Instance", | |
| "Properties" : { | |
| "KeyName" : { "Ref" : "KeyName" }, | |
| "SecurityGroups" : [ { "Ref" : "InstanceSecurityGroup" } ], | |
| "ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]}, | |
| "UserData" : { "Fn::Base64" : { "Fn::Join" : ["",[ | |
| "#!/bin/bash -ex","\n", | |
| "yum -y install gcc-c++ make","\n", | |
| "yum -y install mysql-devel sqlite-devel","\n", |
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
| Bringing machine 'default' up with 'docker' provider... | |
| [default] Launching an instance with the following settings... | |
| [default] -- Image: 9014505bebb4 | |
| [default] Waiting for instance to become "ready"... | |
| [default] Waiting for SSH to become available... | |
| [default] Machine is booted and ready for use! | |
| env BOX=precise-base vagrant ssh -- -A | |
| Welcome to Ubuntu 12.04.3 LTS (GNU/Linux 3.8.0-30-generic x86_64) | |
| * Documentation: https://help.ubuntu.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
| > ssh bastion | |
| root@8cb2ee8bb517:/# ps axuf | |
| USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND | |
| root 1 0.3 0.0 18156 2072 ? S 23:03 0:00 bash | |
| root 10 0.0 0.0 15280 1056 ? R+ 23:03 0:00 ps axuf | |
| root@8cb2ee8bb517:/# exit | |
| > ssh bastion | |
| root@adf50ae964a3:/# ps axuf | |
| USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND |
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
| > ssh bastion | |
| root@8cb2ee8bb517:/# ps axuf | |
| USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND | |
| root 1 0.3 0.0 18156 2072 ? S 23:03 0:00 bash | |
| root 10 0.0 0.0 15280 1056 ? R+ 23:03 0:00 ps axuf | |
| root@8cb2ee8bb517:/# exit | |
| > ssh bastion | |
| root@adf50ae964a3:/# ps axuf | |
| USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND |
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
| curl http://curl.haxx.se/ca/cacert.pem | while read -r a; do | |
| [[ "$a" = "-----BEGIN CERTIFICATE-----" ]] && { echo "$a" > cert; continue; } | |
| [[ "$a" = "-----END CERTIFICATE-----" ]] && { echo "$a" >> cert; mv cert $(openssl x509 -hash -noout -in cert).0; } | |
| [[ -f cert ]] && echo "$a" >> cert | |
| done |
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 bash | |
| #/ NAME | |
| #/ gpkg -- manages gist packages | |
| #/ | |
| #/ SYNOPSIS | |
| #/ gpkg install [gist_id | archive] | |
| #/ gpkg update [gist_id | archive] | |
| #/ gpkg package [gist_id] | |
| #/ gpkg exec [name] |
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
| have_func: checking for rb_str_set_len() in ruby.h... -------------------- no | |
| "gcc -o conftest -I../../.ext/include/x86_64-linux -I../.././include -I../.././ext/openssl -I/opt/br/br-admin/pkg/include/db4 -I/usr/include -I/opt/br/br-admin/pkg/include -I/opt/br/br-admin/pkg/include/db4 -I/usr/include -I/opt/br/br-admin/pkg/include -O2 -Wno-error -pthread -I/opt/br/br-admin/pkg/include/db4 -I/usr/include -I/opt/br/br-admin/pkg/include -fPIC conftest.c -L. -L../.. -L. -L/opt/br/br-admin/pkg/lib -Wl,-R/opt/br/br-admin/pkg/lib -pthread -rdynamic -Wl,-export-dynamic -L/usr/lib64 -lssl -lcrypto -Wl,-R -Wl,/opt/br/br-admin/pkg/lib -L/opt/br/br-admin/pkg/lib -lruby193-static -lssl -lcrypto -lpthread -lrt -ldl -lcrypt -lm -lpthread -lrt -lc" | |
| ../../libruby193-static.a(string.o): In function `rb_str_crypt': | |
| string.c:(.text+0xa510): undefined reference to `crypt' | |
| collect2: ld returned 1 exit status | |
| checked program was: | |
| /* begin */ | |
| 1: #include "ruby.h" | |
| 2: |