brew install redis
Set up launchctl to auto start redis
$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
/usr/local/opt/redis/ is a symlink to /usr/local/Cellar/redis/x.y.z (e.g., 2.8.7)
| # config/initializers/xml_parser.rb | |
| # There are multiple weaknesses in the parameter parsing code for Ruby on Rails which | |
| # allows attackers to bypass authentication systems, inject arbitrary SQL, inject | |
| # and execute arbitrary code, or perform a DoS attack on a Rails application. | |
| # | |
| #This vulnerability has been assigned the CVE identifier CVE-2013-0156. | |
| # https://groups.google.com/forum/?fromgroups=#!topic/rubyonrails-security/61bkgvnSGTQ | |
| # |
| wget http://garr.dl.sourceforge.net/sourceforge/sysbench/sysbench-0.4.12.tar.gz | |
| cd sysbench-0.4.12 | |
| libtoolize --force --copy | |
| ./autogen.sh | |
| ./configure | |
| make | |
| sudo make install | |
| mysql -u root -e "create database sbtest;" |
| #!/bin/bash | |
| # iptables configuration script | |
| # Flush all current rules from iptables | |
| iptables -F | |
| # Allow SSH connections on tcp port 2222 | |
| iptables -A INPUT -p tcp --dport 2222 -j ACCEPT |
| #!/usr/bin/perl | |
| use 5.008; | |
| use strict; | |
| use Memoize; | |
| # usage: | |
| # git-large-files 500k | |
| # git-large-files 0.5m | |
| # git-large-files 5b |
| #!/bin/bash | |
| # Usage: | |
| # ./git-truncate.sh SHA1 | |
| # Removes all the history prior to commit "SHA1" | |
| git checkout --orphan temp $1 | |
| git commit -m "Truncated history of git repo" | |
| git rebase --onto temp $1 master | |
| git branch -D temp |
| #! /usr/bin/ruby | |
| # Git before-update hook | |
| def check_uncommitted_changes | |
| diff_paths = `git diff-index --name-only HEAD`.split("\n") | |
| diff_stats = `git diff-index --stat HEAD`.split("\n").join("\n ") | |
| error_msg = %( | |
| [GIT POLICY: DIRTY WORKING COPY] |
| <?php | |
| // | |
| add_action('tribe_events_before_view','tribe_custom_fields_meta'); | |
| function tribe_custom_fields_meta(){ | |
| global $post; | |
| // force this to run only on single event views | |
| if( is_single() && tribe_is_event( $post->ID ) ){ | |
| if( tribe_is_recurring_event( tribe_is_recurring_event( $post->ID ) ) ) { | |
| tribe_register_meta( 'tribe_custom_fields_vaa', array( |
| <?php | |
| // add custom venue meta items | |
| add_action('tribe_events_before_view','custom_venue_info'); | |
| function custom_venue_info(){ | |
| global $post; | |
| // force this to run only on single event views | |
| if( is_single() && tribe_is_event( $post->ID ) ){ | |
| $room = get_post_meta( $post->ID, '_VenueRoom', true ); | |
| tribe_register_meta( 'tribe_venue_room', array( |
| upstream calc_example_org_upstream { | |
| server 127.0.0.1:8005; | |
| #server 127.0.0.1:8006; | |
| #keepalive 64; | |
| } | |
| server { | |
| listen 80; | |
| server_name www.calc.example.org; |