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
@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:
# 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 / 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 / REGEX
Last active April 11, 2018 17:51
REGEX CURP México
5[0-9]{2}[0-9]{2}[A-Z]{1}[AEIOUX]{1}[A-Z]{2}[0-9]{2}(0[1-9]|1[0-2])(0[1-9]|1[0-9]|2[0-9]|3[0-1])[HM]{1}(AS|BC|BS|CC|CS|CH|CL|CM|DF|DG|GT|GR|HG|JC|MC|MN|MS|NT|NL|OC|PL|QT|QR|SP|SL|SR|TC|TS|TL|VZ|YN|ZS|NE)[B-DF-HJ-NP-TV-Z]{3}[0-9A-Z]{1}[0-9]{1}[0-1]{1}[0-9]{2}[0-9]{1}[1-9]{1}[0-9]{3}[0-1][1-9][0-3][0-9][0-9]{3}
@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

Keybase proof

I hereby claim:

  • I am andresaquino on github.
  • I am andresaquino (https://keybase.io/andresaquino) on keybase.
  • I have a public key whose fingerprint is B3E9 BCB3 6102 30AA 2D85 0F78 0E31 EE04 39B6 E6AD

To claim this, I am signing this object: