Skip to content

Instantly share code, notes, and snippets.

// can we fit in the skill level?
if ((end - cursor + 1) - maplen >= sizeof "skillX " - sizeof "")
{
char *p = "skill0 ";
while(*p)
{
*cursor++ = *p++;
}
cursor[-2] += startskill;
}
@jmtd
jmtd / bollocks.sh
Created October 16, 2015 10:00
blah
echo parent pid is $BASHPID
bollocks() {
pidfile=$(mktemp -t bollocks.XXXXXX)
ls -ld "$pidfile"
(
echo $BASHPID | tee "$pidfile"
sleep 30
rm "$pidfile"
) &
pavonis$ cat test.sh
service="hi_there"
if [[ "$service" == *"_"* ]]; then
echo works 1
fi
if [ "$service" == *"_"* ]; then
echo works 2
fi
cevm$ docker exec -ti testcontainer ls -lZ /etc/resolv.conf
-rw-r--r--. root root system_u:object_r:svirt_sandbox_file_t:s0:c947,c1012 /etc/resolv.conf
cevm$ docker stop testcontainer
testcontainer
cevm$ docker start testcontainer
testcontainer
cevm$ docker top testcontainer
UID PID PPID C STIME TTY TIME CMD
root 8702 907 1 16:07 ? 00:00:00 bash -c while true; do sleep 300; echo; done
$ rip cd rip
Using configured read offset 102
Checking device /dev/sr0
CDDB disc id: 8d118c19
MusicBrainz disc id jf3pYmBGrs9ZCvrtnTNeNRgLElc-
MusicBrainz lookup URL http://mm.musicbrainz.org/bare/cdlookup.html?toc=1+25+337085+150+11437+22390+33164+44664+54643+66344+78609+89584+99789+109275+119516+132569+143938+155212+166693+176800+192408+207455+221875+248292+265299+283674+298109+313129&tracks=25&id=jf3pYmBGrs9ZCvrtnTNeNRgLElc-
Disc duration: 01:14:52.466, 25 audio tracks
Matching releases:
@jmtd
jmtd / gist:f2b0347c0a7cbfba77ac
Created February 18, 2015 16:35
PGP interestingness
def score(s):
i=1
p = s[0]
for c in s[1:]:
if int(c,base=16) == int(p,base=16)+1:
i += 1
p = c
return i
# or
@jmtd
jmtd / keybase.md
Created March 26, 2014 16:44
keybase.io proof for github.com/jmtd

Keybase proof

I hereby claim:

  • I am jmtd on github.
  • I am jmtd (https://keybase.io/jmtd) on keybase.
  • I have a public key whose fingerprint is E037 CB2A 1A00 61B9 4336 3C8B 0907 4096 06AA AAAA

To claim this, I am signing this object: