This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tmux list-sessions | awk -F: '{ print $1 " \"" $2 "\""; }' |\ | |
xargs dialog --ok-label 'Attach' --cancel-label 'New session' --menu tmux 20 80 20 2>/tmp/tmux-session \ | |
&& tmux attach-session -t $(cat /tmp/tmux-session; rm /tmp/tmux-session) \ | |
|| tmux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.gis.db import models | |
class FlexibleSRSGeometryField(models.GeometryField): | |
""" | |
GeoDjango field that allows storing of geometries with different SRIDs. | |
""" | |
def __init__(self, *args, **kwargs): | |
kwargs['srid'] = -1 | |
super(FlexibleSRSGeometryField, self).__init__(*args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# It happens every so often on Arch Linux, that the kernel is updated and you have to reboot in order | |
# to being able to load the new kernel modules. This can lead to a situation where you are not able | |
# to mount filesystems, start docker, etc. because the old running kernel can not load the new modules. | |
# If you want to defer the reboot and still want to load some kernel modules, you can re-install the | |
# old kernel like this: | |
sudo pacman -U /var/cache/pacman/pkg/linux*-$(uname -r | grep -o "^.*-[0-9][0-9]*")-x86_64.pkg.tar.xz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sometimes another client restricts the screen size of the current session. | |
The following command will quickly kill all other tmux clients from the session. | |
tmux list-clients -t $(tmux display-message -p '#S') -F '#{client_tty}' | grep -v $(tmux display-message -p '#{client_tty}') | xargs --max-args 1 tmux detach-client -t | |
Add it to ~/.tmux.conf to have it as "C-b k" shortcut: | |
bind k neww "tmux list-clients -t $(tmux display-message -p '#S') -F '#{client_tty}' | grep -v $(tmux display-message -p '#{client_tty}') | xargs --max-args 1 tmux detach-client -t" |