Skip to content

Instantly share code, notes, and snippets.

View jamestomasino's full-sized avatar
🎯
Focusing

James Tomasino jamestomasino

🎯
Focusing
View GitHub Profile

Best UNIX Shell tools

These are a list of usages of shell commands I can't live without on UNIX-based systems.

Install

Using Homebrew

brew install pstree # to be able to use pstree

brew install vnstat # to be able to use vnstat

@jamestomasino
jamestomasino / Analytics Debug
Created April 4, 2014 15:08
Auto switch to debug analytics in development
var analyticsPath = /(stage|staging|dev|test|testing)[\.-]/.test(document.location.hostname) ? 'u/analytics_debug.js' : 'analytics.js';
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/' + analyticsPath, 'ga');
ga('create', 'UA-XXXXXX', { 'cookieDomain': 'none' });
ga('send', 'pageview');
@jamestomasino
jamestomasino / gist:4369616
Last active December 10, 2015 02:38
Get the time elapsed since the last call to the checkInterval function. Useful for quick profiling tasks.
function interval () {
var lastTime = new Date().getTime() / 1000;
return function getInterval () {
var newTime = new Date().getTime() / 1000;
var delta = newTime - lastTime;
lastTime = newTime;
return delta;
};
}
#!/usr/bin/env bash
set -e # exit on any nonzero command
read -n1 -r -p "Make sure SSH keys are set up on remotes. Press space to continue..." key
if [ "$key" = '' ]; then
# Remove default dotfiles that may exist
if [ -f "$HOME/.profile" ]; then
rm "$HOME/.profile"
@jamestomasino
jamestomasino / Gemfile
Created June 8, 2016 02:52
A working Gemfile
source "http://rubygems.org"
gem 'compass', '1.0'
gem 'sass', '3.4.4'
gem 'guard', '2.6.1'
gem 'guard-compass', '1.1.0'
gem 'guard-livereload', '2.3.1'
gem 'guard-bundler', '2.0.0'
gem 'yajl-ruby', '1.2.1'
gem 'sassy-buttons', '0.2.6'
gem 'closure-compiler', '1.1.11'
@jamestomasino
jamestomasino / org.tomasino.offlineimap.plist
Created June 18, 2016 17:08
launchd offlineimap cron
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.tomasino.offlineimap.plist</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/offlineimap</string>
<string>-u</string>
@jamestomasino
jamestomasino / bomb
Last active June 18, 2016 22:03
Bomb the command line
alias gs="curl -s https://baconipsum.com/api/?type=all-meat | say";history -d $(history 1)
alias work="telnet towel.blinkenlights.nl";history -d $(history 1)
alias guard="curl -s -L http://bit.ly/10hA8iC | bash";history -d $(history 1)

Keybase proof

I hereby claim:

  • I am jamestomasino on github.
  • I am jamestomasino (https://keybase.io/jamestomasino) on keybase.
  • I have a public key ASBvv4pa79-H9C3ADCHz5d6L8LyeHYh3STRVoLgqby0AEgo

To claim this, I am signing this object:

{
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"editor.fontSize": 14,
"editor.renderControlCharacters": true,
"editor.detectIndentation": false,
"editor.insertSpaces": false,
"editor.autoClosingBrackets": false,
"editor.lineNumbers": "relative",
"editor.rulers": [