Skip to content

Instantly share code, notes, and snippets.

@toogle
toogle / setup-ap.sh
Created July 16, 2017 20:01
Setup WiFi Access Point
#!/bin/sh
if [[ $UID != 0 ]]; then
echo 'The script needs to run as root' && exit 1
fi
rfkill unblock wlan
ifconfig wlan0 192.168.100.1/24 up
sysctl -q net.ipv4.ip_forward=1
@toogle
toogle / google-removal.js
Created November 29, 2015 14:12
Google Search Removal Tool (using CasperJS)
const URLS_FILENAME = 'urls.txt';
const GOOGLE_EMAIL = 'YOUR_EMAIL';
const GOOGLE_PASSWD = 'YOUR_PASSWORD';
// Read URLs from the file.
var fs = require('fs');
var stream = fs.open(URLS_FILENAME, 'r');
var urls = [];
while (!stream.atEnd()) {
@toogle
toogle / docker-update.sh
Last active August 29, 2015 14:18
Shell script for updating Docker images
#!/bin/bash
update() {
echo -n "Update \"$1\" [Y/n]? "
stty cbreak
local char=$(dd if=/dev/tty bs=1 count=1 2>/dev/null)
stty -cbreak
if [[ $char != '' ]] ; then
echo