Skip to content

Instantly share code, notes, and snippets.

View rubiojr's full-sized avatar
🚀
>>>>>>>>> ⚠️ 💥 ☠️

Sergio Rubio rubiojr

🚀
>>>>>>>>> ⚠️ 💥 ☠️
View GitHub Profile
@rubiojr
rubiojr / proxy.rb
Last active October 29, 2015 11:39 — forked from torsten/proxy.rb
#!/usr/bin/env ruby
# A quick and dirty implementation of an HTTP proxy server in Ruby
# because I did not want to install anything.
#
# Copyright (C) 2009-2014 Torsten Becker <torsten.becker@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,

old arch

[9581][rubiojr.napoleon] ruby -rubygems g.rb 
      user     system      total        real
connection:      0.020000   0.010000   0.030000 (  7.400721)
create 10 images:  0.060000   0.020000   0.080000 ( 71.725848)
list images:     0.000000   0.000000   0.000000 (  0.000057)
destroy images:  0.030000   0.010000   0.040000 ( 99.656857)
require 'fog'
require 'pp'
require 'benchmark'
conn = nil
Benchmark.bm do |x|
x.report 'connection:'.ljust(15) do
conn = Fog::Image.new({
:provider => 'OpenStack',
# Copyright 2012-2013 Barry Allard <barry.allard@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
#
# retrieved from: http://dound.com/2009/04/git-forever-remove-files-or-folders-from-history/
#
@rubiojr
rubiojr / reload_iptables.sh
Created May 29, 2013 12:07 — forked from eqhmcow/reload_iptables.sh
reload_iptables.sh
IPTABLES=iptables
IPV=${IPTABLES%tables} # ip for ipv4 | ip6 for ipv6
PROC_IPTABLES_NAMES=/proc/net/${IPV}_tables_names
/sbin/modprobe --version 2>&1 | grep -q module-init-tools \
&& NEW_MODUTILS=1 \
|| NEW_MODUTILS=0
# Do not stop if iptables module is not loaded.
[ -e "$PROC_IPTABLES_NAMES" ] || exit 1
@rubiojr
rubiojr / s3put
Created May 31, 2013 06:45 — forked from mattbillenstein/s3put
s3put #s3 #python
#!/usr/bin/env python
import gevent.monkey
gevent.monkey.patch_all()
import boto
import config
import gevent
import gevent.pool
import os
@rubiojr
rubiojr / proxy.rb
Created May 16, 2013 17:19 — forked from torsten/proxy.rb
proxy.rb
#!/usr/bin/env ruby
# A quick and dirty implementation of an HTTP proxy server in Ruby
# because I did not want to install anything.
#
# Copyright (C) 2009 Torsten Becker <torsten.becker@gmail.com>
require 'socket'
require 'uri'