(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:
| # Ask for the user password | |
| # Script only works if sudo caches the password for a few minutes | |
| sudo true | |
| # Install kernel extra's to enable docker aufs support | |
| sudo apt-get -y install linux-image-extra-$(uname -r) | |
| # Add Docker PPA and install latest version | |
| sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
| sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |
| #!/usr/bin/env bash | |
| # Time-stamp: <2014-07-31 13:31:43 (ryanc)> | |
| # | |
| # Description: Mirror traffic between two interfaces using Linux's | |
| # traffic control subsystem (tc) | |
| trap cleanup EXIT | |
| CLEANUP=1 | |
| SRC_IFACE=$1 |
| <VirtualHost *> | |
| ServerName example.com | |
| WSGIDaemonProcess www user=max group=max threads=5 | |
| WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi | |
| <Directory /home/max/Projekte/flask-upload> | |
| WSGIProcessGroup www | |
| WSGIApplicationGroup %{GLOBAL} | |
| Order deny,allow |
| #!/usr/bin/python | |
| # demo from here: http://pymotw.com/2/urllib2/index.html#uploading-files | |
| import itertools | |
| import mimetools | |
| import mimetypes | |
| from cStringIO import StringIO | |
| import urllib | |
| import urllib2 |
| # Add field | |
| echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}' | |
| # { | |
| # "hello": "world", | |
| # "foo": "bar" | |
| # } | |
| # Override field value | |
| echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}' | |
| { |
| #!/usr/bin/env python | |
| from __future__ import print_function | |
| import base64 | |
| import sys | |
| PEM = ("""-----BEGIN RSA PRIVATE KEY----- | |
| MIIEogIBAAKCAQEAgK1Q6Ydi8UUheJLvnTYJE65NOZtAtjDdDSxS+6b4x9EakjIylljSzs5uLEJn |
| """ | |
| Add copy to clipboard from IPython! | |
| To install, just copy it to your profile/startup directory, typically: | |
| ~/.ipython/profile_default/startup/ | |
| Example usage: | |
| %copy hello world | |
| # will store "hello world" |
Note: these instructions are for pre-Sierra MacOS. Sierra Users: see https://gist.github.com/gravitylow/fb595186ce6068537a6e9da6d8b5b96d by @gravitylow.
If you are getting this in gdb on OSX while trying to run a program:
Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))| #!/bin/bash | |
| cat /var/lib/dbus/machine-id && exit | |
| # Provided by dbus, hence available on all systemd systems. | |
| # Any user can read it and it is persistent accross boots. | |
| # It is unique per installation, and works well in VMs. | |
| # Not all systems (i.e. stage3 gentoo/handbook install) | |
| # have dbus installed by default. | |
| cat /sys/class/dmi/id/product_uuid && exit |