Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
>>>>>>>>> ⚠️ 💥 ☠️

Sergio Rubio rubiojr

🚀
>>>>>>>>> ⚠️ 💥 ☠️
View GitHub Profile
@rubiojr
rubiojr / weekly-news-archiver.sh
Last active Dec 20, 2015
#ruby #python #raspberrypi #devops
View weekly-news-archiver.sh
#!/bin/bash
#
# Needs wget and wkpdf
#
# Python Weekly News
FIRST=1
LAST=81
BASE_URL=http://www.pythonweekly.com/archive/
mkdir pwn
@rubiojr
rubiojr / s3put
Created May 31, 2013 — forked from mattbillenstein/s3put
s3put #s3 #python
View s3put
#!/usr/bin/env python
import gevent.monkey
gevent.monkey.patch_all()
import boto
import config
import gevent
import gevent.pool
import os
View 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 / putbench.py
Last active Dec 17, 2015
putbench.py
View putbench.py
import swift.common.utils
import StringIO
import pprint
import random
import sys, os
import requests
from commandr import command, Run
from gevent import monkey
monkey.patch_all()
@rubiojr
rubiojr / proxy.rb
Created May 16, 2013 — forked from torsten/proxy.rb
proxy.rb
View 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'
View volume_tests.diff
diff --git a/tests/openstack/requests/compute/volume_tests.rb b/tests/openstack/requests/compute/volume_tests.rb
index e08755e..c674904 100644
--- a/tests/openstack/requests/compute/volume_tests.rb
+++ b/tests/openstack/requests/compute/volume_tests.rb
@@ -4,20 +4,21 @@ Shindo.tests('Fog::Compute[:openstack] | volume requests', ['openstack']) do
@volume_format = {
'id' => String,
- 'name' => String,
+ 'displayName' => String,
View git-remove-history.sh
#!/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/
#
View patch.diff
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 }
View f.diff
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,
View password.rb
# 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,