Skip to content

Instantly share code, notes, and snippets.

View larrybolt's full-sized avatar

Larry Boltovskoi larrybolt

  • Orsa
View GitHub Profile
@larrybolt
larrybolt / MoveTemporaryFoldersToRamdisk_MacOSX.sh
Created December 16, 2012 22:14 — forked from iwat/MoveTemporaryFoldersToRamdisk_MacOSX.sh
Trying to make it work for user-folders, allow storing the files added to the ramdisk so I can use it for "~/Library/Caches/Google/".
#!/bin/bash
# +----------------------------------------------------------------------+
# | |
# | Set up Mac OS X to store temporary files in RAM rather than on disk.|
# | |
# | By Philipp Klaus <http://blog.philippklaus.de> |
# | |
# | Originally by Ricardo Gameiro <http://blogs.nullvision.com/?p=357> |
# | Changes by Daniel Jenkins |
@larrybolt
larrybolt / Captive Network Assistant
Created August 21, 2013 13:49
Telenet Hotspot/Homespot auto-login Should be placed at: `/System/Library/CoreServices/Captive Network Assistant.app/Contents/MacOS/Captive Network Assistant` overwriting the file
#!/usr/bin/php
<?php
$SSID=trim(`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | awk -F: '/ SSID:/ {print $2}' | sed -e 's/.*SSID: //'`);
if ( $SSID == 'TELENETHOTSPOT' )
{
if (`curl --cookie-jar /tmp/cookiejar \
--data "c=std&lang=nl&checkterms=1&userid=USERNAME&password=PASSWORD&remember=on&terms=on" \
--cookie "TNLANG=nl&TN_HS_COOKIE_DETECT=HELLO" \
--max-time 60 \
--user-agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0" \
@larrybolt
larrybolt / cf-ddns.sh
Last active June 16, 2024 19:06
Automatically update your CloudFlare DNS record to the IP, Dynamic DNS for Cloudflare
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# Automatically update your CloudFlare DNS record to the IP, Dynamic DNS
# Can retrieve cloudflare Domain id and list zone's, because, lazy
# Place at:
# /usr/local/bin/cf-ddns.sh
@larrybolt
larrybolt / report_php_test.php
Created October 6, 2013 22:58
Quick test of reportr!
<?php
$url = 'http://www.reportr.io';
$apikey = 'API KEY';
// Create a model, you only need to do this once, check afterwards at:
// http://www.reportr.io/api/API-KEY/models
$data = array(
'namespace' => 'ping',
'event' => 'ping',
'name' => 'Ping',
@larrybolt
larrybolt / gist:7807603
Created December 5, 2013 15:34
Dizzying but invisible depth
# get cpu temp
/opt/vc/bin/vcgencmd measure_temp
# get lists with most cpu-consuming processes
top -b -n 1 | head -n 12
ps -eo pcpu,pid,user,args | sort -k 1 -r | head -6
@larrybolt
larrybolt / init.sh
Created May 10, 2014 23:48
symlink everything from /Volumes/Data/larrybolt/*/* to ~/
#!/bin/sh
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# get all files and folders in the folder where this script is
for dir in $(ls $BASEDIR); do # loop trough each of them
if [ -d $dir ]; then # the file is a folder
if [ -d ~/$dir ]; then # it exists in our home folder as well
echo "$dir"
if [ -L ~/$dir ]; then
echo " - $dir is already symlinked!"
else
@larrybolt
larrybolt / bootstrap-server.sh
Created August 23, 2014 13:55
Bootstrap server to use with ansible
#!/usr/bin/env bash
if [ $# -eq 0 ]; then
echo "please supply a servername: bootstrap-server.sh node.example.com"
exit 1
fi
username=`whoami`
# copy public rsa key to server for root user
read -r -p "Transfer ssh public keys to server for root? [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then

Keybase proof

I hereby claim:

  • I am larrybolt on github.
  • I am larrybolt (https://keybase.io/larrybolt) on keybase.
  • I have a public key whose fingerprint is 3204 3CB8 9587 0598 13DA 2052 C978 A72D 8104 7E0C

To claim this, I am signing this object:

@larrybolt
larrybolt / vimgolf.user.js
Created October 30, 2014 23:32
Vimgolf user script
// ==UserScript==
// @name Vimgolf challenge duplicate filter
// @namespace http://lry.be
// @contact [email protected]
// @version 0.2
// @description Filtering duplicate entries and displaying the total unique entries at vimgolf
// @include http://vimgolf.com/challenges/*
// @include http://www.vimgolf.com/challenges/*
// ==/UserScript==