Skip to content

Instantly share code, notes, and snippets.

View jasonrhodes's full-sized avatar

Jason Rhodes jasonrhodes

View GitHub Profile
@jasonrhodes
jasonrhodes / timezone.sh
Last active January 10, 2022 23:13
Manage your Mac OS X timezone like, super easy and stuff
#!/usr/bin/env bash
get() {
sudo systemsetup -gettimezone
}
set() {
sudo systemsetup -settimezone $1
}
@SiZapPaaiGwat
SiZapPaaiGwat / webpack.nginx.conf
Last active November 19, 2021 19:10
webpack-dev-server configuration in nginx on development server
upstream ws_server {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name 10.1.2.225;
location / {
proxy_pass http://ws_server/;
@jasonrhodes
jasonrhodes / gutpunch.sh
Created October 16, 2014 20:03
Because sometimes `gut punch origin master` is more accurate
# In ~/.bash_profile or ~/.profile, whichever you use
alias gut="git"
# In ~/.gitconfig
[alias]
punch = push
# Or maybe more acccurately
[alias]
punch = push -f
@gggritso
gggritso / console.lol.js
Created October 10, 2014 03:33
console.lol
console.lol = function() {
var harray = [], harrumpf = Math.floor( Math.random() * 10 + 2 );
while ( harrumpf-- ) harray.push( 'ha' );
console.log( harray.join( '' ) + '!' );
}
@jasonrhodes
jasonrhodes / post-receive.sh
Created September 6, 2014 18:13
My git post-receive hook for Digital Ocean -- I make a bare repo in /var/repos/{reponame}/app.git and then add this code to the post-receive hook in app.git/hooks then set up a remote via ssh to the app.git folder
#!/bin/sh
# Store git files in a different directory than the repo
git --work-tree=/var/www/meatspace-markov-memeify --git-dir=/var/repos/meatspace-markov-memeify/app.git checkout -f
# Install npm deps
cd /var/www/meatspace-markov-memeify && npm install
# If index.js is running, restart--otherwise start!
forever restart --spinSleepTime 10000 --minUptime 1000 /var/www/meatspace-markov-memeify/index.js --port=8000 || forever start --spinSleepTime 10000 --minUptime 1000 /var/www/meatspace-markov-memeify/index.js --port=8000

Stealing WiFi

/etc/hosts

This will let you access any google owned site. This includes: youtube, google cache, google translate, google search, gmail, google news, etc.

  • Install the HTTPS Everywhere extension
  • Add these rules to your /etc/hosts file
function fuck() {
if killall -9 "$2"; then
echo ; echo " (╯°□°)╯︵$(echo "$2"|toilet -f term -F rotate)"; echo
fi
}
@mikeal
mikeal / gist:9242748
Last active June 23, 2020 05:17
Response to Nodejitsu NPM Trademark

I've known people at nodejitsu for years, since before the company even existed. I still consider many of them friends. That said, somebody over there has lost their mind.

Trademarks are an important part of open source. They protect the integrity of the trust that is built by any project. A classic example of why this is the case is Firefox. Suppose that a malware producer takes the Firefox codebase, which is free and open source, packages up their malware with it and then releases it as "Firefox". Then they buy search advertising and suddenly their bad and malicious version of Firefox is the first result on search engines across the web. This is clearly a bad thing for Firefox and open source everywhere, but what can Mozilla do to protect their community of users?

They can't enforce a software license since the use is permitted under the Mozilla Public License. They can, however, enforce on these hypothetical bad actors using their trademark on the word "Fi

@jasonrhodes
jasonrhodes / mbp-setup.markdown
Last active December 22, 2022 17:20
Setting up my new MacBook Pro
  • Set up user account
  • Name computer
  • Check trackpad settings
  • Install Google Chrome
  • Install Homebrew http://brew.sh/
  • Brew should auto-install Xcode Developer Tools for you
  • $ brew doctor
  • $ brew install git
  • Download node.js (I prefer the installer over brew) http://nodejs.org/download/
  • npm is now installed, too
@jeremykendall
jeremykendall / example.pp
Created September 27, 2013 03:33
Changing apache user and group in /etc/apache2/envvars using sed in a puppet exec. Stolen from https://github.com/Intracto/Puppet/blob/master/apache2/manifests/init.pp#L12-L26
exec { "sed -i 's/www-data/vagrant/g' /etc/apache2/envvars":
onlyif => "/bin/grep -c 'www-data' /etc/apache2/envvars",
notify => Service['apache2'],
require => Package['apache2'],
}