Skip to content

Instantly share code, notes, and snippets.

View fpauser's full-sized avatar

Falk Pauser fpauser

View GitHub Profile
@fpauser
fpauser / rbenv-install-system-wide.sh
Last active December 30, 2020 21:53 — forked from jnx/rbenv-install-system-wide.sh
rbenv single & system-wide installation for Debian (tested with Debian 7.1) & Ubuntu (tested with Ubuntu 12.04 LTS)
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone https://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
#!/bin/bash
# Ubuntu/Debian rbenv system wide installation script
# Forked from https://gist.github.com/1237417
# Installs rbenv system wide on Debian/Ubuntu, also allows single user installs.
# Install pre-requirements
apt-get install build-essential git-core \
bison openssl libssl-dev libreadline6 libreadline6-dev \
@fpauser
fpauser / tree_output.txt
Created October 17, 2012 07:44
Ember Application structure
$ tree
.
├── app.js
├── controllers
│   ├── administration_controller.js
│   ├── application_controller.js
│   ├── diagram
│   │   └── diagram_controller.js
│   ├── documents_controller.js
│   ├── layout
@fpauser
fpauser / index.html
Created June 18, 2012 11:29
Ember.Router
<!doctype html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<script type='text/javascript' src="http://cloud.github.com/downloads/wycats/handlebars.js/handlebars-1.0.0.beta.6.js"></script>
<script type='text/javascript' src="http://cloud.github.com/downloads/emberjs/ember.js/ember-latest.js"></script>
</head><body>
<script type="text/x-handlebars" data-template-name="application">
<h1>Application</h1>
<a href="#/dashboard">Dashboard</a>
@fpauser
fpauser / create_view_test.rb
Created June 4, 2012 08:26
Add custom migration methods to rails
class CreateViewTest < ActiveRecord::Migration
def up
create_view_or_table :view_test do
view_column :select => "#{source_db}.dbo.Config.value", :as => :config_value, :type => :integer
view_sql "FROM #{source_db}.dbo.Config"
end
end
@fpauser
fpauser / README.txt
Created February 2, 2012 12:36
Rails, VLAD, RVM, SUDO
For a working sudo in a non-interactive ssh session:
1. Copy askpass to $HOME/bin/askpass & make it executeable (chmod +x $HOME/bin/askpass)
2. Change your deploy.rb to setup the SUDO_ASKPASS environment variable (see man sudo)
Credits: http://serverfault.com/questions/307366/error-deploying-app-with-vlad-running-a-sudo-command-to-ubuntu-server
@fpauser
fpauser / remove_crap_from_google_news.js
Created December 9, 2010 10:27
Remove annoying crap from news.google.de. Needs our beloved jQuery ;)
// remove crappy contents from news.google.de
$("div.source, span.source").filter(function() { return /(BILD|WELT ONLINE)/.test( $(this).text() ) }).parent().fadeOut();
$("h2.title > a").filter(function() { return /.*(welt.de|bild.de).*/.test( $(this).attr('href') ) } ).parents("div.story").fadeOut();
@fpauser
fpauser / Dumple
Created November 8, 2010 12:45 — forked from bouchard/Dumple
#!/usr/bin/env ruby
## Modified from Gem Session's Dumple, available at:
## http://gem-session.com/2010/07/dumping-database-from-within-rails-project
fail_gently = ARGV.include?("--fail-gently")
gzip = ARGV.include?("--compress")
if ARGV.include?("-i")
puts "*******************************************************"
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
$ gem install mysql2 --debug
Exception `NameError' at /home/fpauser/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:164 - uninitialized constant Gem::Commands::InstallCommand
Exception `NoMethodError' at /home/fpauser/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/rational.rb:78 - undefined method `gcd' for Rational(1, 2):Rational
Exception `Gem::LoadError' at /home/fpauser/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems.rb:779 - Could not find RubyGem test-unit (>= 0)
Exception `Gem::LoadError' at /home/fpauser/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems.rb:779 - Could not find RubyGem sources (> 0.0.1)
Exception `IOError' at /home/fpauser/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/format.rb:50 - closed stream
Exception `Errno::EEXIST' at /home/fpauser/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/fileutils.rb:243 - File exists - /home/fpauser/.rvm/gems/ruby-1.8.7-p302
Exception `Errno::EEXIST' at /home/fpauser/.rvm/rubies/ruby-1.8.7-p302/lib