Skip to content

Instantly share code, notes, and snippets.

View fnordfish's full-sized avatar

Robert Schulze fnordfish

View GitHub Profile
@fnordfish
fnordfish / svn_find_externals.sh
Created June 28, 2010 10:25
Simple Bash-Script to recursive search a svn working copy for directories using externals
#/bin/bash
# This script searches a SVN working copy for all directories having externals
start_dir=.
if [ $1 ]; then
start_dir=$1
fi
for f in $( find $start_dir -type d | grep -v .svn )
do
@fnordfish
fnordfish / nginx-site
Created October 18, 2010 20:23
nginx vhost config for php using php-fpm
server {
listen 80;
server_name localhost;
access_log /var/log/nginx/localhost.access.log;
root /var/www/MyAgaviApp/pub/;
## Default location
location / {
fastcgi_pass backend;
@fnordfish
fnordfish / Vagrantfile.pkg
Created October 26, 2010 16:18
A Vagrant system implementation for gentoo based linux
require File.expand_path("./gentoo.rb", File.dirname(__FILE__))
Vagrant::Config.run do |config|
config.vm.system = Gentoo
end
/**
* jQuery is needed for calculating screen-size and events only!
* this is a stub only!
* assumes <canvas id="screen">
*/
jQuery.noConflict();
jQuery(document).ready(function (j)
{
var currentImage;
var screenCanvas = document.getElementById('screen');
@fnordfish
fnordfish / config.rb
Created January 31, 2012 10:05
Educated guess the VBGuest.iso
def autodetect_iso!
if !@iso_path
iso_path = if Vagrant::Util::Platform.linux?
"/usr/share/virtualbox/VBoxGuestAdditions.iso"
elsif Vagrant::Util::Platform.darwin?
"/Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso"
elsif Vagrant::Util::Platform.windows?
"%PROGRAMFILES%/VirtualBox/VBoxGuestAdditions.iso"
@fnordfish
fnordfish / lib_vagrant_plugin_v1.rb.patch
Created April 25, 2012 16:21
Register a middleware action from within a plugin
index 0b10045..be73523 100644
--- a/lib/vagrant/plugin/v1.rb
+++ b/lib/vagrant/plugin/v1.rb
@@ -114,6 +114,10 @@ module Vagrant
data[:provisioners]
end
+ def self.action(stack, &block)
+ Vagrant.actions[stack.to_sym].instance_eval(&block)
+ end
@fnordfish
fnordfish / gist:3893662
Created October 15, 2012 17:07
Automounting Vagrant boxes in Mac OS 10.8

(Inspired by http://yourmacguy.wordpress.com/2012/06/29/osx-automount/)

Preface:

  • I have a lot of vagrant projects
  • Each of them provides an NFS-Server exporting /home/vagrant
  • Since Mac OS 10.8 the handy "NFS Mounts" from Disk Util are gone
  • I'd like a single place, in which I could copy'n'paste a config for a new box and/or comment a box (when I don't need it for some time)
  • I'd like to make this a vagrant plugin
  • Ideally, the mount will be activated/deactivated when starting/suspending a box
@fnordfish
fnordfish / gist:4171958
Created November 29, 2012 21:12
Vagrant up with vbguest 0.5.0
vagrant up
[foo] Importing base box 'lucid64'...
[foo] The guest additions on this VM do not match the install version of
VirtualBox! This may cause things such as forwarded ports, shared
folders, and more to not work properly. If any of those things fail on
this machine, please update the guest additions and repackage the
box.
Guest Additions Version: 4.1.0
VirtualBox Version: 4.2.4
@fnordfish
fnordfish / auto_locale.rb
Created December 10, 2012 10:39
Padrino Autolocale with "smart" redirect to default locale
module Padrino
module Contrib
##
# This extension give to padrino the ability to change
# their locale inspecting.
#
# ==== Usage
#
# class MyApp < Padrino::Application
# register AutoLocale
@fnordfish
fnordfish / gist:4259106
Created December 11, 2012 14:54
SEO-URL-bullshit gets redirected to correct SEO-bullshit
curl --head 'http://nachrichten.t-online.de/ueberschrift-asd-asd-asd-asd/id_61288224/index'
HTTP/1.1 301 Moved Permanently
Location: http://nachrichten.t-online.de/ueberschrift-lorem-ipsum-dolos-et/id_61288224/index