Skip to content

Instantly share code, notes, and snippets.

View jjuarez's full-sized avatar
🛠️
Fixing almost everything

Javier Juarez jjuarez

🛠️
Fixing almost everything
View GitHub Profile
@jjuarez
jjuarez / Things from Ruby OSA
Created December 28, 2009 16:50
Thinks, list os pending task
#
# Lists of pending task rude way !!!
#
require 'rubygems'
require 'rbosa'
things = OSA.app( 'Things' ).to_dos.find_all { |task| puts( task.name ) }
require 'rubygems'
require 'rest_client'
require 'json'
require 'pp'
url="http://bit.ly/6wS8Td"
pp JSON.parse( RestClient.get( "http://api.tweetmeme.com/url_info.json?url=#{url}" ) )
require 'rubygems'
require 'rest_client'
require 'json'
require 'pp'
module Tweetmeme
BASE_URL="http://api.tweetmeme.com/url_info.json"
@jjuarez
jjuarez / nginx_control_script.sh
Created May 19, 2010 22:01
nginx service script
#!/bin/sh
NGINX_BASE_DIR="/opt/nginx"
NGINX_DAEMON="${NGINX_BASE_DIR}/sbin/nginx"
NGINX_CONF="${NGINX_BASE_DIR}/conf/nginx.conf"
__launch_signal( ) {
${NGINX_DAEMON} -s ${1} &>/dev/null
}
port list installed|grep -v active|xargs sudo ports uninstall
@jjuarez
jjuarez / Wifi password recovery
Created March 8, 2011 22:33
A simple "Mac" utility for WLAN and JAZZTELL Wifi networks
#!/usr/bin/env ruby -W0
#
# See this article first: http://bit.ly/fKcVTR
#
require 'digest/md5'
if( __FILE__ == $0 )
`airport --scan`.each_line do |line|
@jjuarez
jjuarez / Ohai Server
Created March 21, 2011 17:41
A minimal Ohai+Rack server
require 'rubygems'
require 'rack'
require 'ohai'
class OhaiRack
def initialize()
@o = Ohai::System.new
@o.all_plugins
end
@jjuarez
jjuarez / readline_example.rb
Created March 30, 2011 09:04
Readline Example
require 'readline'
stty_save = `stty -g`.chomp
trap('INT') { system('stty', stty_save); exit }
LIST = [
'search',
'download',
'open',
@jjuarez
jjuarez / Torquebox RVM environment
Created July 15, 2011 06:37
Set Torquebox environment with rvm
# vim:sh
JRUBY_VERSION=${1:-"1.6.3"}
TORQUEBOX_GEMSET="torquebox"
RUBIES_BASE=${HOME}/.rvm/rubies
##
# Set the Torquebox environment
#
set_torquebox_environment() {
@jjuarez
jjuarez / dropquest2012Chp1
Created May 15, 2012 11:11
Dropbox Drop Quest 2012 Chapter1 help
#!/usr/bin/env ruby
module DropQuest2012
class Console
def self.get_values(*messages)
values = {}
messages.each do |message|