Skip to content

Instantly share code, notes, and snippets.

View dejanr's full-sized avatar

Dejan Ranisavljević dejanr

View GitHub Profile
@dejanr
dejanr / macspoof.sh
Created June 3, 2011 20:31 — forked from latentflip/macspoof.sh
MAC Spoof on OSX
# Do these once
ifconfig en1 | grep ether > .macaddress #Save your real mac address somewhere
# Alias the airport adapter
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
# Then each time you want to change MAC address:
airport -z #disconnect but don't turn off the airport
sudo ifconfig en1 ether 00:00:00:00:00:00 #set new mac address (perhaps just increment your old one)
ifconfig en1 | grep ether #check it's actually changed
@dejanr
dejanr / vm.sh
Created November 10, 2011 15:55 — forked from un33k/vm.sh
Script to run Linux vmware image on Mac OSX in headless mode
# Start and stop headless VMs
# put this on your path as save it as vm or vm.sh.
# no need to turn your vmware on when running on Mac
# just run as vm start and it will list all the available vm images.
# then choose which one you want to start. perfect for running Linux under OSX
# in headless mode for development
# Note:, some of this script is from gist (72638254422dc741b299)
# Some rework and enhancement to make it work better and handle windows
#!/bin/bash
@dejanr
dejanr / gist:3187567
Created July 27, 2012 11:50
Clean Install – Mountain Lion OS X 10.8 DP3
@dejanr
dejanr / API.md
Created August 22, 2012 21:44 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@dejanr
dejanr / Cakefile
Created September 10, 2012 13:35 — forked from paulbjensen/Cakefile
A CoffeeScript Cakefile to generate a control deploy.coffee file for your application
fs = require 'fs'
control = require 'control'
task = control.task
task "deploy_script", "Creates a deployment script for your application", ->
appName = "appName"
serverEnvironment = "staging"
serverAddress = "myserver.com"
sshUsername = "app"
startCommand = "/etc/init.d/#{appName} start"
@dejanr
dejanr / app.js
Created May 30, 2013 09:44 — forked from johnkpaul/app.js
//in your application, rather than using window.location to get the current url
App.getLocation = function(){
return window.location.protocol + '//' + window.location.host
+ '/' + Backbone.history.options.root + Backbone.history.getFragment()
}

Installing and configuring dwm on OS X

  1. Install XQuartz (http://xquartz.macosforge.org) which is the development version of the X11.app that ships with OS X, which means it is way more up to date. I have had some weird issues with X11.app v. 2.3-something. XQuartz 2.5.0 fixed that.

  2. Install dwm from Homebrew, brew install dwm. This makes a bunch of necessary tweaks to the DWM configuration.

  3. Add the following script to $PATH, name it dwm-launch and chmod 755:

    cd ~
    

while true

Install and configure Terminator on Mac OS X

Preface

리눅스에서 쓰던 DWM+Terminator 조합을 OSX 에서도 사용하기 위해 이 문서를 작성함. Terminator에서는 Fink에서 쓰라고 권장하고 있지만, 난 homebrew를 쓰고 있었기 때문에 homebrew에서 할 수 있는 방법을 강구함.

Required

@dejanr
dejanr / Equity.md
Last active August 29, 2015 14:14 — forked from isaacsanders/Equity.md

This is a post by Joel Spolsky. The original post is linked at the bottom.

This is such a common question here and elsewhere that I will attempt to write the world's most canonical answer to this question. Hopefully in the future when someone on answers.onstartups asks how to split up the ownership of their new company, you can simply point to this answer.

The most important principle: Fairness, and the perception of fairness, is much more valuable than owning a large stake. Almost everything that can go wrong in a startup will go wrong, and one of the biggest things that can go wrong is huge, angry, shouting matches between the founders as to who worked harder, who owns more, whose idea was it anyway, etc. That is why I would always rather split a new company 50-50 with a friend than insist on owning 60% because "it was my idea," or because "I was more experienced" or anything else. Why? Because if I split the company 60-40, the company is going to fail when we argue ourselves to death. And if you ju

@dejanr
dejanr / install.sh
Created October 24, 2015 20:05 — forked from cstrahan/install.sh
Install NixOS on Hetzner(PX60-SSD)
set -x
wget http://archive.zfsonlinux.org/debian/pool/main/z/zfsonlinux/zfsonlinux_2%7Ewheezy_all.deb
dpkg -i zfsonlinux_2~wheezy_all.deb
apt-get update
apt-get install -y debian-zfs
DISK_SIZE=$(parted /dev/sda unit MB print | grep '^Disk' | sed -r 's/.* ([0-9]+)MB.*/\1/')
# Partitions