Skip to content

Instantly share code, notes, and snippets.

Chris Fordham flaccid

Block or report user

Report or block flaccid

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:692ba7c71996f7dd7cce82a8a7ab30ab
drive md5sum -depth 10000 | sort -k 1 > /tmp/filelist.txt
awk 'BEGIN { FS=" " } { c[$1]++; l[$1,c[$1]]=$0 } END { for (i in c) { if (c[i] > 1) for (j = 1; j <= c[i]; j++) print l[i,j] } }' /tmp/filelist.txt > /tmp/dupes.txt
cat /tmp/dupes.txt
echo "number of duplicates: $(wc -l /tmp/dupes.txt)"
View gist:b181c9de762dc4e0c554a7c179125eb5
define get_subnet_locations() return $subnet_locations do
@subnets = rs_cm.subnets.get()
$list = []
foreach @subnet in @subnets do
$subnet = to_object(@subnet)
$subnet_name = $subnet['details'][0]['name']
$subnet_href = select($subnet['details'][0]['links'], {'rel':'self'})[0]['href']
$subnet_network_href = select($subnet['details'][0]['links'], {'rel':'network'})[0]['href']
@flaccid
flaccid / gist:0b4702f5bfcaaeebc56cc7e070016a5e
Created Jun 10, 2016
push to aur failed, file was removed
View gist:0b4702f5bfcaaeebc56cc7e070016a5e
[flaccid@lister docker-git]$ git push
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 1.09 KiB | 0 bytes/s, done.
Total 6 (delta 4), reused 0 (delta 0)
remote: error: The following error occurred when parsing commit
remote: error: 2c72926277da7c00dee9d42d471c185e13e6f2be:
remote: error: missing source file: docker.service
remote: error: hook declined to update refs/heads/master
View gist:8c17df55b5477610ebe25d273d651c90
var rsApiClient = function (){
var self = this;
self.login = function (host, refreshToken){
var fetch = require('node-fetch');
var FormData = require('form-data');
var form = new FormData();
form.append('refresh_token', refreshToken);
form.append('grant_type', 'refresh_token');
@flaccid
flaccid / gist:d8faf594b7b494df047d
Created Mar 5, 2016
python metaprogramming heh
View gist:d8faf594b7b494df047d
>>> dev.bLength
18
>>> foo = 'bLength'
>>> getattr(dev, foo)()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'int' object is not callable
@flaccid
flaccid / gist:00c4bbb9787fba7ec311
Created Jan 26, 2016
rancher agent failing docker stats for host, containers
View gist:00c4bbb9787fba7ec311
INFO: Starting agent for 0A90EA3346CA1D7B2B53
INFO: Access Key: 0A90EA3346CA1D7B2B53
INFO: Config URL: http://lister:8080/v1
INFO: Storage URL: http://lister:8080/v1
INFO: API URL: http://lister:8080/v1
INFO: IP: 192.168.0.9
INFO: Port:
INFO: Required Image: rancher/agent:v0.8.2
INFO: Current Image: rancher/agent:v0.8.2
INFO: Using image rancher/agent:v0.8.2
@flaccid
flaccid / gist:ad677eb9744cec22fb36
Created Jan 20, 2016
vol issue with placement
View gist:ad677eb9744cec22fb36
my-service:
environment:
TZ: Australia/Melbourne
labels:
io.rancher.scheduler.global: 'true'
io.rancher.container.pull_image: always
io.rancher.container.start_once: 'true'
io.rancher.service.hash: 91bdc4dfc7e67786522a3e7aefb2af0f502e14c4
io.rancher.container.network: 'true'
io.rancher.scheduler.affinity:host_label_ne: log_host=true
@flaccid
flaccid / gist:8e0cbb236e6da84b1bc2
Created Jan 20, 2016
Failing to find placement with named volume
View gist:8e0cbb236e6da84b1bc2
771-41fd-98c6-358b2b8608ad][77c4003c-a0af-4469-8093-b273a6297034] Checking candidate:
2016-01-20 22:19:08,474 INFO [6c670148-d3ae-413d-aef1-dd3a74e7f7f4:301757] [instance:32614] [instance.start->(InstanceStart)->instance.allocate->(InstanceAllocate)] [] [ecutorService-2] [i.c.p.a.service.AbstractAllocator ] [33d8fa53-c771-41fd-98c6-358b2b8608ad][77c4003c-a0af-4469-8093-b273a6297034] host [23]
2016-01-20 22:19:08,474 INFO [6c670148-d3ae-413d-aef1-dd3a74e7f7f4:301757] [instance:32614] [instance.start->(InstanceStart)->instance.allocate->(InstanceAllocate)] [] [ecutorService-2] [i.c.p.a.service.AbstractAllocator ] [33d8fa53-c771-41fd-98c6-358b2b8608ad][77c4003c-a0af-4469-8093-b273a6297034] volume [18]
2016-01-20 22:19:08,474 INFO [6c670148-d3ae-413d-aef1-dd3a74e7f7f4:301757] [instance:32614] [instance.start->(InstanceStart)->instance.allocate->(InstanceAllocate)] [] [ecutorService-2] [i.c.p.a.service.AbstractAllocator ] [33d8fa53-c771-41fd-98c6-358b2b8608ad][77c4003c-a0af-4469-8093-b273a6297034]
View keybase.md

Keybase proof

I hereby claim:

  • I am flaccid on github.
  • I am flaccid (https://keybase.io/flaccid) on keybase.
  • I have a public key whose fingerprint is 3DE9 15B2 35BC 4597 ADEF B5C0 CCED 4C56 FF5D CDB6

To claim this, I am signing this object:

@flaccid
flaccid / gist:97473d0d85e2d6f4e292
Created Jul 23, 2015
Quick example of blue/green app ugprade on Rancher
View gist:97473d0d85e2d6f4e292
$ export RANCHER_HOST=foo.bar.suf
$ export RANCHER_PORT=8080
$ export RANCHER_PROJECT_ID=1a8
$ export RANCHER_STACK_NAME=killerapp
$ ./cattle-deploy.py
output:
snapshot epoch is1437634695
created temp file /var/folders/sx/ht6gznq979v5r725sqt7_p617p38sz/T/tmpprzZsd
You can’t perform that action at this time.