Skip to content

Instantly share code, notes, and snippets.

This software is provided without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

Keybase proof

I hereby claim:

  • I am naphthalene on github.
  • I am sigmat (https://keybase.io/sigmat) on keybase.
  • I have a public key whose fingerprint is 5774 C208 27EA 58D8 67BA 8AC1 EEB5 4425 64F7 63B1

To claim this, I am signing this object:

[Mad Catz Wired Xbox 360 Controller]
plugged = True
plugin = 2
mouse = False
AnalogDeadzone = "4096,4096"
AnalogPeak = "32768,32768"
DPad R = "hat(0 Right)"
DPad L = "hat(0 Left)"
DPad D = "hat(0 Down)"
@naphthalene
naphthalene / jkpl.css
Created June 9, 2016 13:46 — forked from PercussiveRepair/jkpl.css
jenkins pipeline css
#build-pipeline-plugin-content {
background-color: none;
border-radius: 0;
}
#build-pipeline-plugin-content h1 {
display: none;
}
tbody.pipelineGroup {

SSH agent forwarding and screen

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.

@naphthalene
naphthalene / random_walk.py
Created March 11, 2016 21:12
Random Walk Algorithm
from random import random
from math import floor
MAP_SIZE = 30
FLOOR_COVERAGE = 35.0 # %
INITIAL_BUFFER = 5.0 # % border
# 0 -> wall
# 1 -> floor
#!/bin/bash
set -f
IFS=$'\n'
esearch -db protein -query "ybfE" |\
efetch -format gpc -mode xml |\
xtract -insd complete CDS coded_by > query_results.txt
for i in $(cat query_results.txt);
do echo "$i" | awk '{match($0,"([A-Z0-9\\.]+)\\s+(complement\\()?([A-Z0-9\\.]+):([0-9]+)\\.\\.([0-9]+)(\\))?",a)}END{print a[1], a[3], a[4], a[5]}'
done
efetch -db protein "ybfE" -format gpc -mode xml | xtract -insd complete CDS coded_by | awk '{match($0,"([A-Z0-9\\.]+)\\t([A-Z0-9\\.]+):([0-9]+)\\.\\.([0-9]+)",a)}END{print a[1], a[2], a[3], a[4]}' | tee output.txt
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQENBFR/o94BCADH6sNU/yxjfVJb7eHRyFg+++TOTCn9BLrwHmvdl9VBbD1WP7zy
wrf0DiWav9HIeP9PSMr0vswqgW072TDdH/UZ8cNkTu4d3Z8SCyVjhmRpNbiCoaD9
qqjkBJYIxNHM9X/K73PQgM09xAwiZ79TvFO6AXdW3wsAHF9XZvMM86PbLKZSSjoO
DkhmnqA/bwF39mgkJhIN234sdwp1NIppfWtXTlGmJ50VGVL+UgB8T0MR3xDhbOi+
HSRDGQQbEuAuuChiPU5xylqMS6kR0C9kqFAUeOfk7o8jmMTakRd7FXPaXrIHqznZ
J44eplfEbAnqBMN6V+ZLS5A9ynRbFildFg3fABEBAAG0LFBhdmVsIFNhZGlrb3Yg
KHRzaWdzdHkpIDxwYXNoYWxhYkBnbWFpbC5jb20+iQE+BBMBAgAoBQJUf6PeAhsD
# To use, run `sudo xboxdrv -c xboxrl.conf`
# NOTE:
# I've customized some keyboard bindings in Rocket League to make this work better:
# Drive forwards: U
# Drive backwards: J
# Barrel Roll: LeftShift
# Jump: Space
# Boost: Enter
# Toggle Camera: q