Skip to content

Instantly share code, notes, and snippets.

@worr
worr / fixed gcc command
Last active December 17, 2015 06:28
eventd gmake output
# Doesn't work
gcc -shared -fPIC -DPIC -o .libs/libeventc.so.0.0 -pthread -std=gnu99 -fvisibility=hidden -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -D G_LOG_DOMAIN="libeventc" -I/usr/local/include/gio-unix-2.0/ -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -g -O2 -Wl,--no-undefined -shared client/libeventc/src/.libs/libeventc_la-libeventc.o -Wl,-whole-archive /home/will/eventd/.libs/libeventd-evp.a -Wl,-no-whole-archive -L.libs -leventd-event -lgio-2.0 -lgmodule-2.0 -lz -lgthread-2.0 -lffi -lpcre -lgobject-2.0 -lglib-2.0 -lintl -liconv
# Does work
gcc -shared -fPIC -DPIC -o .libs/libeventc.so.0.0 -pthread -std=gnu99 -fvisibility=hidden -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -D G_LOG_DOMAIN="libeventc" -I/usr/local/include/gio-unix-2.0/ -I/usr/local
@worr
worr / autopoke.js
Last active December 16, 2015 18:29
(function() {
function pokeAll() {
var list = document.querySelectorAll("a[ajaxify*=pokeback]");
for (var i =0; i < list.length; i++) {
list[i].click();
}
}
setInterval( pokeAll, 100 );
})();
#!/usr/bin/env perl
use strict;
use warnings;
use v5.10;
use JSON::Any;
use LWP::UserAgent;
use constant GITHUB_URI => "https://api.github.com/meta";
Executing pretend actions: 14 of 73
systemd-200> /usr/libexec/paludis/utils/canonicalise: line 4: /usr/bin/readlink: No such file or directory
systemd-200> is not a directory
45 of 73, 1 failed
icedtea7-2.3.8> /usr/libexec/paludis/ebuild.bash: line 103: /usr/bin/dirname: Not a directory
icedtea7-2.3.8> /usr/libexec/paludis/utils/canonicalise: line 4: /usr/bin/readlink: No such file or directory
icedtea7-2.3.8> is not a directory
46 of 73, 2 failed
@worr
worr / bad.pl
Created February 26, 2013 01:41
This code is dangerous
#!/usr/bin/env perl
use strict;
use warnings;
use v5.10;
open(my $fh, $ARGV[0]) or die "$!";
foreach (<$fh>) {
@worr
worr / broke.c
Created February 20, 2013 01:18
static void check_if_need_to_close(struct cmd_data* cmd_data) {
if (cmd_data->cmd_exited && cmd_data->in_closed && cmd_data->out_closed && cmd_data->err_closed)
g_main_loop_quit(cmd_data->loop);
}
static void check_exit_status(GPid pid, gint status, gpointer user_data) {
wsh_cmd_res_t* res = ((struct cmd_data*)user_data)->res;
wsh_cmd_req_t* req = ((struct cmd_data*)user_data)->req;
res->exit_status = WEXITSTATUS(status);
@worr
worr / russian_roulette.pl
Created August 7, 2012 19:55
Russian Roulette
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
my $char = chr(int(rand(26) + 97));
open(my $fh, ">", "/proc/sysrq-trigger");
say $fh $char;
close($fh);
@worr
worr / 0.py
Created August 4, 2012 04:45
GAME
import random
import sys
import pygame
from pygame.locals import *
num = 0
def win():
pygame.display.set_mode((2048, 480))
@worr
worr / decrypt.c
Created July 2, 2012 02:19
Decrypts QQ packets (with libqq-pidgin)
#include <errno.h>
#include <glib.h>
#include <glib/gprintf.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "qq_crypt.h"
#define KEY_SIZE 1024
@worr
worr / find_password_hash.py
Created June 6, 2012 19:59 — forked from jsundram/find_password_hash.py
Check if your password is in the linkedin password dump.
"""
Check if your password is in the linkedin password dump.
You'll need to download the dump from here: http://bit.ly/KGTusG and unzip it to combo_not.txt
"""
import hashlib
import getpass
pw = getpass.getpass('Enter your LinkedIn password: ')
sha1 = hashlib.sha1(pw).hexdigest()