Skip to content

Instantly share code, notes, and snippets.

View theonewolf's full-sized avatar

Wolfgang Richter theonewolf

View GitHub Profile
#kept in .config/fish/functions/scratch.fish
function scratch
set scratch_file (mktemp)
vim $scratch_file
cat $scratch_file
set -e scratch_file
end
@theonewolf
theonewolf / iwlwifi.log
Created May 7, 2013 04:18
iwlwifi issues on Dell Vostro 1520
[10900.313719] iwlwifi 0000:0e:00.0: Microcode SW error detected. Restarting 0x2000000.
[10900.313733] iwlwifi 0000:0e:00.0: Loaded firmware version: 8.83.5.1 build 33692
[10900.313845] iwlwifi 0000:0e:00.0: Start IWL Error Log Dump:
[10900.313851] iwlwifi 0000:0e:00.0: Status: 0x000412E4, count: 5
[10900.313858] iwlwifi 0000:0e:00.0: 0x00000005 | SYSASSERT
[10900.313866] iwlwifi 0000:0e:00.0: 0x000024EC | uPc
[10900.313871] iwlwifi 0000:0e:00.0: 0x000024C8 | branchlink1
[10900.313877] iwlwifi 0000:0e:00.0: 0x000024C8 | branchlink2
[10900.313883] iwlwifi 0000:0e:00.0: 0x00000916 | interruptlink1
[10900.313889] iwlwifi 0000:0e:00.0: 0x00000000 | interruptlink2
@theonewolf
theonewolf / switch.c
Last active December 16, 2015 19:38
switch brain teaser
#include <stdio.h>
#include <stdlib.h>
enum option
{
OPT_ONE = 0x01,
OPT_TWO = 0x02,
OPT_THREE = 0x03,
OPT_FOUR = 0x04,
OPT_MAGIC = 0x05
#!/usr/bin/env python
import requests
import time
for i in xrange(10000):
requests.get('http://localhost', headers={'User-Agent' : str(int(time.time()))}).status_code
@theonewolf
theonewolf / dmesg_bad
Last active December 14, 2015 02:49
gs9671 core1 not working
[ 0.000000] Linux version 3.2.0-38-generic (buildd@allspice) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #60-Ubuntu SMP Wed Feb 13 13:22:43 UTC 2013 (Ubuntu 3.2.0-38.60-generic 3.2.37)
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.2.0-38-generic root=UUID=cff5d62f-4ad6-4684-b013-7dc96c2059d2 ro quiet splash
...
[ 0.064877] CPU0: Intel(R) Core(TM)2 Duo CPU E8135 @ 2.66GHz stepping 0a
[ 0.068003] Performance Events: PEBS fmt0+, Core2 events, Intel PMU driver.
[ 0.068003] ... version: 2
[ 0.068003] ... bit width: 40
[ 0.068003] ... generic registers: 2
@theonewolf
theonewolf / looper.bat
Created February 19, 2013 21:48
append timestamps to a file windows command line
:loop
echo %TIME% >> desktop.ini
timeout 5
goto loop
@theonewolf
theonewolf / .gitignore
Last active December 10, 2015 21:38
Exploring Priority Inversion within ZeroMQ
pi
@theonewolf
theonewolf / packed_json_decoder.py
Created December 10, 2012 20:44
parse a collection of packed JSON documents
#!/usr/bin/env python
import json
data = open('database.json').read()
document = True
start = 0
end = None
while document:
@theonewolf
theonewolf / fizzbuzz.py
Created November 15, 2012 16:38
FizzBuzz Test
#!/usr/bin/env python
# solution to: http://www.globalnerdy.com/2012/11/15/fizzbuzz-still-works/
# first attempt, had typed into python interpreter within 1-2 minutes of reading problem description
for i in xrange(1,101,1):
if (i % 3 == 0 and i % 5 == 0):
print 'FizzBuzz'
elif (i % 3 == 0):
print 'Fizz'
@theonewolf
theonewolf / timing.log
Created October 25, 2012 06:52
tuttle detailed timing
./log_time_differ.py /logger/guest_command.stdout.sw_install.2012-10-24.*
0:00:06
2012-10-24 18:33:16 Unpacking erlang-src (from .../erlang-src_1%3a14.b.4-dfsg-1ubuntu1_all.deb) ...
2012-10-24 18:33:22 Selecting previously unselected package nginx-common.
0:00:11
2012-10-24 18:36:22 Unpacking xemacs21-basesupport (from .../xemacs21-basesupport_2009.02.17.dfsg.1-1_all.deb) ...
2012-10-24 18:36:33 Selecting previously unselected package xemacs21-nomule.
0:00:15