Skip to content

Instantly share code, notes, and snippets.

View tlwr's full-sized avatar
🇳🇱
all day i think about shareholder value

toby lorne tlwr

🇳🇱
all day i think about shareholder value
View GitHub Profile
@rhowe-gds
rhowe-gds / vpn
Last active June 4, 2019 15:44
VPN connection script
#!/usr/bin/env bash
set -euo pipefail
usage="$0: <up|down> [connection name]"
action="${1?$usage}"
connection="${2:-GDS VPN Developer}"
oath_key=vpn
pass_key=gds/vpn
@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@slok
slok / run_docker_x11.sh
Created February 22, 2015 11:11
x11 with docker archlinux
KEY=$(xauth list |grep $(hostname) | awk '{ print $3 }' | head -n 1)
DCK_HOST=docker-skype
xauth add $DCK_HOST/unix:0 . $KEY
docker run -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix \
-v $HOME/.Xauthority:/tmp/.Xauthority \
-v /dev/snd:/dev/snd \
-e DISPLAY=unix$DISPLAY \
-e XAUTHORITY=/tmp/.Xauthority \
-h $DCK_HOST \
@syhw
syhw / dnn.py
Last active January 24, 2024 19:38
A simple deep neural network with or w/o dropout in one file.
"""
A deep neural network with or w/o dropout in one file.
License: Do What The Fuck You Want to Public License http://www.wtfpl.net/
"""
import numpy, theano, sys, math
from theano import tensor as T
from theano import shared
from theano.tensor.shared_randomstreams import RandomStreams
@dshaw
dshaw / nodebook.md
Last active November 17, 2022 14:50
Running Node on a Samsung 303C Chromebook

Running Node on a Samsung 303C Chromebook

Motivation

After @mikeal and @lyle purchased Chromebooks for kids activities at NodeConf 2014, I was very impressed with the device and decided to explore this as a laptop and hacking device for my kids (7 & 8). I'd love to retain the simplicity of the web-focused ChromeOS experience while letting my kids hack on NodeBots and learn how to program.

It seems like the platforms that ChromeOS runs on are quite diverse. The Samsung 303C hit the right balance of being an aesthetically pleasing looking device, having respectable build quality and the amazing $250 price point. The 303C has an ARM processor. Not all Chromebooks do. I'm writing the below step-by-step very specifically for this system.

Resources

@willurd
willurd / web-servers.md
Last active May 23, 2024 20:20
Big list of http static server one-liners

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.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000