Skip to content

Instantly share code, notes, and snippets.

View farhaven's full-sized avatar
🦄
I'm a unicorn.

Gregor Best farhaven

🦄
I'm a unicorn.
View GitHub Profile
! turn the scroll wheel upside-down
pointer = 1 2 3 5 4
! make CapsLock work as modbutton3
keycode 66 = Hyper_L
clear lock
clear mod3
clear mod4
@farhaven
farhaven / gist:3794438
Created September 27, 2012 14:51
lshw output of the hackpad
hackpad
description: Notebook
product: 2958 (Lenovo)
vendor: LENOVO
version: Lenovo G550
serial: 2292224906060
width: 32 bits
capabilities: smbios-2.5 dmi-2.5 smp-1.4 smp
configuration: boot=oem-specific chassis=notebook cpus=2 family=Lenovo sku=Lenovo uuid=9826D3A5-0DFC-11DF-80EA-705AB658A873
*-core
@farhaven
farhaven / -proc-cpuinfo
Created September 27, 2012 14:50
/proc/cpuinfo of the hackpad
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Pentium(R) Dual-Core CPU T4400 @ 2.20GHz
stepping : 10
microcode : 0xa07
cpu MHz : 1200.000
cache size : 1024 KB
physical id : 0
#!/usr/local/bin/python3.2
import encodings
import os
import re
import subprocess
import syslog
import sys
import time
! make CapsLock work as modbutton3
keycode 66 = Hyper_L
clear lock
clear mod3
clear mod4
add mod3 = Hyper_L
add mod4 = Super_L Super_R
tunnels="{ tun0 }"
local ="{ 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 131.234.0.0/16 }" # local networks, last one is UPB
vpn ="{ 131.234.134.198 }" # vpn endpoint
dns ="{ 131.234.137.23 8.8.4.4 }"
login ="{ 131.234.5.5 172.24.6.65 }" # webauth login
set skip on lo
# block traffic except to/from the VPN endpoint and tunnelled/local traffic
block all
#!/bin/sh
exec 2>&1
env > /tmp/up-${script_type}.env
if [ "${script_context}" != "init" ]; then
exit
fi
case "${script_type}" in
remote openvpn.uni-paderborn.de
client
dev tun0
comp-lzo
verb 3
# proto tcp
# port 443
diff --git a/src/db.cpp b/src/db.cpp
index e494d28..8347208 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -88,7 +88,7 @@ bool CDBEnv::Open(boost::filesystem::path pathEnv_)
dbenv.set_errfile(fopen(pathErrorFile.string().c_str(), "a")); /// debug
dbenv.set_flags(DB_AUTO_COMMIT, 1);
dbenv.set_flags(DB_TXN_WRITE_NOSYNC, 1);
- dbenv.log_set_config(DB_LOG_AUTO_REMOVE, 1);
+ // dbenv.log_set_config(DB_LOG_AUTO_REMOVE, 1);
-module(p23).
-export([solution/0, solution/1]).
-define(LIMIT, 28123).
divisors(N) ->
Limit = round(math:sqrt(N)),
if
Limit < 2 -> [];
true ->
L1 = [ X || X <- lists:seq(2, Limit), N rem X =:= 0 ],