Skip to content

Instantly share code, notes, and snippets.

View andresaquino's full-sized avatar
🏠
Working from home

Andrés Aquino andresaquino

🏠
Working from home
View GitHub Profile
# triggered when a client connection is established
when HTTP_REQUEST {
# Is client IP address defined in the dg-mobilenetwork?
if { [ class match [IP::client_addr] equals $static::DGMobileNetwork ] } {
# Log accepted request
if { $static::AclNetworkDebug > 0 } {
log local0. " Client | [IP::client_addr]:[TCP::client_port] "
log local0. " Host | [HTTP::host] "
@andresaquino
andresaquino / gist:708323
Created November 21, 2010 01:08
Update two or more repositories...
#I update github and gitorious (mi principal trunk is in gitorious)
# w/GitHub
git remote add github git@github.com:username/project.git
# w/Gitorious
git remote add gitorious git@gitorious.org:username/project.git
# and updating
@andresaquino
andresaquino / gist:712513
Last active September 24, 2015 07:27
Integration
# Check out a new branch for integration
git checkout -b integration
# Fetch the merge request into this branch
git pull git://gitorious.org/dpsync/mainline.git refs/merge-requests/1
# Show the commits, assess they are okay
git log --pretty=oneline --abbrev-commit master..integration
# To apply the changes to your master branch:
@andresaquino
andresaquino / ssl.thor
Created April 13, 2016 04:24 — forked from grantr/ssl.thor
ssl cert generation with thor and openssl (ruby 1.9)
# Step 1: gem install thor
# Step 2: thor ssl:generate_ca && thor ssl:generate_cert
require 'thor'
require 'securerandom'
class SSL < Thor
desc "generate_ca", "Generate a Root CA"
method_option :name, type: :string, desc: "Common name"
@andresaquino
andresaquino / gist:36835e0fd87fb5c5cff587ba76a28bc5
Created May 27, 2016 06:52 — forked from unnitallman/gist:944011
sqlite with activerecord outside rails
require 'active_record'
ActiveRecord::Base.logger = Logger.new(STDERR)
ActiveRecord::Base.colorize_logging = false
ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
:dbfile => ":memory:"
)
@andresaquino
andresaquino / hashquiz.rb
Created June 28, 2016 22:42 — forked from potatosalad/hashquiz.rb
Ruby quiz for convert hash "dot paths" into actual hash hierarchy.
#require 'rubygems'
require 'pp'
#require 'ap' # Awesome Print
class Object
# expects [ [ symbol, *args ], ... ]
def recursive_send(*args)
args.inject(self) { |obj, m| obj.send(m.shift, *m) }
end
end
@andresaquino
andresaquino / magento installation script
Created August 24, 2016 18:27 — forked from asimsikka/magento installation script
Installing Magento 1.8.1.0 on Mac OsX 10.8 & 10.9 Note: Make sure you have already installed the following: 1- php 2- php mcrypt extension 3- mysql
cd ~/Downloads
curl -O http://www.magentocommerce.com/downloads/assets/1.8.1.0/magento-1.8.1.0.tar.gz
curl -O http://www.magentocommerce.com/downloads/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz
tar -zxvf magento-1.8.1.0.tar.gz
mv ~/Downloads/magento-1.8.1.0 ~/Sites/magento
tar -zxvf magento-sample-data-1.6.1.0.tar.gz
mv magento-sample-data-1.6.1.0/media/* ~/Sites/magento/media/
mv magento-sample-data-1.6.1.0/magento_sample_data_for_1.6.1.0.sql ~/Sites/magento/data.sql
cd ~/Sites
mv magento/* magento/.htaccess magento
@andresaquino
andresaquino / homebrew.mxcl.pdnsd.plist
Created December 27, 2016 11:06 — forked from fujimogn/homebrew.mxcl.pdnsd.plist
Installing pdnsd from Homebrew

Installing pdnsd from homebrew as root user.

$ brew install pdnsd

$ sudo chown -R nobody /usr/local/var/cache/pdnsd

$ curl -L http://goo.gl/kMlyQ -o pdnsd.conf
$ mv pdnsd.conf /usr/local/etc
$ sudo chown root /usr/local/etc/pdnsd.conf
@andresaquino
andresaquino / theme.html
Created September 24, 2017 08:27 — forked from soemarko/theme.html
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
@andresaquino
andresaquino / pkcs12-test-01
Created December 27, 2017 08:42
pkcs12-test-01
$> openssl pkcs12 -in uat-domain-br.pfx -nocerts
Enter Import Password:
MAC verified OK
Bag Attributes
localKeyID: 41 D4 48 C4 1D 3E 50 FE CA 9E 8A 2F BF 10 A5 A7 4B BE 20 88
friendlyName: uat-domain-br
Key Attributes:
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
-----BEGIN ENCRYPTED PRIVATE KEY-----