Skip to content

Instantly share code, notes, and snippets.

View TauPan's full-sized avatar
🏠
Working from home

Friedrich Delgado TauPan

🏠
Working from home
View GitHub Profile
@TauPan
TauPan / .Xdefaults-excerpt
Created December 23, 2021 09:16
My rofi config in ~/.Xdefaults
rofi.modi: combi,window,ssh,drun,run
rofi.combi-modi: window,ssh,drun,run
rofi.terminal: xdotool search stuff\|0fdf windowraise windowactivate
rofi.ssh-command: sh -c "{terminal}; tmux-ssh -n {host}"
rofi.run-shell-command: sh -c "{terminal}; tmux-select-or-new-window '{cmd}' '{cmd}'"
#!/usr/bin/env bash
name="$1"
shift
args="$*"
tmux-select-window-globally "$name" || tmux -2 new-window -n "$name" "$args"
# exit status 1 if window does not exist afterwards
sleep 0.1
tmux select-window -t "$name"
(setq weechat-timestamp-regex
"\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)?[[:blank:]]?\\([0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)")
(setq weechat-timestamp-prefix-regex
(format "^[[:blank:]]*%s"
weechat-timestamp-regex))
(setq weechat-info-line-regex
(format "%s[[:blank:]]+\\(<?-->?\\)[[:blank:]]+\\(.+\\)"
weechat-timestamp-prefix-regex))
(setq weechat-msg-line-regex
(format "%s[[:blank:]]+\\([^[:blank:]]+\\)[[:blank:]]+\\(.+\\)"
@TauPan
TauPan / fonts-st.conf
Created January 30, 2021 19:41
Disable noto color emoji for st only
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- ~/.config/fontconfig/fonts-st.conf file for st only -->
<fontconfig>
<include>/etc/fonts/fonts.conf</include>
<selectfont>
<rejectfont>
<pattern>
<patelt name="family" >
<string>Noto Color Emoji</string>
@TauPan
TauPan / shell loop
Created April 3, 2020 11:52
starting my window manager in ~/.xsession
while true
do
if [ -r $HOME/.tmpwm ]
then
sh $HOME/.tmpwm
else
# See https://bugs.archlinux.org/task/46374#comment139060
dbus-launch $HOME/bin/qtile > $HOME/.qtile-out.log 2> $HOME/.qtile-errors.log
fi
done
@TauPan
TauPan / functions.sh
Created October 4, 2019 07:45
Tell emacs about (ssh-related) environment variables from your shell, via emacsclient.
emacsclient_set_env_vars () {
for name in $@
do
emacsclient -e "(setenv \"$name\" \"$(eval echo \${${name}})\")"
done
}
ssh-copy-ssh-vars-to-emacs () {
emacsclient_set_env_vars $(env|grep SSH_|cut -f1 -d=)
}
@TauPan
TauPan / weechat-light-terminal.conf
Created April 25, 2018 07:50
All my colour settings for a light (not white) terminal in weechat. I simply filtered my fset buffer with "color"
# Comma separated list of channels
/set colorize_nicks.look.blacklist_channels ""
# Comma separated list of nicks
/set colorize_nicks.look.blacklist_nicks "so,root"
# Whether to colorize input
/set colorize_nicks.look.colorize_input off
# If off, then use lazy matching instead
@TauPan
TauPan / transport.py
Created March 22, 2018 13:04 — forked from chrisguitarguy/transport.py
Python xmlrpc lib Transport that used Requests
# -*- coding: utf-8 -*-
"""
A replacement transport for Python xmlrpc library.
Usage:
>>> import xmlrpclib
>>> from transport import RequestsTransport
>>> s = xmlrpclib.ServerProxy('http://yoursite.com/xmlrpc', transport=RequestsTransport())
>>> s.demo.sayHello()
@TauPan
TauPan / aptitude-update-home
Last active April 17, 2018 14:38
Some tmux scripts
#!/usr/bin/env bash
update_command='reset; while pgrep -f apt-get; do echo -n "O"; sleep 60; done;aptitude update; aptitude -y -d safe-upgrade --full-resolver; aptitude safe-upgrade --full-resolver; purge-old-kernels ; cat /var/run/reboot-required*'
reachable () {
netcat -w 1 -z $*
}
hosts='dirk thomas abrasax orion'
sudo wakeonlan -f /etc/wakeonlan/abrasax.wol
@TauPan
TauPan / conftest.py
Last active July 18, 2018 13:31 — forked from asfaltboy/conftest.py
A pytest fixture to test Django data migrations
# based on https://gist.github.com/asfaltboy/b3e6f9b5d95af8ba2cc46f2ba6eae5e2
# based on https://gist.github.com/blueyed/4fb0a807104551f103e6
from django.db import connection
from django.db.migrations.executor import MigrationExecutor
from django.core.management import call_command
import pytest