Skip to content

Instantly share code, notes, and snippets.

@socketbox
socketbox / update_qbit_port.sh
Last active February 24, 2024 11:31 — forked from trevordavies095/update_qbit_port.sh
Determine protonvpn port via gluetun and update qbittorrent
#!/bin/sh
# Determine protonvpn port via gluetun and update qbittorrent
#
# Add the following to sudo crontab -e to run every 5 minutes
# */5 * * * * /bin/sh /path/to/update_qbit_port.sh
# For synology users, run the script as root via the task scheduler every 5 minutes.
QBITTORRENT_USER= # qbittorrent username
QBITTORRENT_PASS= # qbittorrent password
QBITTORRENT_PORT=
@socketbox
socketbox / openconnect_vpn_inside_netns.sh
Created January 30, 2024 23:41 — forked from duboisf/openconnect_vpn_inside_netns.sh
OpenConnect VPN Inside Linux Network Namespace
#!/bin/bash
# start openconnect tunnel and shell inside Linux network namespace
#
# this is a fork of schnouki's script, see original blog post
# https://schnouki.net/posts/2014/12/12/openvpn-for-a-single-application-on-linux/
#
# original script can be found here
# https://gist.github.com/Schnouki/fd171bcb2d8c556e8fdf
# ------------ adjust values below ------------
@socketbox
socketbox / postgres_queries_and_commands.sql
Created September 23, 2021 18:54 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@socketbox
socketbox / 960gs.scss
Created June 30, 2012 20:35 — forked from jmblog/960gs.scss
960gs.scss
/*-----------------------------------------------------
960 Grid System ~ Core CSS.
Learn more ~ http://960.gs/
Licensed under GPL and MIT.
-------------------------------------------------------*/
/* Grid Settings
---------------------------*/
// 12-column grid