Skip to content

Instantly share code, notes, and snippets.

# To set this up, first get tailscale working in an isolated linux shell:
# 1. sudo systemctl stop tailscaled.service
# 2. tailscaled -port 9993 -state tailscale-luks-setup.state -tun userspace-networking -socket ./tailscaled.sock
# 3. tailscale -socket ./tailscaled.sock up -hostname HOSTNAME-luks
# 4. tailscale -socket ./tailscaled.sock down
# 5. ctrl-c out of tailscaled
# 6 sudo systemctl start tailscaled.service
#
# Then add the .state file to your machine secrets and pass its path as tailscaleStatePath.
@danbst
danbst / README.md
Last active October 22, 2023 12:06
[Linux] [Firefox] Open link in browser, which is in current workspace

I use separate Firefox profiles for work and personal stuff. To distinguish those I place them on different workspaces.

  • Workspace 0: firefox --no-remote -P MyJob
  • Workspace 1: firefox --no-remote -P default

I have also company Slack on Workspace 0. Which usually contains links to some work stuff.

The problem

@F30
F30 / gpg-list-ownertrust.py
Created September 27, 2017 10:02
List GPG Ownertrust
#!/usr/bin/env python3
import sys
import os
import gnupg
TRUST_LEVEL_MAP = {
'q': '???',
@dutc
dutc / multipaul.py
Created February 3, 2017 01:23
multipaul example
#!/usr/bin/env python3
from argparse import ArgumentParser
from multiprocessing import Process
from threading import Thread
from curio import run, spawn, sleep
from curio.socket import socket
from curio.socket import (AF_INET, SOCK_DGRAM, IPPROTO_UDP,
SOL_SOCKET, SO_REUSEADDR,
gethostbyname, gethostname)
from os import getpid, getppid
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active March 6, 2024 18:14
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@NoraCodes
NoraCodes / soaser_on_linux.md
Last active May 21, 2016 11:52
Sins Of A Solar Empire: Rebellion and Sins of the Prophets on Linux

How to Run SoaSE:R on Linux

Install playonlinux from your distribution. Then, through playonlinux, install Windows Steam.

Only a few tweaks need to be made in order to run SoaSE:R. Open the configuration

  1. In Video, set Offscreen Render Mode to backbuffer (NOTE: This is not required in windowed mode, as far as I know).
  2. Install d3dx9 and dotnet45
  3. Paste export PULSE_LATENCY_MSEC=60 into Misc -> Command to execute before running the program
@dutc
dutc / proc_self_mem_quine.py
Created October 26, 2015 22:56
reading the current binary out of /proc/self/mem
#!/usr/bin/env python3
from collections import namedtuple
from itertools import islice, tee
from os.path import realpath
from re import compile
nwise = lambda g,n=3: zip(*(islice(g, i, None) for i, g in enumerate(tee(g, n))))
class MemRange(namedtuple('MemRange', 'from_addr to_addr offset length')):
@NoraCodes
NoraCodes / SCFAonLinux.md
Last active April 4, 2024 13:26
Supreme Commander: Forged Alliance with Steam on Linux with PlayOnLinux

This guide is out of date. Use https://github.com/FAForever/faf-linux instead.

Install PlayOnLinux with your package manager (i.e. sudo apt-get install playonlinux). Then, type playonlinux and wait for it to refresh its list.

Install Steam under PlayOnLinux. Once Steam is running, exit it, select its entry in PlayOnLinux, and select Configure.

I suggest using Wine 1.7.8-d3d doublebuffer

Now go to the "Install Components" section and install, in any order: d3dx9, directx9, dotnet40

@dutc
dutc / dedent.py
Created October 23, 2014 00:12
dedenting helpers for use with vim
#!/usr/bin/env python
from textwrap import dedent
if __name__ == '__main__':
from sys import stdin
exec dedent(''.join(stdin)) in locals(), globals()