Skip to content

Instantly share code, notes, and snippets.

View chuenniger's full-sized avatar

Christian Hünniger chuenniger

View GitHub Profile
@chuenniger
chuenniger / xmlrpc_fix.py
Created January 20, 2023 14:14
Python3 xmlrpc - Unknown tag error - fix
# Error: xmlrpc.client.ResponseError: ResponseError("unknown tag 'uint'")
from xmlrpc import client
# fix: xmlrpc doesn't know the XML-RPC type 'uint'
client.Unmarshaller.dispatch['uint'] = client.Unmarshaller.end_int
@chuenniger
chuenniger / couchdb_delete_documents_by_view.py
Created September 16, 2021 10:37
CouchDB - Delete documents by view
import couchdb
user = ''
password = ''
db_name = ''
view = 'debug/all_events'
conn_string = couchdb.Server(
'http://%s:%s@localhost:5984/' % (user, password)
)
@chuenniger
chuenniger / gist:ed13feacbda6d76c4abe2d82c32c24a1
Created June 21, 2021 12:36
Set a branch to master branch
# checkout the branch
git checkout dev_branch
# reset to master
git reset --hard master
# push it baby
git push --force
@chuenniger
chuenniger / motivation.json
Last active April 5, 2019 10:30
MagicMirror Motivationssprüche
{
"anytime" : [
"Du bist toll!",
"Wer das Ziel nicht kennt, wird den Weg nicht finden!",
"Der Lösung ist das Problem egal!",
"Mach die beste Version aus Dir!"
],
"morning" : [
"Los, Arsch hoch!",
"Guten Morgen, Du siehst toll aus :)"
@chuenniger
chuenniger / sshrc
Last active June 21, 2018 20:03
Email Notification on SSH login
# from here: https://www.vultr.com/docs/enable-ssh-login-notification-on-linux
# vim /etc/ssh/sshrc
IP="$(echo $SSH_CONNECTION | cut -d " " -f 1)"
HOSTNAME=$(hostname)
NOW=$(date +"%e %b %Y, %a %r")
echo 'Someone from '$IP' logged into '$HOSTNAME' on '$NOW'.' | mail -s 'SSH Login Notification' <YOUR_EMAIL_ADDRESS>
# service sshd restart
@chuenniger
chuenniger / fixit.sh
Created June 13, 2018 08:52
apt fixes
# E: Unable to parse package file /var/lib/apt/lists/repos.azulsystems.com_debian_dists_stable_main_binary-armhf_Packages (1)
# W: You may want to run apt-get update to correct these problems
# E: The package cache file is corrupted
sudo rm /var/lib/apt/lists/* -vf
sudo apt update
@chuenniger
chuenniger / logging.py
Created June 12, 2018 09:40
Python: change log level for specific modules
# decativate debug logging PN532
logging.getLogger('Adafruit_PN532.PN532').setLevel(logging.INFO)
@chuenniger
chuenniger / .vimrc
Last active March 14, 2016 10:18
VIM - Standard Konfiguration auf einem dunklen Terminal (~/.vimrc oder /etc/vim/vimrc.local)
" set number
" set list
" set listchars=tab:>-
set autoindent
set pastetoggle=<F10>
set nowrap
set background=dark
set hlsearch
syntax on
@chuenniger
chuenniger / gist:3bcba07cdf79a4d303dc
Created November 10, 2015 09:36
TYPO3 - EXT:news - Backend-Apassungen
// News Element
// won't work (these fields are visible after BE reload (is_event))
//TCAdefaults.tx_news_domain_model_news.full_day = 1
//TCAdefaults.tx_news_domain_model_news.organizer_simple = Bernd die Socke
// works fine
TCAdefaults.tx_news_domain_model_news.title = Hier Text eingeben
TCAdefaults.tx_news_domain_model_news.author = Bernd
@chuenniger
chuenniger / SVN
Last active August 29, 2015 13:57
# Löschen von Dateien, die fehlen
svn st | grep "! " | cut -c9- | xargs -I {} svn del {}
# hinzufügen von unbekannten Dateien
svn st | grep "? " | cut -c9- | xargs -I {} svn add {}