Skip to content

Instantly share code, notes, and snippets.

Mauricio Leyzaola mauleyzaola

Block or report user

Report or block mauleyzaola

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mauleyzaola
mauleyzaola / conky.conf
Created Mar 17, 2020 — forked from abbotto/conky.conf
Conky settings for Linux
View conky.conf
-- vim: ts=4 sw=4 noet ai cindent syntax=lua
conky.config = {
-- General settings
alignment = 'top_right',
background = true,
border_width = 1,
cpu_avg_samples = 2,
default_color = 'white',
default_outline_color = '#555',
@mauleyzaola
mauleyzaola / serve.go
Created Oct 21, 2018 — forked from paulmach/serve.go
Simple Static File Server in Go
View serve.go
/*
Serve is a very simple static file server in go
Usage:
-p="8100": port to serve on
-d=".": the directory of static files to host
Navigating to http://localhost:8100 will display the index.html or directory
listing file.
*/
package main
View golang-date-formats.txt
1609-09-12 19:02:35 PM +03:00 Sep Sat PDT
--------------- + ------------ + ------------
Type | Placeholder | Value
--------------- + ------------ + ------------
Year | 2006 | 1609
Year | 06 | 09
Month | 01 | 09
Month | 1 | 9
Month | Jan | Sep
Month | January | September
View stdin-cap.sh
#!/bin/bash
# Usage
# /bin/bash -c 'for p in {0..18}; do ./stdin-cap.sh $((2 ** $p)) 0.5; done'
test $# -ge 1 || { echo "usage: $0 write-size [wait-time]"; exit 1; }
test $# -ge 2 || set -- "$@" 1
bytes_written=$(
{
exec 3>&1
@mauleyzaola
mauleyzaola / MySQL_5-7_macOS.md
Created Sep 12, 2018 — forked from operatino/MySQL_5-7_macOS.md
Install MySQL 5.7 on macOS using Homebrew
View MySQL_5-7_macOS.md

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@mauleyzaola
mauleyzaola / rabbitmq_conf_homebrew
Created Aug 16, 2018 — forked from robcowie/rabbitmq_conf_homebrew
Location of rabbitmq config files with homebrew
View rabbitmq_conf_homebrew
Rabbitmq conf locations for homebrew
/usr/local/etc/rabbitmq/rabbitmq-env.conf
/usr/local/etc/rabbitmq/rabbitmq
View pg_count_all_table_rows.sh
#!/bin/bash
# this script will count all the rows for every table in postgres database
# the first argument is the database name
# usage:
# ./pg_count_all_table_rows.sh mydb
#
# Make sure the file has execution rights
# chmod +x pg_count_all_table_rows.sh
if [ -z "$1" ];then
View gist:cc6d80db3d8f5fc86a28e48b12f0e62e
func openbrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
@mauleyzaola
mauleyzaola / git-log2json.sh
Created Aug 9, 2018 — forked from textarcana/git-log2json.sh
Convert Git logs to JSON. The first script (git-log2json.sh) is all you need, the other two files contain only optional bonus features :) UPDATED 2017: Today I would just use https://github.com/tarmstrong/git2json
View git-log2json.sh
#!/usr/bin/env bash
# Use this one-liner to produce a JSON literal from the Git log:
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'
You can’t perform that action at this time.