Skip to content

Instantly share code, notes, and snippets.

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

Sergio Rubio rubiojr

🚀
>>>>>>>>> ⚠️ 💥 ☠️
View GitHub Profile
@rubiojr
rubiojr / trackpoint.conf
Created February 12, 2011 19:17
Adjust Lenovo/IBM Thinkpad trackpoint (upstart service)
description "IBM/Lenovo trackpoint sentivity adjustment"
start on runlevel 2
script
SYS_FILE="/sys/devices/platform/i8042/serio1/sensitivity"
if test -f $SYS_FILE; then
sudo echo -n 200 > $SYS_FILE
else
logger "Trackpoint sensitivity couldn't be adjusted."
@nacx
nacx / massive-volume-creation.sh
Created June 28, 2011 13:59
Massive volume creation in Abiquo
#!/bin/bash
NUM=20 # The number of volumes to create
DC=2 # The datacenter where the volumes will be created
TIER=1 # The tier where the volumes will be created
VDC=4 # The virtual datacenter where the volumes will be created
SIZE=100 # The size of the volumes to create in MB
LOGIN=admin:xabiquo # The credentials
for V in `seq 1 ${NUM}`; do
@dplummer
dplummer / tcmalloc.patch
Created June 30, 2011 20:50
ree tcmalloc patch fix for glibc 2.14
diff -urB a/distro/google-perftools-1.7/src/tcmalloc.cc b/distro/google-perftools-1.7/src/tcmalloc.cc
--- a/distro/google-perftools-1.7/src/tcmalloc.cc
+++ b/distro/google-perftools-1.7/src/tcmalloc.cc
@@ -137,6 +137,13 @@
# define WIN32_DO_PATCHING 1
#endif
+// GLibc 2.14+ requires the hook functions be declared volatile, based on the value of the
+// define __MALLOC_HOOK_VOLATILE. For compatibility with older/non-GLibc implementations,
+// provide an empty definition.
@rubiojr
rubiojr / repo_feeds.txt
Created August 11, 2011 09:22
RPM Repo Feeds for Fedora/RHEL
#
# Compilation of Yum Repositories for RHEL/Fedora
#
#
# Fedora
#
http://download.fedora.redhat.com/pub/fedora/linux/releases/15/Fedora/x86_64/os, f15-x86_64, fedora-15
http://download.fedora.redhat.com/pub/fedora/linux/releases/15/Fedora/i386/os, f15-i386, fedora-15
http://download.fedora.redhat.com/pub/fedora/linux/releases/15/Fedora/source/SRPMS, f15-src, fedora-15
@rubiojr
rubiojr / playrepo-uploader.rb
Created November 17, 2011 18:24
Abiquo playrepo-uploader
#!/usr/bin/env ruby
#
# Needs ruby and rubygems installed
#
# Install deps first:
#
# apt-get install ruby rubygems
#
# gem install --no-ri --no-rdoc clamp curb diskid
#
@cpu
cpu / pushoverbooted.conf
Created May 2, 2012 14:21
Simple Upstart Script to send a PushOver notification when the machine boots.
#
# pushoverbooted service
#
# Sends a PushOver notification when the box has finished booting. To
# install, place this file in /etc/init/ You can test the service by
# running 'start pushoverbooted'
#
# You will need to replace TOKEN with the value you get upon following the
# registration process for a pushover application detailed at:
# https://pushover.net/api#registration
@rubiojr
rubiojr / pro-shell.sh
Created October 27, 2012 13:12
Unix Shell Pro-tips
# Print the config file of every package installed
for pkg in `dpkg -l|grep ii|awk '{print $2}'`;do
dpkg-query --showformat='${Conffiles}\n' --show $pkg | sed '/^$/d'
done
# dpigs - Show which installed packages occupy the most space
apt-get install debian-goodies && dpigs
@tobstarr
tobstarr / Makefile
Created July 22, 2013 10:15
Golang SSH client
default:
@go get code.google.com/p/go.crypto/ssh
go build -o bin/test_ssh_client *.go
@olov
olov / gist:eb60ab878eb73a7c5e22
Created October 15, 2014 08:55
listenandservetls_nossl30.go
// You don't want to serve HTTPS supporting for SSL3.0 any longer, see:
// http://googleonlinesecurity.blogspot.de/2014/10/this-poodle-bites-exploiting-ssl-30.html
import (
"crypto/tls"
"net/http"
)
// This code supports SSL3.0, TLS1.0, TLS1.1 and TLS1.2
// Chances are you currently do this but want to stop due to the POODLE
err := http.ListenAndServeTLS(addr, "crtfile", "keyfile", handler)