Skip to content

Instantly share code, notes, and snippets.

@lukexie
lukexie / daemon_fork_twice.py
Last active February 24, 2019 13:16 — forked from cannium/gist:7aa58f13c834920bb32c
example for double fork
# c.f. https://stackoverflow.com/a/5386753
import os
import sys
print('pre-fork: pid=%d, pgid=%d, sid=%d' % (os.getpid(), os.getpgid(0), os.getsid(0)))
pid = os.fork()
if pid > 0:
sys.exit(0)
@lukexie
lukexie / ssh-copy-id.py
Created October 10, 2017 07:47 — forked from csaladenes/ssh-copy-id.py
ssh-copy-id for Windows with custom port
"""ssh-copy-id for Windows.
Example usage: python ssh-copy-id.py ceilfors@my-remote-machine
This script is dependent on msysgit by default as it requires scp and ssh.
For convenience you can also try that comes http://bliker.github.io/cmder/.
"""
import argparse, os
from subprocess import call

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

(a gist based on the old toolmantim article on setting up remote repos)

To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.

This is somewhat of a follow-up to the previous article setting up a new rails app with git.

For the impatient

Set up the new bare repo on the server:

@lukexie
lukexie / ARMonQEMUforDebianUbuntu.md
Created January 9, 2020 09:40 — forked from luk6xff/ARMonQEMUforDebianUbuntu.md
Emulating ARM with QEMU on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

If there's no qemu-arm-static in the package list, install qemu-user-static instead