This file contains hidden or 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
| #include <unistd.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <errno.h> | |
| #include <termios.h> | |
| #include <sys/types.h> | |
| #include <sys/time.h> | |
| #include <sys/stat.h> | |
| #include <fcntl.h> |
This file contains hidden or 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
| log_format metrics '$time_local $upstream_response_time $request_time $request_length $bytes_sent | "$request"'; | |
| access_log /var/log/nginx/traffic.log metrics; | |
| access_log logs/access.log combined; | |
| # Gives you stuff like this: | |
| 15/Sep/2010:15:28:35 -0400 0.087 0.087 1341 3619 | "GET /account HTTP/1.1" | |
| 15/Sep/2010:15:28:35 -0400 - 0.000 1315 158 | "GET /javascripts/jquery-1.4.1.min.js?1284497684 HTTP/1.1" |
This file contains hidden or 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 | |
| # | |
| # /etc/rc.d/init.d/unicorn | |
| # unicorn: This script starts and stops a unicorn app | |
| # | |
| # Author: Adrian Pike | |
| # | |
| # Source function library. | |
| . /etc/init.d/functions |
This file contains hidden or 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
| begin | |
| uid, gid = Process.euid, Process.egid | |
| user, group = 'apps', 'apps' | |
| target_uid = Etc.getpwnam(user).uid | |
| target_gid = Etc.getgrnam(group).gid | |
| worker.tmp.chown(target_uid, target_gid) | |
| if uid != target_uid || gid != target_gid | |
| Process.initgroups(user, target_gid) | |
| Process::GID.change_privilege(target_gid) | |
| Process::UID.change_privilege(target_uid) |
This file contains hidden or 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
| > 231 | |
| ---- #229 ----- | |
| From: nerd | |
| The nerd was here. | |
| Enter, or Q to stop reading. | |
| > 1 | |
| ---- #228 ----- | |
| From: briandemant | |
| this seems fun ;) | |
| could start a new era for BBS'es |
This file contains hidden or 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 'activeresource' | |
| class Team < ActiveResource::Base; self.site = "http://railsrumble.com/"; self.format = :json; end | |
| teams = [] | |
| counts = Hash.new(0) | |
| (1..6).each {|n| teams += Team.find(:all, :params => {:page => n}).collect(&:team) } | |
| teams.collect(&:entry).collect(&:resources_used).collect(&:split).flatten.each{|rn| counts[rn] += 1 } | |
| counts.sort {|a,b| b[1]<=>a[1]}.each {|k,v| |
This file contains hidden or 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
| SAMPLE_SIZE = 100 # set this | |
| i = 0 | |
| matches = {} | |
| old = " " | |
| while i < SAMPLE_SIZE | |
| begin | |
| system("stty raw -echo") |
This file contains hidden or 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 | |
| function makeRandomPassword() { | |
| $vowels = "aeiou"; | |
| $consonants = "bcdfghjklmnpqrstvwxyz"; | |
| $numbers = "0123456789"; | |
| srand((double)microtime()*1000000); | |
| $i = 0; // # of chars; | |
| $j=0; // Position. 0=consonant, 1 & 2 = vowels | |
| while ($i <= 6) { |
This file contains hidden or 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
| # This file is used by Rack-based servers to start the application. | |
| require ::File.expand_path('../config/environment', __FILE__) | |
| require 'rack' | |
| protected = Rack::Auth::Basic.new(Foobar::Application) do |username, password| | |
| 'secret' == password | |
| 'foodebiz' == username | |
| end | |
| protected.realm = 'GO AWAY PLOX' |