Skip to content

Instantly share code, notes, and snippets.

View mcotton's full-sized avatar

Mark Cotton mcotton

View GitHub Profile
@mcotton
mcotton / gist:4acc15ff929d2452b5be
Last active May 23, 2021 22:42
Settings for new OSX install
Show full path in Finder window
~ $ defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
~ $ killall Finder
Change screenshot location
- $ defaults write com.apple.screencapture location ~/Documents/screenshots
Change network locations bases on wifi SSiD
# https://github.com/sashagavrilov/locationchanger
curl -L https://github.com/sashagavrilov/locationchanger/raw/master/locationchanger.sh | bash
@mcotton
mcotton / gist:8d68ef44b545e98af9a1
Last active August 29, 2015 14:23
Eagle Eye interview questions
// Question 1
// Write a for loop that counts 1 - 4.
// It should output "Output " plus the current count
// Example: wait 2 seconds then "Output 1", wait 2 seconds then "Output 2", ... wait 2 seconds then "Output 4"
// If you they need help getting start you can use this block
(function() {
for(var i=1; i<5; i++) {
setTimeout(function() { console.log('Output ' + i) }, 2000)
}
@mcotton
mcotton / gist:9d6d45fa666ea4dc9eb4
Created August 28, 2014 14:53
Run speed test on a bridge, using speedtest.net
wget --no-check-certificate -O speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
chmod +x speedtest-cli
./speedtest-cli
@mcotton
mcotton / gist:9879510
Created March 30, 2014 20:49
getting a raspberry pi ready for node-rfid
sudo apt-get upgrade; sudo apt-get update
wget http://nodejs.org/dist/v0.10.12/node-v0.10.12-linux-arm-pi.tar.gz
mkdir ~/src
cd ~/src
cp ~/node-v0.10.12-linux-arm-pi.tar.gz .
tar -xvzf node-v0.10.12-linux-arm-pi.tar.gz
#add to ~/.bashrc
NODE_JS_HOME=/home/pi/src/node-v0.10.12-linux-arm-pi
@mcotton
mcotton / gist:9468557
Created March 10, 2014 16:34
shell command to find hosts on network
for ip in $(seq 1 254); do ping -c 1 192.168.1.$ip>/dev/null; [ $? -eq 0 ] && echo "192.168.1.$ip UP" || : ; done
#!bin/bash
mkdir /mnt/cdrom
mount -r /dev/cdrom /mnt/cdrom
cd /tmp
tar zxf /mnt/cdrom/VMwareTools-*.tar.gz
./vmware-tools-distrib/vmware-install.pl --default
@mcotton
mcotton / gist:8522370
Created January 20, 2014 15:45
rearm windows
slmgr –rearm
@mcotton
mcotton / gist:8422341
Last active January 3, 2016 06:19
turn query string into an object
function(key) {
var q = location.search.replace('?','').split('&'),
obj = new Object();
q.forEach(function(item) {
var splits = item.split('=');
obj[splits[0]] = splits[1];
});
return (key) ? obj[key] : obj;
@mcotton
mcotton / gist:7883199
Created December 9, 2013 23:46
making a dynamically calculated property
$(img.currentTarget).animate({
'position': 'absolute',
'height': (function() { return $('#slider').slider('value') * 1.1 + '%' })(),
'width': (function() { return $('#slider').slider('value') * 1.1 + '%' })(),
'z-index': '10',
'margin': '-15px -15px -15px -15px'},
0,
function() {}
})
@mcotton
mcotton / gist:7570322
Last active December 28, 2015 22:18
Setting up bridge 1.50 inside a VM

boot into single user mode:

hit any key, hit 'a' to append arguments, add 'single' to end of arguments

check that is has an ip (VMware needs to be in bridged mode):

ip addr
dhclient eth0

ping google.com