Donwloadable/tweetable torrent of M.I.A's Piracy Funds Terrorism
Many web and desktop applications turn a URL in the text you type into a clickable
Donwloadable/tweetable torrent of M.I.A's Piracy Funds Terrorism
Many web and desktop applications turn a URL in the text you type into a clickable
This article is now published on my website: Prefer Subshells for Context.
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
When connecting to a remote server via SSH it is often convenient to use SSH agent forwarding so that you don't need a separate keypair on that server for connecting to further servers.
This is enabled by adding the
ForwardAgent yes
option to any of your Host
entries in ~/.ssh/config
(or alternatively with the -A
option). Don't set this option in a wildcard Host *
section since any user on the remote server that can bypass file permissions can now als use keys loaded in your SSH agent. So only use this with hosts you trust.
# Install ARCH Linux with encrypted file-system and UEFI | |
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description. | |
# Download the archiso image from https://www.archlinux.org/ | |
# Copy to a usb-drive | |
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux | |
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration. | |
# Set swedish keymap |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)#!/bin/sed -rf | |
# How to run: | |
# echo 'A A<1+B1-C>B<1-A1+B>D<1-B1qC> 0<0>0' | |
# Note: Your local sed may use a different flag for "extended" regexes; this is written for GNU sed. | |
# | |
# tape: [active-state] " " (state-name "<" (write move next-state)_0 (write move next-state)_1 ">")* " " tape... "<" curpos ">" tape... | |
# State names can be any character not in " <>". | |
# The tape consists of 0's and 1's. | |
# The "move" field can be "-" to move left, "+" to move right, or "q" to halt. |
#!/bin/bash | |
# Example: | |
# > echo "key1 value1 key2 value2" | ./key_value_pipe_to_json.sh | |
# {'key1': value1, 'key2': value2} | |
arr=(); | |
while read x y; | |
do |
{% include numberWithCommas.html number=1 %} | |
{% include numberWithCommas.html number=12 %} | |
{% include numberWithCommas.html number=123 %} | |
{% include numberWithCommas.html number=1234 %} | |
{% include numberWithCommas.html number=12345 %} | |
{% include numberWithCommas.html number=123456 %} | |
{% include numberWithCommas.html number=1234567 %} | |
{% include numberWithCommas.html number=12345678 %} | |
{% include numberWithCommas.html number=123456789 %} | |
{% include numberWithCommas.html number=1234567890 %} |
#!/usr/bin/env sh | |
if [ "$1" != "" ]; then | |
sBatchList="" | |
sBatchMessage="$3" | |
while IFS=, read col1 col2 | |
do | |
sBatchList="$sBatchList $col1" |