Skip to content

Instantly share code, notes, and snippets.

View gist:1b2fcfb729e3b276c27140e3eb4ea365
// 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;
}
View bollocks.sh
echo parent pid is $BASHPID
bollocks() {
pidfile=$(mktemp -t bollocks.XXXXXX)
ls -ld "$pidfile"
(
echo $BASHPID | tee "$pidfile"
sleep 30
rm "$pidfile"
) &
View gist:27395964be6985f03a2a
pavonis$ cat test.sh
service="hi_there"
if [[ "$service" == *"_"* ]]; then
echo works 1
fi
if [ "$service" == *"_"* ]; then
echo works 2
fi
View gist:823cf14b33479c58f32a
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
View morituri output
$ 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:
View gist:f2b0347c0a7cbfba77ac
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 Mar 26, 2014
keybase.io proof for github.com/jmtd
View keybase.md

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: