This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_zeroed(device_name, buffer_size = 2048): | |
zero = "\x00" | |
with open(device_name, "rb") as file: | |
buffer = file.read(buffer_size) | |
while buffer != "": | |
if not all(c == zero for c in buffer): | |
return False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"PHP IN CONTRAST TO PERL" | |
This document is http://tnx.nl/php.txt - If you replicate it, please do link. | |
Trust HTTP headers for last-modified info. | |
Arguments and return values are extremely inconsistent | |
------------------------------------------------------ | |
To show this problem, here's a nice table of the functions that match a user | |
defined thing: (with something inconsistent like this, it's amazing to find |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
booger:tmp evan$ cat scope.pl | |
#!/usr/bin/perl | |
use strict; | |
if (1) { | |
my $scoped = 42; | |
} | |
print $scoped; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[31m*ESC[1;31m*ESC[0m] A start job is running for /etc/rc....patibility (1min 26s / no limit)^MESC[K[ ESC[31m*ESC[1;31m*ESC[0mESC[31m*ESC[0m] A start job is running for /etc/rc....patibility (1min | |
27s / no limit)^MESC[K[ ESC[31m*ESC[1;31m*ESC[0mESC[31m* ESC[0m] A start job is running for /etc/rc....patibility (1min 27s / no limit)^MESC[K[ ESC[31m*ESC[1;31m*ESC[0mESC[31m* ESC[0m] A start job | |
is running for /etc/rc....patibility (1min 28s / no limit)^MESC[K[ESC[31m*ESC[1;31m*ESC[0mESC[31m* ESC[0m] A start job is running for /etc/rc....patibility (1min 28s / no limit)^MESC[K[ESC[1;31m* | |
ESC[0mESC[31m* ESC[0m] A start job is running for /etc/rc....patibility (1min 29s / no limit)^MESC[K[ESC[0mESC[31m* ESC[0m] A start job is running for /etc/rc....patibility (1min 29s / no limi | |
t)^MESC[K[ESC[1;31m*ESC[0mESC[31m* ESC[0m] A start job is running for /etc/rc....patibility (1min 30s / no limit)^MESC[K[ESC[31m*ESC[1;31m*ESC[0mESC[31m* ESC[0m] A start job is running for /etc/ | |
rc....patibility (1min 30s / |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
booger:~ evan$ cat example.yaml | |
foo: bar | |
baz: | |
- one | |
- two | |
- 3 | |
booger:~ evan$ cat example.yaml | ruby -ryaml -rjson -e'puts YAML.load(STDIN.read).to_json' | |
{"foo":"bar","baz":["one","two",3]} | |
booger:~ evan$ cat example.yaml | ruby -ryaml -rjson -e'puts YAML.load(STDIN.read).to_json'| ruby -ryaml -rjson -e'puts YAML.load(STDIN.read).to_json' | |
{"foo":"bar","baz":["one","two",3]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for i in a b c d e f g h i j k l m | |
do | |
echo "checking $i" | |
dig NS @$i.gtld-servers.net. $1 |grep $i|grep NS | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -00 | |
puts DATA.readlines.sample | |
__END__ | |
;,_ , | |
_uP~"b d"u, | |
dP' "b ,d" "o | |
d" , `b d"' "b | |
l] [ " `l, d" lb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# terminal 1 | |
eam@sprat:~$ ruby -e'puts $$; loop {}' | |
24358 | |
# terminal 2 | |
eam@sprat:~$ gdb -p 24358 | |
gdb> p rb_eval_string("puts 'hello world'") | |
$1 = 0x8 | |
# terminal 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef int Person; | |
struct { | |
void (*bite)(int*); | |
} *this; | |
int main(){return 0;}; | |
void makeZombie(Person* you) { | |
this->bite(you); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
char buf[4096]; | |
int main() { | |
int fd; | |
fd = open("/dev/null", O_WRONLY); | |
for (int i = 0; i < (1 << 25); i++) { |