Skip to content

Instantly share code, notes, and snippets.

View KristianLyng's full-sized avatar

Kristian Lyngstøl KristianLyng

  • Amedia
  • Oslo
View GitHub Profile
main(x,y){
if((y=getchar())!=10) {
main(0);
putchar(y);
}
x?puts(""):0;
}
main(){
char w[99],r[99],b[999],*c=b,i=0,x;
gets(w);
gets(r);
gets(c);
while(*c){
i=w[i]?i:!printf(r);
if(*c!=w[i]){
while(i)
putchar(*(w+x+--i));
main(){
int s[9];
gets(s)?main(),puts(s):0;
}
/*
* This code executes on most/many new 64-bit x86 GNU/Linux platforms.
* Needs minor alterations for other platforms. Likely to explode.
*
* Usage: gcc sort2.c; ./a.out; (enter some lines and end with EOF/^d)
*
* Relevant functions:
* void qsort(void *base, size_t nmemb, size_t size,
* int(*compar)(const void *, const void *));
* Sorts ``base'' which is ``nmemb'' elements of size ``size'', using
kristian@sunrider:~/.../Code/perfect$ ./main
Found perfect number: 6 - 0x6
01100000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Time used: 0seconds
Trying: i: 6 inc: 2 myinc: 0
Found perfect number: 6 - 0x6
01100000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Time used: 0seconds
Trying: i: 28 inc: 3 myinc: 1
Found perfect number: 28 - 0x1C
Assert error in do_curses(), varnishstat_curses.c line 218:
Condition((mvprintw(line, 0, "%12ju %12.2f %12.2f %s\n", ju, (ju - (intmax_t)pt->ref)/lt, ju / up, pt->name)) != ERR) not true.
Aborted
root@tristran:~# varnishlog
varnishlog: vsl.c:265: VSL_OpenLog: Assertion `sha != ((void *)0)' failed.
Aborted
root@tristran:~# varnishtop
varnishtop: vsl.c:265: VSL_OpenLog: Assertion `sha != ((void *)0)' failed.
Aborted
root@8d8:~# { for a in `seq 1 10000`; do /usr/bin/time -f %E bash -c echo hei > /dev/null ; done } 2>&1 | sort | uniq -c
9926 0:00.01
32 0:00.02
16 0:00.03
12 0:00.04
7 0:00.05
1 0:00.06
1 0:00.07
3 0:00.08
2 0:00.09
kristian@delfin:~$ { for a in `seq 1 10000`; do /usr/bin/time -f %E bash -c echo hei > /dev/null ; done } 2>&1 | sort | uniq -c
9736 0:00.03
147 0:00.04
1 0:00.05
1 0:00.06
105 0:00.09
10 0:00.10
kristian@delfin:~$ grep -i model /proc/cpuinfo
model : 3
model name : Pentium II (Klamath)
Jun 11 08:49:16 vcache03 varnishd[6602]: Child (9569) Panic message: Missing errorhandling code in parse_esi_tag(), cache_esi.c line 634: Condition(q < ew->tag.e) not true.thread = (cache-worker) ident = Linux,2.6.24-22-generic,x86_64,-smalloc,-hcritbit,epoll Backtrace: 0x4231a7: /usr/sbin/varnishd [0x4231a7] 0x418905: /usr/sbin/varnishd [0x418905] 0x41943d: /usr/sbin/varnishd(ESI_Parse+0x65d) [0x41943d] 0x413ca9: /usr/sbin/varnishd [0x413ca9] 0x414e1b: /usr/sbin/varnishd(CNT_Session+0x39b) [0x414e1b] 0x4255f8: /usr/sbin/varnishd [0x4255f8] 0x4248fe: /usr/sbin/varnishd [0x4248fe] 0x7fddd70d63f7: /lib/libpthread.so.0 [0x7fddd70d63f7] 0x7fddd69abb3d: /lib/libc.so.6(clone+0x6d) [0x7fddd69abb3d] sp = 0x7fdc92d2e008 { fd = 420, id = 420, xid = 2128872735, client = x.x.x.x:4474, step = STP_FETCH, handling = pass, err_code = 200, err_reason = (null), restarts = 0, esis = 0 ws = 0x7fdc92d2e078 { id = "sess", {s,f,r,e} = {0x7fdc92d2ec90,+3194,(nil),+131071}, }, http[re
$ traceroute 195.88.54.16
traceroute to 195.88.54.16 (195.88.54.16), 30 hops max, 60 byte packets
1 stardust.varnish-software.com (87.238.43.225) 0.140 ms 0.108 ms 0.097 ms
2 vlan309.cr0.v1.no.linpro.net (87.238.33.145) 0.890 ms 0.882 ms 0.973 ms
3 87.238.32.69 (87.238.32.69) 0.706 ms 0.818 ms 0.808 ms
4 vlan62.sw0.hmg9.no.linpro.net (87.238.32.19) 0.917 ms 0.907 ms 0.973 ms
5 www.vg.no (195.88.54.16) 0.588 ms 0.590 ms 0.567 ms