Skip to content

Instantly share code, notes, and snippets.

@stefansundin
stefansundin / .gitignore
Last active November 18, 2017 04:04
TEMPer cron + gnuplot
*.dat
*.png
*.txt
pcsensor-temper
Moved to https://github.com/stefansundin/open-with-vlc
@stefansundin
stefansundin / altdrag-toggle.ahk
Created June 8, 2017 06:56
Press Ctrl+Alt+A to toggle AltDrag. Compile with AutoHotKey: https://www.autohotkey.com/
; Press Ctrl+Alt+A to toggle AltDrag
; 0x111 = WM_COMMAND
; 0x8000+1 = SWM_TOGGLE https://github.com/stefansundin/altdrag/blob/8547fc8ea13829af712586558851b9ed50ae23e8/altdrag.c#L27
DetectHiddenWindows, on
^!a::
SendMessage, 0x111, 0x8000+1, 0,, ahk_class AltDrag
return
@stefansundin
stefansundin / download-slack-emoji.sh
Last active February 9, 2023 15:05
Download all of your Team's custom Slack emojis.
#!/bin/bash -eo pipefail
# Log in to Slack in a web browser and open the network tools to inspect the traffic.
# Filter the requests with "/api/" and pick one to inspect.
# You need the xoxc token from the request body, and a copy of the cookies. It is the "d" cookie that is important, but you can copy all of them. Make sure that the cookie value is percent encoded!
# Paste the values below.
# You need to have curl and jq installed.
# You can also get the xoxc token from localStorage. Run this in the JavaScript console:
# Object.entries(JSON.parse(localStorage.localConfig_v2)["teams"]).reduce((o,e) => Object.assign(o, { [e[1]["name"]]: e[1]["token"] }), {})
@stefansundin
stefansundin / .gitignore
Last active March 17, 2019 06:04
Gnuplot Heroku runtime metrics
*.tsv
*.gz
*.dat
*.png
*.json
@stefansundin
stefansundin / heroku-replay.sh
Last active August 30, 2018 17:39
Replay production Heroku requests to your local dev environment.
#!/bin/bash -e
app=rssbox
dev=http://rssbox.dev
heroku logs -t -s heroku -d router -a $app | {
while IFS= read -r line
do
path=$(echo $line | grep -oE 'path="([^"]+)"' | cut -d'"' -f2)
code=$(curl -s -o /dev/null -w "%{http_code}" "$dev$path")
@stefansundin
stefansundin / openssh-7.3.sh
Last active September 13, 2022 21:03
Install OpenSSH 7.3 in Ubuntu 16.04
# WARNING: Use this at your own risk. It will probably break your other packages and cause other havoc.
# These days you should just upgrade to Ubuntu 18.04.
$ ssh -V
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g 1 Mar 2016
wget https://launchpadlibrarian.net/277739251/openssh-client_7.3p1-1_amd64.deb
wget https://launchpadlibrarian.net/298453050/libgssapi-krb5-2_1.14.3+dfsg-2ubuntu1_amd64.deb
wget https://launchpadlibrarian.net/298453058/libkrb5-3_1.14.3+dfsg-2ubuntu1_amd64.deb
wget https://launchpadlibrarian.net/298453060/libkrb5support0_1.14.3+dfsg-2ubuntu1_amd64.deb
@stefansundin
stefansundin / manifest.json
Last active April 25, 2017 20:21
Speed up the Wistia player automatically.
{
"name": "Wistia auto-speed",
"version": "1.0",
"description": "Automatically speed up Wistia embeds to 1.5x, and select the best quality.",
"content_scripts": [
{
"matches": [
"*://*.wistia.com/medias/*",
"*://fast.wistia.net/embed/iframe/*"
],
@stefansundin
stefansundin / manifest.json
Created March 3, 2017 22:01
Replace the TED player with the equivalent YouTube video.
{
"name": "TED YouTube embed",
"version": "1.0",
"description": "Replace the TED player with the equivalent YouTube video.",
"content_scripts": [
{
"matches": ["*://www.ted.com/talks/*"],
"js": ["replace.js"],
"run_at": "document_end"
}