Skip to content

Instantly share code, notes, and snippets.

Tobias Kunze rixx

View GitHub Profile
@rixx
rixx / portalimport.py
Last active Aug 29, 2015
portalimport
View portalimport.py
#!/usr/bin/env python2
#-*- coding: utf8 -*-
import sqlite3
IMPORT = True
NEW_SCHEMA = "CREATE TABLE user(serial INTEGER PRIMARY KEY, name TEXT, surname TEXT, nickname TEXT, created timestamp DEFAULT CURRENT_TIMESTAMP, firstValid timestamp DEFAULT NULL, lastValid timestampt DEFAULT NULL, pubkey varchar(8192));"
NEW_DB = 'shackspacekey.sqlite'
OLD_SCHEMA = "CREATE TABLE user (Givenname varchar(64), Surname varchar(64),serialnumber varchar(64),Created timestamp DEFAULT CURRENT_TIMESTAMP,FirstValidDate timestamp,LastValidDate timestamp,PrivateKey varchar(3300),PublicKey varchar(730),Fingerprint varchar(64));"
OLD_DB = ''
@rixx
rixx / 01
Created Apr 23, 2015
weechat plugins
View 01
11:01:07 weechat │ * ia buffers.pl 5.0 (Sidebar with list of buffers)
11:01:07 weechat │ ia rslap.pl 1.3.1 (Slap Randomiser)
11:01:07 weechat │ ia autojoin.py 0.2.5 (Configure autojoin for all servers according to currently joined channels)
11:01:07 weechat │ ia N buffer_autoset.py 0.6 (Auto-set buffer properties when a buffer is opened)
11:01:07 weechat │ ? facebook_rename.py 1.1.2 (Renames Facebook usernames when using Bitlbee or Minbif)
11:01:07 weechat │ ia go.py 2.0 (Quick jump to buffers)
11:01:07 weechat │ ia screen_away.py 0.14 (Set away status on screen detach)
11:01:07 weechat │ ia whois_on_query.py 0.6 (Whois on query)
View pubkey
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDZgjtJWpk+a2nPWOPlD0ehmFcPwIJR8Kp0AuaUugO/uGtcJ0kh2n1qjEC5zsWRJ6qZLJYVJKywhV2xXGmJwxUmiBalHFcjNpC+EWtCgqpi3ePQLyPpkLmJ09yqhfJBfAqVyzZIq1bMwIx+sneopNX6TDTYvHdhjkcUZFTJDK6cgBeKnktyIp0oC+GLNFQpugtzx6JmJszdHiO7gZwUOiNcBGDGfqpzemFZkOywnpPTHiF0sca1BJDf0ynq0xlfNKrP03JlQCzytVpNmugP9oC5SUemnPJJ1OYyRwV0p+ZSDpdE19Snar4Rk2C52ASd7KteIxhGXay0Dvi0AadjzC6ieQZPCYd8hNofzwfSx1KIFkE91ImQAWx6kH1uk/KBG3XtrOZVF+S0NeS0V/G4cEwj2N84fqgB/xxy5LVF3m66QbRYBENd6FJb0/arqZYhRySl+8mKuVvWxzX4tzas/oe1KJ8wl7jH8jKNHi4ZhxQpSRXlH4HTfg4/tARXNs6fgKPgt9+iIPN0oPGPwYVzIRcnCfmWv7ej12rlJq152/b3Ev1Va5Hl3U2yeUB1ZhDAXQt7FcK7TDTsr15gi5CwHtvHJYZl8VSQoc9WER1UQKm4bOyTB2XqlrxyqkbhUpRarFSf4PiyW+/QTWeVITKqXfi1pMdMvkEXQw5nLkq9LzYxgw== rixx@serenity
View gist:75dbecd1465721551ee2
if not where:
select.where = joinList[tablename].right.__getattr__(column) == operand
else:
select.where &= joinList[tablename].right.__getattr__(column) == operand
where = True
-----
passender_variablenname = joinList[tablename].right.__getattr__(column) == operand
select.where = passender_variablenname if where is False else passender_variablenname & select.where
@rixx
rixx / Cocktail Sort
Created May 25, 2014
Cocktail Sort Sans Comments Avec Debug
View Cocktail Sort
def bubblesort(a):
trigger = True
for k in range(len(a)):
print("Durchlauf " + str(k+1) + " von " + str(len(a)))
sorted = True
if trigger == True:
trigger = False
for i in range (int(k/2), len(a) - 1 - int(k/2)):
print("Element " + str(i))
if a[i] > a[i+1]:
View vimrc
"""""""""""""""""""""""""""""""""""""""""""""
"" General Settings ""
"""""""""""""""""""""""""""""""""""""""""""""
" Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
"" set history size
set history=1000
View switch
#!/usr/bin/env python
import os
import subprocess
def switch():
if "nodeadkeys" in subprocess.check_output(["setxkbmap", "-query"]):
os.system("setxkbmap de neo -option")
else:
os.system("setxkbmap de nodeadkeys -option")
You can’t perform that action at this time.