Skip to content

Instantly share code, notes, and snippets.

View jlk's full-sized avatar
🏠
Working from home

John Kinsella jlk

🏠
Working from home
View GitHub Profile
@jlk
jlk / gist:3ce25f05edff4feb350b
Created May 1, 2015 16:00
goddamn ubuntu...
# dpkg --list|grep apache
rc apache2 2.2.14-5ubuntu8.15 amd64 Apache HTTP Server metapackage
# apt-get remove apache*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'apache2' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
# apt-get purge apache*
Reading package lists... Done
#!/bin/sh
x=1
while [ $x -lt 255 ];
do
ping 10.0.0.$x 1
x=`expr $x + 1`
done
@jlk
jlk / gist:533bc83691887f298a5c
Created January 27, 2016 20:52
variable expansion
glibc has the following line:
#define SYS_ify(syscall_name) __NR_##syscall_name
So I'm trying to do a similar expansion with "name" below:
# undef PSEUDO
# define PSEUDO(name, syscall_name, args) \
.data; \
##name_jtarget_name: .string "test"; \
.text; \
@jlk
jlk / gist:dbedd2086deaf1ed7f46
Created February 29, 2016 00:44
docker external links
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4eea64fee19e mariadb:10.1.11 "/docker-entrypoint.s" 27 minutes ago Up 10 minutes 3306/tcp db1_db_1
-----
$ cat docker-compose.yml
version: '2'
services:
web:
@jlk
jlk / gist:3ca9206a6391f9abf895631d252c6c09
Created April 14, 2016 16:54
Rancher logs, processes stuck "scheduling"
2016-04-14 14:21:09,623 ERROR [:] [] [] [] [ServiceReplay-9] [i.c.p.e.e.i.ProcessEventListenerImpl] Unknown exception running process [instance.start:16354] on [245] java.lang.IllegalStateException: Attempt to cancel when process is still transitioning
at io.cattle.platform.engine.process.impl.DefaultProcessInstanceImpl.runDelegateLoop(DefaultProcessInstanceImpl.java:191) ~[cattle-framework-engine-0.5.0-SNAPSHOT.jar:na]
at io.cattle.platform.engine.process.impl.DefaultProcessInstanceImpl.executeWithProcessInstanceLock(DefaultProcessInstanceImpl.java:158) ~[cattle-framework-engine-0.5.0-SNAPSHOT.jar:na]
at io.cattle.platform.engine.process.impl.DefaultProcessInstanceImpl$1.doWithLock(DefaultProcessInstanceImpl.java:108) ~[cattle-framework-engine-0.5.0-SNAPSHOT.jar:na]
at io.cattle.platform.engine.process.impl.DefaultProcessInstanceImpl$1.doWithLock(DefaultProcessInstanceImpl.java:105) ~[cattle-framework-engine-0.5.0-SNAPSHOT.jar:na]
at io.cattle.platform.lock.impl.Abstra
@jlk
jlk / gist:b65863ea3aabf5bb1c1084422ba76214
Created April 17, 2016 20:53
ansible - inventory variables in vars
- hosts: tag_Name_swarm_node
user: ubuntu
become: yes
vars:
- swarm_manager_ip: "{{ tag_Name_swarm_node[0] }}"
roles:
- swarm_node
# flockerctl --control-service=swarm-master list
DATASET SIZE METADATA STATUS SERVER
ea8748d1-26e9-4569-b1dd-d31e018b162c 75.00G name=oranges deleting <missing>
@jlk
jlk / blah.
Created August 23, 2016 17:55
$ unzip ../procps-3.3.9-r3.apk
Archive: ../procps-3.3.9-r3.apk
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of ../procps-3.3.9-r3.apk or
../procps-3.3.9-r3.apk.zip, and cannot find ../procps-3.3.9-r3.apk.ZIP, period.
@jlk
jlk / gist:f54a0f67ed842161a28c166c42713911
Created August 24, 2016 16:20
seccomp in docker-compose
version: '2'
services:
db:
container_name: mariadb
image: mariadb:5.5
ports:
- 3306
cap_add:
- SYS_PTRACE
security_opt:
# Traefik started with
# docker service create --constraint=node.role==manager --publish 80:80 --publish 443:443 --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock --network traefik-internal traefik --docker --docker.swarmmode --docker.domain=traefik --docker.watch --web
# running this with docker stack deploy --compose-file docker-compose-swarm.yml grafana
version: '3'
services:
grafana:
image: grafana/grafana:4.1.2
ports:
- "8085:3000"