This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'digest' | |
require 'forwardable' | |
module CompStat | |
SAMPLE_SIZE = 92 #128 | |
FIELD_SPLIT = "\t\t" | |
class File |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
############################# | |
#### MySQL Backup Script #### | |
############################# | |
########## CONFIG ########### | |
OUTPUT_FOLDER="/home/server/DBbackup" | |
ROOT_USER="root" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Diaspora::Federated::Base::InstanceMethods | |
alias_method :old_to_diaspora_xml, :to_diaspora_xml | |
def to_diaspora_xml | |
filename = tmp_dump_path.join("#{self.class.name}.xml") | |
File.open(filename, 'a') { |file| file.write(to_xml.to_s) } | |
old_to_diaspora_xml | |
end | |
def tmp_dump_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# this script installs rvm with the most recent stable version of ruby | |
# and makes sure it is not run as root, | |
# based on my earlier attempt for a general purpose root avoidance | |
# https://gist.github.com/3930399 | |
# the command we'll be running | |
export RVM_CMD="curl -L https://get.rvm.io | bash -s stable" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
----------------------------------------------------------------------------- | |
### NOTICE -- This gist is obsolete! | |
If you still want to try out the style, just sign into the wiki, go to | |
your user preferences under [Appearance] and check the box in the bottom | |
that says "Enable experimental Diaspora-specific modifications". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# Don't allow a given command to be run as root. | |
# This script will output an error message, in case the current | |
# user is identified as root (also works in case of 'sudo') | |
# do we have color ? | |
case "$TERM" in | |
xterm*|rxvt*) | |
read -r red RED blue BLUE cyan CYAN NC <<EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
gem 'selenium-webdriver' | |
gem 'rmagick' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::import('Lib', 'TiTestFixture'); | |
/** | |
* do some magic to make testing more fun | |
* @author Florian Staudacher | |
*/ | |
abstract class TiTestCase extends CakeTestCase { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ifconfig -a | grep -A 3 ^eth | sed -n -e ' | |
# add first line to hold space | |
1h | |
# add all other lines to hold space | |
1!H | |
${ | |
# write hold space to pattern space | |
g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "bundler" | |
dia = '/home/florian/src/diaspora' | |
Dir.chdir dia | |
def allm obj | |
obj.methods.sort.each { |m| | |
puts m | |
} |