Skip to content

Instantly share code, notes, and snippets.

@pbruna
pbruna / app.js
Last active August 29, 2015 13:57
Dark StatusBar Font for iOS 7 with ionic
angular.module('myapp', ['ionic'])
.run(function() {
ionic.Platform.ready(function() {
StatusBar.styleDefault();
});
})
@pbruna
pbruna / zimbra_get_documents_folders.rb
Created October 7, 2014 19:49
Un script para obtener los archivos de un usuario de su maletín de Zimbra
require 'savon'
require 'nokogiri'
client = Savon.client do
wsdl "https://mail.example.com/service/wsdl/ZimbraUserService.wsdl"
namespaces("xmlns:urn" => "urn:zimbra", "xmlns:urn1" => "urn:zimbraAccount")
env_namespace :soapenv
namespace_identifier "urn1"
end
@pbruna
pbruna / gmail_ip_address.rb
Created December 18, 2014 14:30
Gmail IP Address: Ruby script to get the Gmail public IP adress
#!/usr/bin/env ruby
# From: https://support.google.com/a/answer/60764?hl=en
require 'resolv'
require 'pp'
DNS_SERVER = '8.8.8.8'
SPF_RECORD = "_spf.google.com"
@pbruna
pbruna / GHOST-test.sh
Created January 30, 2015 17:12
Script para revisar si un sistema es vulnerable al bug GHOST
#!/bin/bash
#Version 3
echo "Installed glibc version(s)"
rv=0
for glibc_nvr in $( rpm -q --qf '%{name}-%{version}-%{release}.%{arch}\n' glibc ); do
glibc_ver=$( echo "$glibc_nvr" | awk -F- '{ print $2 }' )
glibc_maj=$( echo "$glibc_ver" | awk -F. '{ print $1 }')
glibc_min=$( echo "$glibc_ver" | awk -F. '{ print $2 }')
@pbruna
pbruna / mbx.yml
Created April 27, 2015 09:48
mbx ansible
- name: "Ajusta sysctl net.ipv4.tcp_fin_timeout"
sysctl: name=net.ipv4.tcp_fin_timeout value=15 state=present
- name: "Ajusta sysctl net.ipv4.tcp_tw_reuse"
sysctl: name=net.ipv4.tcp_tw_reuse value=1 state=present
- name: "Ajusta sysctl net.ipv4.tcp_tw_recycle"
sysctl: name=net.ipv4.tcp_tw_reuse value=1 state=present
- name: "Ajusta IMAP segun Doc oficial"
@pbruna
pbruna / afterlogic_webmail2zimbra.rb
Last active September 15, 2015 10:10
Script to migrate contacts from Afterlogic Webmail-client to Zimbra
#!/usr/bin/env ruby
require 'active_record'
require 'csv'
require 'mysql2'
# Script to migrate contacts from http://www.afterlogic.com/webmail-client to Zimbra CS
# using only de database information
# the result for every account will be a CSV file under "OUT_DIRECTORY" like:
# result/user@domain.com.csv
@pbruna
pbruna / gist:1406907
Created November 29, 2011 22:34
Setup Proxy from CLI
networksetup -setsecurewebproxystate ethernet on
networksetup -setwebproxystate ethernet on
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/
@pbruna
pbruna / show.html.erb
Created January 19, 2012 13:03
Treequel adding to many extensions
class OrganizationalUnitsController < ApplicationController
def show
@organizational_unit = OrganizationalUnit.find(params[:id])
end
end
require 'treequel/model'
require 'treequel/model/objectclass'
#!/usr/bin/ruby
require 'treequel'
require 'treequel/model'
require 'treequel/model/objectclass'
#Treequel.log.level=Logger::DEBUG
Treequel::Model.directory = Treequel.directory(
:host => "10.211.55.5",