Skip to content

Instantly share code, notes, and snippets.

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

Sergio Rubio rubiojr

🚀
>>>>>>>>> ⚠️ 💥 ☠️
View GitHub Profile
@rubiojr
rubiojr / patch.diff
Last active December 14, 2015 11:58
diff --git a/lib/fog/openstack/requests/network/update_router.rb b/lib/fog/openstack/requests/network/update_router.rb
index af25c77..1012030 100644
--- a/lib/fog/openstack/requests/network/update_router.rb
+++ b/lib/fog/openstack/requests/network/update_router.rb
@@ -53,20 +53,30 @@ module Fog
class Mock
def update_router(router_id, options = {})
- raise Fog::Network::OpenStack::NotFound if router_id == 0
+ router = self.data['routers'].find { |r| r['id'] == router_id }
@rubiojr
rubiojr / f.diff
Last active December 14, 2015 07:19
diff --git a/lib/fog/openstack/requests/network/create_router.rb b/lib/fog/openstack/requests/network/create_router.rb
index ca8694d..dfc8aed 100644
--- a/lib/fog/openstack/requests/network/create_router.rb
+++ b/lib/fog/openstack/requests/network/create_router.rb
@@ -39,15 +39,16 @@ module Fog
data = {
'router' => {
'status' => 'ACTIVE',
- 'external_gateway_info' => null,
+ 'external_gateway_info' => nil,
# Copyright 2012-2013 Barry Allard <[email protected]>
# 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,
@rubiojr
rubiojr / openwrt_stats.rb
Created January 13, 2013 18:44
Getting OpenWRT router stats with ruby
require 'excon'
require 'pp'
require 'yajl'
# Auth parameters
username = 'root'
password = 'secret'
host = '192.168.1.1'
# Will parse returned JSON content
parser = Yajl::Parser.new

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',
@rubiojr
rubiojr / D10apt-ftparchive-hook
Created November 26, 2012 11:46
My pbuildderrc
#!/bin/bash
# 2009-04-09 tyler - use previously built packages as an apt source
# http://blog.edseek.com/~jasonb/articles/pbuilder_backports/pbuilderbuild.html#pbuilderhook
#
# Add this hook to ~/.pbuilder-hooks/D10apt-ftparchive and make it executable
#
echo Calling $0
: ${DIST:=$(lsb_release --short --codename)}
@rubiojr
rubiojr / cia
Created November 22, 2012 19:01
Dicen las malas lenguas que los agentes de la CIA han cambiado Unity por XFCE.
Las cámaras térmicas ya no detectan el calor que desprenden sus portátiles. #burnthehouse
@rubiojr
rubiojr / gist:4026486
Created November 6, 2012 18:13
thinkpad x40 kernel config 3.7.0-rc4
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 3.7.0-rc4 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"