Skip to content

Instantly share code, notes, and snippets.

View christos's full-sized avatar

Christos Zisopoulos christos

View GitHub Profile
# Clone rails from github
git clone git://github.com/rails/rails.git ~/Desktop/rails
cd ~/Desktop/rails
# Create a 2.3.8 vanila app
git co v2.3.8
ruby ./railties/bin/rails ~/Desktop/rails2app
# Generate some models and a controller
cd ~/Desktop/rails2app
@christos
christos / gist:567537
Created September 6, 2010 21:33 — forked from zachinglis/gist:143695
Make port 80 "real life" speeds
# Make port 80 "real life" speeds
# You can also use Mongrel ports.
function slow_port {
# Set the port variable if no port inputted. Defaulted to 80 (for Passenger).
if [ -z "$1" ]
then port=80
else port=$1
fi
# Slow the ports.
Dear Christos
Hope all is well
I have a position that I feel you may be interested in. (My apologies if this email is not of relevance to you)
The role is for an international client of mine and they are looking for the following:
My client, a market leader in virtual currency monetization, are looking for a senior software developer to engineer their platform to cope with growing traffic and business requirements.Tasks include designing and developing an in-house advertising & payment platform based on Ruby on Rails and working with the other lead developers to engineer a well-designed, maintainable and performing technology platform that can cope with the continuously growing traffic and business requirements.
@christos
christos / etc-init-d-monit
Created November 10, 2010 14:29
EC2 config files
#! /bin/sh
#
# skeleton example file to build /etc/init.d/ scripts.
# This file should be used to construct scripts for /etc/init.d.
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl
@christos
christos / cache_with_comment.rb
Created December 30, 2010 12:32
Surround cached fragments with HTML comments (Rails 2.3 initalizer)
module ActionController
module Caching
module Fragments
def read_fragment_with_comment(name, options)
fragment = read_fragment_without_comment(name, options)
fragment && "\n<!-- cache-hit: #{name} -->\n#{fragment}\n<!-- /cache-hit: #{name} -->\n" || nil
end
alias_method_chain :read_fragment, :comment
#!/usr/bin/ruby -w
=begin
/***************************************************************************
* Copyright (C) 2008, Paul Lutus *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
@christos
christos / jazzfonica.rb
Created June 14, 2011 09:37
jazzfonica
#!/usr/bin/env ruby
# jazzfonica.rb for Mac OS X
# Scans the visible networks for JAZZTEL_XXXX or WLAN_XXXX and calculates the password
# Ported from PHP example at http://kz.ath.cx/wlan/codigo.txt
# Download and execute with ruby (e.g. ruby jazzfonica.rb) from a Terminal
require 'digest/md5'
messages = []
unless !File.exists?('/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport')
@christos
christos / profile_options_for_select.rb
Created July 27, 2011 13:59
Profile testing options_for_select
require 'rubygems'
require 'thread'
require 'rails/all'
require 'benchmark'
include ActionView::Helpers::FormOptionsHelper
puts "Using #{`ruby -v`}"
@choices = 700.times.collect { [(0...50).map{ ('a'..'z').to_a[rand(26)] }.join, rand(10000)] }
curl "https://raw.github.com/gist/1386087/2f757de4b575a632acc3d59c1224e2134ef7973c/ssh-copy-id" -o ~/bin/ssh-copy-id
chmod +x ~/bin/ssh-copy-id
@christos
christos / monit.conf
Created December 17, 2011 22:22 — forked from shapeshed/monit.conf
Upstart script for monit on Ubuntu 10.04
# This is an event.d (upstart) script to keep monit running.
# To install disable the old way of doing things:
#
# /etc/init.d/monit stop && update-rc.d -f monit remove
#
# then put this script here:
#
# /etc/init/monit.conf
#
# and reload upstart configuration: