Skip to content

Instantly share code, notes, and snippets.

View KristianLyng's full-sized avatar

Kristian Lyngstøl KristianLyng

  • Amedia
  • Oslo
View GitHub Profile
$ cat foo.c
#include <stdio.h>
int main() {
double a=2.6,b=2.6;
printf("a: %d b: %d a+b: %d\n",(int)a,(int)b,(int)(a+b));
return 0;
}
$ gcc foo.c
$ ./a.out
a: 2 b: 2 a+b: 5
#!/bin/bash
rfile=$(mktemp)
{
rot13 <<__EOF__
#vapyhqr <fgqvb.u>
#vapyhqr <fgqyvo.u>
#vapyhqr <pglcr.u>
vag
znva (ibvq) {
kristian@freud:~/Documents/Web$ code/script/ip6dns.sh
----------------
; Reverse record for 2a02:c0:1013:1:f2de:f1ff:fe2a:87d3->freud
3.d.7.8.a.2.e.f.f.f.1.f.e.d.2.f.1.0.0.0.3.1.0.1.0.c.0.0.2.0.a.2. IN PTR freud.kly.no
; Forward record for freud->2a02:c0:1013:1:f2de:f1ff:fe2a:87d3
freud IN AAAA 2a02:c0:1013:1:f2de:f1ff:fe2a:87d3
; CHEF updated: <%= node[:bind][:timestamp_human] %>
$TTL 14400
@ IN SOA jupiter.bakabo.net. kristian.bakabo.net. (
<%= node[:bind][:timestamp] %> ; Serial
14400 ; Refresh
86400 ; Retry
2419200 ; Expire
3600 ) ; Negative Cache TTL
;
; CHEF updated: <%= node[:bind][:timestamp_human] %>
$TTL 1800
@ IN SOA jupiter.bakabo.net. kristian.bakabo.net. (
<%= node[:bind][:timestamp] %> ; Serial
86400 ; Refresh
86400 ; Retry
2419200 ; Expire
120 ) ; Negative Cache TTL
;
@ IN NS jupiter.bakabo.net.
root@luke:~/tmpfs# cat foo.sh
rfile=$(mktemp)
size=$1
gcc -x c -O3 -o $rfile - <<__EOF__
#include <stdlib.h>
int main(void) {
int i;
long int a;
root@luke:~/tmpfs# rm tmp
root@luke:~/tmpfs# time ../a.out > tmp; ls -sl tmp
real 0m0.089s
user 0m0.068s
sys 0m0.020s
39148 -rw-r--r-- 1 root root 40000000 Nov 3 09:59 tmp
root@luke:~/tmpfs# cat ../foo.c
#include <stdlib.h>
root@luke:~# cat foo.c
#include <stdlib.h>
int main(void) {
int i;
long int a;
char *b;
char buff[100010];
int buflen=0;
srandom(time(NULL));
<leftyfb> KristianL: got a friend of yours over in #linuxhelp that we can't understand :)
[...]
-!- KristianL [[email protected]] has joined #linuxhelp
<KristianL> leftyfb: hmm?
<leftyfb> KristianL: silentw1z
<leftyfBX> 07:57PM <silentw1z> når jeg kjører apt-get install vncserver så får jeg opp " Klarte ikke å finne pakken vncserver"
<leftyfBX> 07:57PM <silentw1z> må vel ha en bedre source.list
<KristianL> ok, this is how you do it:
<KristianL> silentw1z: speak english.
kristian@luke:~$ strings /dev/urandom | egrep -vi '[^a-z]' | tr A-Z a-z | head -n 400
tindzc
dcau
banx
lcqn
onmwj
nqfx
ulttaf
ffgr
letu