Skip to content

Instantly share code, notes, and snippets.

@pal
pal / Capfile
Created February 4, 2010 00:52
Complete Capistrano deployment example for a very simple PHP-site.
# Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
require 'rubygems'
require 'railsless-deploy'
load 'config/deploy'
@mxcl
mxcl / uninstall_homebrew.sh
Created August 26, 2011 11:25
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@tgunr
tgunr / gist:1389922
Created November 23, 2011 21:09
Mikrotik AppleTV tag
/ip firewall mangle
add action=mark-connection chain=prerouting comment=APPLETV disabled=no new-connection-mark=APPLETV passthrough=no \
src-address=192.168.0.249
add action=log chain=prerouting comment=APPLETV disabled=yes log-prefix=APPLETV src-mac-address=28:CF:DA:1D:13:31
add action=mark-packet chain=prerouting connection-mark=APPLETV disabled=no new-packet-mark=Data-APPLETV passthrough=no
/queue type
add kind=pcq name=LAN-PCQ pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=dst-address pcq-dst-address-mask=24 \
pcq-dst-address6-mask=128 pcq-limit=10 pcq-rate=100M pcq-src-address-mask=24 pcq-src-address6-mask=128 pcq-total-limit=1000000000
add kind=pcq name=WAN-PCQ pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=dst-address pcq-dst-address-mask=32 \
git remote add upstream [Clone Url]
git fetch upstream
git checkout master
## At this point, you have two options:
git merge upstream/master # Merge yours and theirs
git push origin master # Push back to your fork
git reset --hard upstream/master # Make yours look *exactly* like theirs, lose your changes;
@oscarcck
oscarcck / afp.conf
Created July 18, 2012 08:49
afp.conf sample for osx 10.7 lion time machine with netatalk 3.0 afpd on ubuntu 12.04
;
; Netatalk 3.x configuration file
; http://netatalk.sourceforge.net/3.0/htmldocs/afp.conf.5.html
;
[Global]
; Global server settings
vol preset = default_for_all_vol
log file = /var/log/netatalk.log
uam list = uams_dhx.so,uams_dhx2.so
@Dinnerbone
Dinnerbone / gist:3736487
Created September 17, 2012 09:49
New Minecraft target selector syntax!

Syntax

All target selectors start with @. The following character is the selector type. For example, @p means 'closest player'.

Target selectors may have additional, optional arguments. You can specify these in [ ], using the syntax a=0. For example, @p[a=0,b=5,c=-500].

There is a special short syntax for just specifying x, y, z and r arguments; simply list their values separated by a comma, without x=. For example: @p[100,64,-100,5] for 5 range, x=100, y=64 and z=-100. Each of these are optional and skippable by leaving them empty. For example, to just specify y coordinate: @p[,64].

Global Arguments:

  • x - X coordinate for search center. Default is senders coordinate, or 0.
  • y - Y coordinate for search center. Default is senders coordinate, or 0.
@sferik
sferik / install-ruby-2.0.0.sh
Created November 5, 2012 02:28
Instructions to install on Ruby 2.0.0 on Mac OS X with homebrew
#!/usr/bin/env sh
brew update
brew install rbenv
brew install ruby-build
brew install openssl
CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl` rbenv install 2.0.0-preview1
@elmariofredo
elmariofredo / Fill_mikrotik_config.bash
Last active September 6, 2023 11:25
L2TP IPSEC VPN Auto config for mikrotik based on following tutorial http://www.nasa-security.net/mikrotik/mikrotik-l2tp-with-ipsec/ !!! Edit user name/user pass and ipsec secret
# Fetch and fill config
mikrotik_vpn_config=$(curl https://gist.github.com/elmariofredo/7232556/raw/VPN-L2TP-IPSEC.mikrotik \
| sed -e '
s/IPSEC_PEER_SECRET/somesecret/g;
s/USER1_NAME/mario/g;
s/USER1_PASS/somepass/g;
s/IP_RANGE/172.16.24.100-172.16.24.200/g;
s/DNS_SERVER/172.16.22.1/g;
s/LOCAL_ADDRESS/172.16.22.1/g;
s/WINS_SERVER/172.16.22.1/g')
@albertbori
albertbori / Installation.md
Last active July 15, 2024 15:33
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges
@MiqViq
MiqViq / reposado_auto_munkiimport_aswupd_configdata_items.sh
Last active May 15, 2017 20:45
For Munki: automatically create apple_update_metadata pkginfo files for XProtectPlistConfigData, Gatekeeper Configuration Data
#!/bin/bash
# reposado_auto_munkiimport_aswupd_configdata_items
#
# automatically create apple_update_metadata pkginfo files for Munki: XProtectPlistConfigData, Gatekeeper Configuration Data
#
# path to your Munki repo (local or mounted share)
munkiRepoDir="/Users/Shared/munki/repo"