Skip to content

Instantly share code, notes, and snippets.

View hersche's full-sized avatar

Vinzenz Hersche hersche

View GitHub Profile
@hersche
hersche / tox2dns2tox.py
Last active August 29, 2015 13:58
convert toxkey to toxDns secured with pin and back.
import binascii
def generateKey(dns,pin):
pub = dns[11:75]
logger.info(pub)
check = dns[83:87]
logger.info(check)
nospam = binascii.a2b_base64(pin+"==")
nospam =str(binascii.hexlify(nospam))
nospam = nospam[2:-1]
nospam = nospam.upper()
@hersche
hersche / db_example.py
Last active August 29, 2015 13:58
python3 database-example (well commented in german)
# -*- coding: utf-8 -*-
import sqlite3, os.path, datetime, sys
#grundsätzlich wird angenommen, dass das db-file da ist..
fileExist = True
#...dann wird das überprüft..
if os.path.isfile('example.db') == False:
#..und ggf umgestellt..
fileExist = False
#..denn sqlite3.connect erstellt immer ein file!
db = sqlite3.connect('example.db')
@hersche
hersche / mokoReader.py
Created April 13, 2014 01:55
A very beginning project, a sms-reader for the openmoko aka gta02. moved here cause i delete the repo
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Little SMS-Application
# Was a project to learn and could be better
# Author: Vinzenz Hersche
# This code has GPL 2 as license
import gtk
import dbus
@hersche
hersche / .config
Created April 13, 2014 02:00
Linux-kernel-config for Lenovo x61s, kernel 3.7 in gentoo.
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 3.7.1-gentoo Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"

Keybase proof

I hereby claim:

  • I am hersche on github.
  • I am hersche (https://keybase.io/hersche) on keybase.
  • I have a public key whose fingerprint is F497 DD57 F7A7 FE3C EA60 D4B9 97FC EED5 EC63 5430

To claim this, I am signing this object:

@hersche
hersche / v.sh
Created December 12, 2016 17:34
Personal script for play around in bash and do shortcuts
#!/bin/bash
if [ "$1" = "setup" ]; then
if [ "$2" = "" ]; then
echo "use it like"
echo "v setup de de"
exit
fi
if [ "$3" = "" ]; then
echo "set second language to first"
echo "basicly use it like:"
#!/usr/bin/python3
# For ubuntu-desktop
import paho.mqtt.client as paho
broker="...cloudmqtt.com"
port=15
def on_publish(client,userdata,result): #create function for callback
pass
client1= paho.Client("thinkpad") #create client object
client1.username_pw_set('user','pw')
client1.on_publish = on_publish #assign function to callback
@hersche
hersche / piTemp.py
Created June 20, 2017 10:15
getting and logging rpi3 temp in hass
import os
fo = os.popen('vcgencmd measure_temp').read()
print(fo.split("=")[1].replace("'C\n",""))
# config for hass
sensor:
- platform: command_line
command: sudo -u mycroft python /usr/bin/piTemp.py
unit_of_measurement: "C (CPU)"
@hersche
hersche / php.ini
Created April 11, 2018 00:28
php.ini from xampp for youphptube-bug-resolve
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
#!/bin/bash
# Start our enviroment in yakuake with one cmd - you will need to mod it, but i think it can give you a good idea :)
# License: GPL v3 (if needed :p)
WORK_FOLDER=/home/anyusr/htdocs
QUADSESSION=$(qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.addSessionQuad)
qdbus org.kde.yakuake /yakuake/tabs org.kde.yakuake.setTabTitle $QUADSESSION Quadromatic
QUADTERMINALS=$(qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.terminalIdsForSessionId $QUADSESSION)
IFS=','
read -ra QUADTERMINALSARRAY <<< "$QUADTERMINALS"
qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.runCommandInTerminal ${QUADTERMINALSARRAY[0]} "cd $WORK_FOLDER/website-v2-fe;git pull; npm start"