Skip to content

Instantly share code, notes, and snippets.

@daz
daz / telstra-ringer-extender.md
Last active May 30, 2016 06:09
Extending ringer time on Telstra

Custom ringer length on Telstra

Dial:

**61*101**[seconds in 5s increments]#

And press call

Example

@daz
daz / happy-birthday-es6.js
Created May 30, 2016 04:49
Happy Birthday in JavaScript ES6
[null, null, 'dear Glen', null].forEach( s =>
console.log(`Happy Birthday ${s || 'to you!'}`)
)
@daz
daz / build-zsh.sh
Created May 8, 2016 10:44
Build last stable version of ZSH from sources on Ubuntu, or any other version with small changes
#!/bin/bash
# Build Zsh from sources on Ubuntu.
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file.
# Make script gives up on any error
set -e
# Some packages may be missing
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo checkinstall
@daz
daz / install-noip-duc.sh
Created May 3, 2016 07:01
Script to install and configure no-ip client on Ubuntu/Debian
LOGIN="test@example.com"
PASSWORD=MyPassword
INTERFACE=wlan0
INTERVAL=30
mkdir -p "$HOME/src/noip"
cd "$HOME/src/noip"
wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz
tar zxf noip-duc-linux.tar.gz
cd noip-2.1.9-1
@daz
daz / tightvncserver-setup-script.sh
Last active December 7, 2023 18:05
Script to install VNC server and run at boot
# Setup VNC server
sudo apt-get remove -y tightvncserver
sudo apt-get install -y tightvncserver
mkdir -p "$HOME/.vnc"
vncpasswd -f <<< $PASSWORD > "$HOME/.vnc/passwd"
# VNC at startup
sudo tee /etc/init.d/tightvnc > /dev/null <<EOF
@daz
daz / jessie-2015.diff
Last active March 8, 2016 06:14
Diff between Jessie packages and Jessie Lite packages
Desired=Unknown/Install/Remove/Purge/Hold Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/tri | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/tri
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version ||/ Name Version
+++-=====================================-=================== | +++-==============================-==========================
ii acl 2.2.52-2 ii acl 2.2.52-2
ii adduser 3.113+nmu3 ii adduser 3.113+nmu3
ii adwaita-icon-theme 3.14.0-2 <
ii alacarte 3.11.91-2+rpi1 <
ii alsa-base 1.0.27+1 <
@daz
daz / custom.css
Created February 28, 2016 10:00
Squarespace Pacific CSS tweaks
/* Hide site info*/
#siteInfo {
display: none !important;
}
/* Push logo left */
#header #logoWrapper {
position: relative;
left: 0;
@daz
daz / apple-maps-cost.js
Last active November 28, 2017 09:18
Apple Maps cost per 3D map
// Regarding the purchase of C3 Technologies, how much each 3D mapping cost
window.location = "http://www.apple.com/au/ios/feature-availability/";
C3TechnologiesAquisitionPrice = 267000000;
flyoverLocations = document.querySelectorAll('#maps-flyover ul li').length;
costPerMap = C3TechnologiesAquisitionPrice / flyoverLocations;
'Total ' + flyoverLocations + ' maps costing ' + costPerMap + ' per map'
@daz
daz / ffmpeg-x264.sh
Last active January 29, 2021 22:26
Cross-compile ffmpeg with x264 for Raspberry Pi 2
# Build environment. I use vagrant ubuntu/trusty64
sudo apt-get install build-essential git-core
sudo git clone https://github.com/raspberrypi/tools.git /opt/tools
export CCPREFIX="/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-"
# Get ffmpeg and x264 repos
git clone git://source.ffmpeg.org/ffmpeg.git
@daz
daz / gist:a30780946cbaf32ea59a
Created April 4, 2015 07:43
Capistrano task to export and import Wordpress database
# Requires WP-CLI on the client and server
namespace :db do
desc 'Backup Wordpress database to shared/backup/timestamp.sql.gz and create a latest.sql.gz symlink'
task :backup do
stamp = Time.now.utc.strftime('%Y%m%d%H%M%S')
filename = "#{fetch(:application)}_#{stamp}.sql.gz"
backup_path = "#{shared_path}/backup/#{filename}"
on roles(:app) do
execute "mkdir -p #{shared_path}/backup"