Skip to content

Instantly share code, notes, and snippets.

Avatar
🎸
Working from home

Jose Diaz-Gonzalez josegonzalez

🎸
Working from home
View GitHub Profile
@josegonzalez
josegonzalez / redis_migrate.py
Created Mar 7, 2017 — forked from iserko/redis_migrate.py
A simple script to migrate all keys from one Redis to another
View redis_migrate.py
#!/usr/bin/env python
import argparse
import redis
def connect_redis(conn_dict):
conn = redis.StrictRedis(host=conn_dict['host'],
port=conn_dict['port'],
db=conn_dict['db'])
return conn
@josegonzalez
josegonzalez / access.lua
Created Dec 3, 2012
Simple lua file enabling oauth support for nginx via nginx-lua and access_by_lua.
View access.lua
- certain endpoints are always blocked
if nginx_uri == "/_access_token" or nginx_uri == "/_me" then
ngx.exit(403)
end
-- import requirements
local cjson = require "cjson"
-- setup some app-level vars
local app_id = "APP_ID"
View .gitconfig
[user]
name = MY_NAME
email = MY_EMAIL_ADDRESS
[git-tmbundle]
gitnub-path = /Applications/GitNub.app
gitx-path = /Applications/GitX.app
show-diff-check = yes
[github]
user = GITUB_USER
token = GITHUB_TOKEN
View gist:f2ed447447eaf24e8d16c699c6d9c97d
"$DOCKER_BIN" -D system info
"$DOCKER_BIN" container attach
"$DOCKER_BIN" container commit
"$DOCKER_BIN" container cp
"$DOCKER_BIN" container create
"$DOCKER_BIN" container exec
"$DOCKER_BIN" container inspect
"$DOCKER_BIN" container kill
"$DOCKER_BIN" container list
"$DOCKER_BIN" container logs
@josegonzalez
josegonzalez / nginx_release.sh
Last active Oct 11, 2019
Make an nginx release for ubuntu
View nginx_release.sh
#!/bin/bash
#####
# Builds a custom nginx
#
# RELEASE_TAGS="+your+tags+here"
# RELEASE_MAINTAINER="Your Name Here"
# RELEASE_MAINTAINER_EMAIL="hi@example.com"
# RELEASE_MESSAGE="Some message"
#
View gist:e5d7b9f4f5f7b27ccb9bcc2bd325724a
root@www-1:~# dokku mysql:create derp
Waiting for container to be ready
=====> MySQL container created: derp
=====> Container Information
Config dir: /var/lib/dokku/services/mysql/derp/config
Data dir: /var/lib/dokku/services/mysql/derp/data
Dsn: mysql://mysql:ce362a4b40b9da7b@dokku-mysql-derp:3306/derp
Exposed ports: -
Id: 239ea302762c4c4f489d2c2f3837514fb5eb3a8cbd14a76aa6eab298bc0fa722
Internal ip: 172.17.0.28
@josegonzalez
josegonzalez / category.rb
Created Aug 14, 2010
Category plugin for Jekyll
View category.rb
module Jekyll
class CategoryIndex < Page
def initialize(site, base, dir, category)
@site = site
@base = base
@dir = dir
@name = 'index.html'
self.process(@name)
self.read_yaml(File.join(base, '_layouts'), 'category_index.html')
@josegonzalez
josegonzalez / readme.md
Last active Nov 17, 2018
Example Readme for CakePHP plugins that use MIT license
View readme.md

[PLUGIN NAME] Plugin

[ONE LINE DESCRIPTION OF PROJECT]

Background

[A PARAGRAPH DESCRIBING WHY YOU BUILT THIS]

[ANOTHER PARAGRAPH DESCRIBING YOUR IMPETUS FOR RELEASING THIS]

@josegonzalez
josegonzalez / subdomain.php
Created Dec 19, 2011
subdomain component for cakephp that depends on a model
View subdomain.php
<?php
class SubdomainComponent extends Object {
var $__settings = array(
'base' => 'example.com',
'domains' => array(),
'param' => 'subdomain',
'redirect' => true,
'redirectTo' => 'http://example.com',
'model' => 'DomainPrefix',
@josegonzalez
josegonzalez / nginx-custom.rb
Created Nov 21, 2012
Customize your Nginx Installation via Homebrew
View nginx-custom.rb
require 'formula'
class NginxCustom < Formula
homepage 'http://nginx.org/'
url 'http://nginx.org/download/nginx-1.2.4.tar.gz'
sha1 'e3de0b2b82095f26e96bdb461ba36472d3e7cdda'
devel do
url 'http://nginx.org/download/nginx-1.3.8.tar.gz'
sha1 '84ff39e3f76e9f496f4e05080885e04caf472bb9'