Skip to content

Instantly share code, notes, and snippets.

Avatar
vimgolfing

Titouan Teyssier TitouanT

vimgolfing
View GitHub Profile
View encode.py
# Encode inputfile.tar.gz as a series of video frames
# Frames are written to frames/frameNNNN.png
from PIL import Image
with open('inputfile.tar.gz', 'rb') as f:
data = f.read()
WIDTH = 120
HEIGHT = 90
CHUNK_SIZE = int((WIDTH * HEIGHT) / 8)
@william8th
william8th / .tmux.conf
Last active Sep 20, 2022
Tmux open new pane in same directory
View .tmux.conf
# Set the control character to Ctrl+Spacebar (instead of Ctrl+B)
set -g prefix C-space
unbind-key C-b
bind-key C-space send-prefix
# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
@fbrinker
fbrinker / i3-display-swap.sh
Last active Jul 28, 2022
Swap i3 displays / workspaces between displays
View i3-display-swap.sh
#!/usr/bin/env bash
# requires jq
DISPLAY_CONFIG=($(i3-msg -t get_outputs | jq -r '.[]|"\(.name):\(.current_workspace)"'))
for ROW in "${DISPLAY_CONFIG[@]}"
do
IFS=':'
read -ra CONFIG <<< "${ROW}"
if [ "${CONFIG[0]}" != "null" ] && [ "${CONFIG[1]}" != "null" ]; then
@pastleo
pastleo / nm_l2tp_ipsec_vpn.md
Last active Sep 8, 2022
setup L2TP IPSEC VPN in archlinux using NetworkManager
View nm_l2tp_ipsec_vpn.md
@raine
raine / gitter-weechat-instructions.md
Last active Oct 4, 2021
Connecting to gitter using weechat
View gitter-weechat-instructions.md

Auth and copy token at https://irc.gitter.im/.

Ignore the /PASS thing, it doesn't work in weechat.

/server add gitter irc.gitter.im -ssl -ssl_verify -ssl_dhkey_size=1024 -password=<REPLACE_WITH_YOUR_TOKEN>
/connect gitter
@soheilhy
soheilhy / nginxproxy.md
Last active Sep 20, 2022
How to proxy web apps using nginx?
View nginxproxy.md

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers