Skip to content

Instantly share code, notes, and snippets.

View alexandregz's full-sized avatar
🎯
Focusing

Alexandre Espinosa Menor alexandregz

🎯
Focusing
View GitHub Profile
#!/bin/bash
# Based on http://jollyjinx.tumblr.com/post/34638496292/fusion-drive-on-older-macs-yes-since-apple-has
# To use this, first create a corestorage drive - see e.g. http://www.cnet.com/how-to/how-to-make-a-custom-corestorage-drive-in-os-x/
# -- it'll look something like this:
#
# diskutil list # and figure out which actual drives you want to join
# diskutil cs create FusionGroup disk0 disk2 # or whichever two drives
# diskutil cs list # and note the Logical Volume Group ID
# diskutil cs createVolume GROUPID jhfs+ Fused 100%
import argparse
import sqlite3 as lite
import os
def _open_db(db):
try:
con = lite.connect(db)
cur = con.cursor()
return (cur,con)
except lite.Error as e:
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
@alexandregz
alexandregz / brew-more.rb
Last active August 29, 2015 14:15 — forked from lwe/brew-more.rb
# Small utility which uses the homepage and nokogori to get a description from the formula's homepage.
#
# As written in the homebrew wiki:
# > Homebrew doesn’t have a description field because the homepage is always up to date,
# > and Homebrew is not. Thus it’s less maintenance for us. To satisfy the description
# > we’re going to invent a new packaging microformat and persuade everyone to publish
# > it on their homepage.
#
# Too bad no packaging microformat has yet been invented, but brew-more just first looks for a
# `<meta name="description">` tag, then for an `a#project_summary_link` tag (which is used in
<?php
// Load WordPress
require_once 'path/to/www/wp-load.php';
require_once ABSPATH . '/wp-admin/includes/taxonomy.php';
// Set the timezone so times are calculated correctly
date_default_timezone_set('Europe/London');
// Create post
<?php
//absolute path to wp-load.php, or relative to this script
//e.g., ../wp-core/wp-load.php
include( 'trunk/wp-load.php' );
//grab the WPDB database object, using WP's database
//more info: http://codex.wordpress.org/Class_Reference/wpdb
global $wpdb;
<?php
/*
Install:
1) create a folder: disablecsrf inside 'plugins/' directory.
2) place this file there and name it: disablecsrf.php
3) go to config/config.inc.php, and add it to plugins, like:
$config['plugins'] = array('disablecsrf');
CSRF should now be disabled for login.
*/
@alexandregz
alexandregz / baller_motd.md
Last active July 10, 2019 01:44 — forked from thcipriani/baller_motd.md
Using img2ponysay to create baller /etc/motd message

Creating Baller/Useful MOTD Messages

Zangief MOTD

Prerequisites

  • linux box
    • Won't compile under OSX something about illegal characters…I use have an Ubuntu server at Digital Ocean
    • If anyone gets this working on a Mac I'd love to know
  • Imagemagick

Quick install PHP 7.0 (phpng):

1. Install depends PHP 7.0 (phpng)
$ brew install autoconf automake bison27 gd freetype t1lib mariadb gettext zlib mcrypt
Add support for Bison 3.x

curl -L https://github.com/php/php-src/pull/685.diff | patch -p1

@alexandregz
alexandregz / README.md
Created December 2, 2015 07:07 — forked from Coeur/README.md
Write to NTFS on OSX Yosemite and El Capitan

Install osxfuse (3.x.x) from https://github.com/osxfuse/osxfuse/releases.

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Update Homebrew formulae:

brew update