Skip to content

Instantly share code, notes, and snippets.

View patriciogonzalezvivo's full-sized avatar

Patricio Gonzalez Vivo patriciogonzalezvivo

View GitHub Profile
@patriciogonzalezvivo
patriciogonzalezvivo / AutoReLoad Scrip
Created April 27, 2013 15:24
Re loads an app after it crash
#!/bin/sh
while : ;
do /path/app;
sleep 30;
done
// Author: @patriciogv ( patricio.io )
#include <stdio.h> // standard input / output functions
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <string.h> // string function definitions
#include <unistd.h> // UNIX standard function definitions
#include <fcntl.h> // File control definitions
#include <errno.h> // Error number definitions
@patriciogonzalezvivo
patriciogonzalezvivo / ubuntu.md
Last active August 29, 2015 14:19
Ubuntu post-installs

Sysadmin

sudo apt-get install nmap iptraf tcpdump dstat ngrep mtr nc lftp irssi iotop

IDE station

sudo apt-get install git-core tmux mc htop vim zsh lsof

Simple Quad

glBegin(GL_QUADS);
glTexCoord2f(0, 0); glVertex3f(0, 0, 0);
glTexCoord2f(width, 0); glVertex3f(width, 0, 0);
glTexCoord2f(width, height); glVertex3f(width, height, 0);
glTexCoord2f(0,height);  glVertex3f(0,height, 0);
glEnd();

First :

git submodule add ...

Then:

git clone ...
git pull && git submodule init && git submodule update && git submodule status
git submodule foreach git checkout master
@patriciogonzalezvivo
patriciogonzalezvivo / php-webhook-script.md
Last active August 29, 2015 14:03
Highly insecure way to auto update a repo in a website using WebHooks
<?php
{
    $output = shell_exec("cd /var/www/html/; git pull origin master;");
    echo "<pre>$output</pre>";
}
die("done " . mktime());
?>
@patriciogonzalezvivo
patriciogonzalezvivo / dd.md
Last active August 29, 2015 14:01
DiskImage Backup and restore

Backup

diskutil list
sudo dd if=/dev/disk1 of=~/Desktop/diskImg.dmg

Restore