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: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: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; \
#!/bin/sh
x=1
while [ $x -lt 255 ];
do
ping 10.0.0.$x 1
x=`expr $x + 1`
done
@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