Skip to content

Instantly share code, notes, and snippets.

View rogeliodh's full-sized avatar

Rogelio Domínguez Hernández rogeliodh

  • Mexico City
  • 17:41 (UTC -06:00)
View GitHub Profile
@jordanorelli
jordanorelli / fabextras.py
Created February 19, 2012 00:00
runtime-generated fabric connection functions, yay
from fabric.api import env
import os
import string
_conf_root = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'conf')
_conf_dirs = [x for x in os.listdir(_conf_root)
if os.path.isdir(os.path.join(_conf_root, x))
and x != 'base']
def _mk_sethost_fn(host_dicts, context):

#Programming the KC60 on a Mac

  1. Download and unzip the [TKG-Toolkit][1] from Github (click on download zip on the right).
  2. Download the Mac version of [jq][2] (it will be named jq-osx-x86_64 or something similar)
    • rename the downloaded file to jq.
  3. Install dfu-programmer using [homebrew][3] brew install dfu-programmer.
  4. Go into the tkg-toolkit-master/linux/bin folder.
  5. Rename The existing jq file to jq.bak or something similar and drag in the new jq file you just downloaded.
  6. Exit the bin folder and return to the linux Folder.
  7. Open the file called reflash.sh in a text editor.
#/bin/bash
TMPDIR="./tmp-build-all"
function usage()
{
echo "Usage: $0 <build file>"
echo "Example:"
echo "$0 ../www/buildserver/builds"
exit 1
@mauvm
mauvm / gist:5de07085f3b51e117378
Created July 26, 2015 11:57
An "envsubst" alternative for replacing env variables in NGinX site configurations (for using it with Docker)
#!/bin/bash
# NOTE: Brackets are not supported and '$' in values will break the script.
mkdir /etc/nginx/sites-enabled 2> /dev/null
for file in /etc/nginx/sites-available/*.conf
do
TPL=$(cat $file)
for row in $(env)
do
<style>
.twitter-btn {
font: normal normal normal 13px/26px 'Helvetica Neue',Arial,sans-serif;
height: 28px;
border-radius: 4px;
max-width: 100%;
box-sizing: border-box;
position: relative;
background-color: #F8F8F8;
@agentphantom
agentphantom / mx_complete.csv
Last active December 31, 2021 22:06
Casos Confirmados, Defunciones, Ambulatorios, Hospitalizados e Intubados por Municipio
entidad municipio confirmados defunciones activos ambulatorios ambulatorios_fallecidos hospitalizados hospitalizados_fallecidos intubados intubados_fallecidos
Aguascalientes Aguascalientes 32906 2613 722 27150 181 5756 2432 716 569
Aguascalientes Asientos 606 48 4 478 6 128 42 20 10
Aguascalientes Calvillo 1252 34 7 1107 2 145 32 18 13
Aguascalientes Cosío 149 14 0 108 0 41 14 10 7
Aguascalientes El Llano 129 22 2 85 0 44 22 14 12
Aguascalientes Jesús María 1236 86 48 1011 12 225 74 38 24
Aguascalientes No Especificado 2 0 0 2 0 0 0 0 0
Aguascalientes Pabellón de Arteaga 1081 76 6 905 5 176 71 37 29
Aguascalientes Rincón de Romos 1003 74 4 771 3 232 71 39 28
@williamcaban
williamcaban / ocp-4.2-hugepages-1g.md
Last active July 5, 2022 13:26
Configure 1G Hugepages in OpenShift 4.2

Configure 1G Hugepages in OpenShift 4.2

Update Node Kernel Parameters

Supporting 1G hugepages requires the Kernel to support 1G Hugepages. This is done by applying a boot Kernel parameter.

  • Create a MachineConfig (MC) to apply to the Node type that will be using the 1G hugepages. The following example set 1G hugepages for all worker nodes 50-kargs-1g-hugepages.yaml:
    apiVersion: machineconfiguration.openshift.io/v1
    

kind: MachineConfig

@catatonicChimp
catatonicChimp / grocyAddMessurements.php
Last active January 23, 2023 18:03
Add messurements to grocy
<?php
$apiaccess =[
"url" => "https://grocy.yourdomain.tld/api",
"key" => ""
];
$quantity_units = [
"Cup US" => [
"name" => "Cup US",
"description" => "",
"name_plural" => "Cups US"
@rothgar
rothgar / install-tmux
Last active April 5, 2023 06:53 — forked from ekiara/how_to_install_tmux_on_centos
Install tmux 1.9 on rhel/centos 6
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
@JannieT
JannieT / dev.py
Last active April 27, 2023 14:39
Environment for scripting LibreOffice with Python
import uno
import sys
def createUnoService(id):
ctx = getContext()
return ctx.ServiceManager.createInstanceWithContext(id, ctx)
def getContext():
# get the uno component context from the PyUNO runtime
localContext = uno.getComponentContext()