Skip to content

Instantly share code, notes, and snippets.

View dvdvck's full-sized avatar

David Retana dvdvck

View GitHub Profile
@dvdvck
dvdvck / gitcmd_overload.md
Last active August 29, 2015 13:57
git log vs git reflog

Why does git have such particular trick in his command line?

Today, by typing these two commands:

git log --oneline --walk-reflogs

and

git reflog
@dvdvck
dvdvck / causes.md
Last active August 29, 2015 13:57
An idea of how to split up some files in order to create a new repo

##Split some files out of repo keeping his history

In order to promote a subset of files to make an external library/module which will be contained by some package manager like npm.

This enable the reuse of this module in another repo using a package manager

@dvdvck
dvdvck / setDate.sh
Created April 4, 2014 20:53
Push date far away by 10 sec
ssh root@10.0.0.2 "date -s @$((`date +%s` + 10))"
@dvdvck
dvdvck / matrixled.c
Created April 10, 2014 22:41
por qué fineOffset es vólatil?
void signaling(){
static char unsigned line = 0;
//porque es volatil fineoffset?
char unsigned col, coarseOffset;
char unsigned volatile fineOffset;
unsigned char data_r1, data_r2;
//scanning 1/16
col = (COLUMNS >> 3) - 1;
do{ //cols
@dvdvck
dvdvck / tmp_npm.sh
Last active August 29, 2015 14:00 — forked from kevinastone/tmp_npm.sh
#!/bin/bash
BASE_DIR=${TMPDIR:-/var/tmp}
ORIG_DIR=$PWD
HASH_CMD="md5sum"
DIR_NAME=`echo $PWD | $HASH_CMD | cut -f1 -d " "`
TMP_DIR=$BASE_DIR/$DIR_NAME
mkdir -p $TMP_DIR
@dvdvck
dvdvck / encode.sh
Created July 17, 2014 11:01
h264 converter
#!/bin/bash
#recodifica a un formato que ocupe menos espacio en disco
#se utiliza el encoder h6264 para video. Este encoder automaticamente
#coloca el bitrate segun sus algoritmos. Resultando ~515kbps
#se utiliza el encoder vorbis para audio (default). De igual forma
#el bit rate es calculado a partir del sampleo. Para 24kHz se tiene ~66kbps
#Contenedor matroska que me parece fabuloso
#
#Ejecutarlo justo en la raiz de los directorios que contiene los videos
@dvdvck
dvdvck / subprocess.sh
Last active August 29, 2015 14:16
subprocess basic control job
#!/bin/bash
#Lanza subprocesos en segundo plano, manteniendo un umbral de almenos
#4 procesos en paralelo.
todo=15
echo "`date +%M:%S` Starting PARENT $$ BASHPID: $BASHPID"
while [ $todo -gt 0 ]; do
@dvdvck
dvdvck / post-receive
Created June 11, 2015 17:42
git hook
#!/usr/bin/env bash
#Actualiza el servidor de produccion con el merge realizado
#en la rama release
#La informacion se sincroniza con rsync para no tener un repositorio
#en el servidor. NO. Se necesita hacer una copia local. no tiene sentido
#Hacer un puente con ssh y luego ejecutar git pull en el servidor
@dvdvck
dvdvck / runme.sh
Created January 12, 2013 05:01
Siguiendo el método que uso el autor del post[1] para realizar root en el celular ZTE-V856, esta es la versión para linux de runme.bat [1] http://www.taringa.net/posts/celulares/16004986/_Quieres-rootear-tu-celular-android_--_-entra-aqui.html
#!/usr/bin/env sh
# This file was ported to shell executable from runme.bat
# Autor David Retana
# Date 01-2013
cat <<-EOF
---------------------------------------------------------------
Easy rooting toolkit (v3.0)
created by DooMLoRD
using exploit zergRush (Revolutionary Team)
@dvdvck
dvdvck / slurp.sh
Created September 21, 2016 13:38
Consume la api de tinify.com, servicio otorgado por tinyjpg.com
#!/usr/bin/env bash
#Itera los directorios donde están montados las imagenes que se quieren
#optimizar a traves del api de tinyjpg.com.
#
#La estructura de directorios es la siguiente:
# /mnt/the-void/[unidad_medica]/Digital/Anexo C/[dept]/[filename].jpg
#Para su ejecucion se coloca CWD desde el directorio de la unidad medica
#que se va a operar