Skip to content

Instantly share code, notes, and snippets.

@Juul
Juul / hackintosh-z220.md
Created April 12, 2016 00:24
juul's hackintosh guide

Here's some quick notes on how to build a cheap high-performance hackintosh. This guide is made so you can start with ~$400 and get a useful working system, then upgrade a bit at a time to arrive at a ~$1k powerful machine that will do HD/4k video color grading.

The only real disadvantage to this system over a real iMac is that it takes effort and forethought to upgrade to new versions of OS X.

Specs:

CPU: Xeon E3-1240v2 Quad-core 3.4 GHz
RAM: 32 GB
HD 1: 500 GB solid state
@Juul
Juul / sshudo
Last active May 5, 2016 18:12
sshudo
#!/bin/sh
# Download SSH public key for sudo room user from sudo-humans
BASE_URL="https://sudoroom.org/humans"
MAX_TIME="5" # Fail if download takes longer than this (in seconds)
GET_CMD=""
if [ "$#" -ne "1" ]; then
echo "Usage: sshudo <username>" >&2
#!/bin/bash
# Run this in an existing git-tracked directory to set up
# a remote repo on hostname.
#
# Usage: ./git_setup hostname
#
# This assumes you have ssh key-based login access as the user 'git'
# on the remote server. If this is not the case,
# change the GITUSER variable below:
@Juul
Juul / trippy.cat.js
Created August 18, 2016 12:31
trippy.cat
#!/usr/bin/env node
// To use first run: npm install colors through2
var colors = require('colors');
var through = require('through2');
var ins;
if(process.argv.length > 2) {
var fs = require('fs');
@Juul
Juul / ssh_encrypt_file.sh
Last active March 30, 2017 02:06
Encrypt a file with an ssh public key and include instructions on how to decrypt
#!/bin/bash
# ToDo
#
# * make it work for non-rsa keys
# * support encrypting multiple files at once
# * add support for other pubkey sources than github
if [ "$#" -ne "2" ]; then
# add a new client mode wifi interface
Edit `/etc/config/wireless` adding a section like this:
```
config wifi-iface
option device 'radio0'
option ifname 'cli0'
option network 'cwan'
#!/bin/bash
# This script is for setting TrackPoint sensitivity/speed/acceleration
# on a ThinkPad X220 to something reasonable since neither maxing out
# the UI mouse sensitivity nor maxing out /sys/devices options
# were getting the sensitivity high enough on their own.
SYSFS_PATH="/sys/devices/platform/i8042/serio1"
echo 0 > ${SYSFS_PATH}/inertia
@Juul
Juul / ssh_dropbear_key_copy.sh
Created June 29, 2018 08:01
Copy your ssh public key to authorized keys for root on a system running dropbear (e.g. OpenWRT)
#!/bin/bash
if [ "$#" -ne "1" ]; then
echo "" > /dev/stderr
echo "Error: Invalid number of arguments" > /dev/stderr
echo "" > /dev/stderr
echo "Usage: $0 ip_or_hostname" > /dev/stderr
echo "" > /dev/stderr
exit 1
fi
@Juul
Juul / simple_gateway.md
Last active December 3, 2018 22:50
Turn your computer into a gateway that shares internet from the wifi to ethernet
# Edit /etc/NetworkManager/NetworkManager.conf adding the following
# to make network manager stop managing your ethernet interface
[keyfile]
unmanaged-devices=mac:3c:90:01:39:b2:62; 
# Use the MAC address from your ethernet card
# You can get the MAC address with the command: 
ip link show dev eth0
# (assuming your ethernet device is called eth0)
@Juul
Juul / gcc_cross_switch_version.sh
Last active May 16, 2019 01:15
Switch currently used gcc cross-compiler versions
#!/bin/bash
# This script changes the `arm-linux-gnueabihf-*` (or specified prefix)
# symlinks in /usr/bin to point to the specified version
# e.g. running with "7" as the argument will create the symlink
# /usr/bin/arm-linux-gnueabihf-gcc -> /usr/bin/arm-linux-gnueabihf-gcc-7
# and so on for all the normal cross-compiler commands
CMDS=( "gcc" "gcc-ar" "gcc-nm" "gcc-ranlib" "cpp" "gcov" "gcov-dump" "gcov-tool" )
BINPATH=/usr/bin