Skip to content

Instantly share code, notes, and snippets.

Patricio Gonzalez Vivo patriciogonzalezvivo

Block or report user

Report or block patriciogonzalezvivo

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
@patriciogonzalezvivo
patriciogonzalezvivo / dd.md
Last active Aug 29, 2015
DiskImage Backup and restore
View dd.md

Backup

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

Restore

@patriciogonzalezvivo
patriciogonzalezvivo / php-webhook-script.md
Last active Aug 29, 2015
Highly insecure way to auto update a repo in a website using WebHooks
View php-webhook-script.md
<?php
{
    $output = shell_exec("cd /var/www/html/; git pull origin master;");
    echo "<pre>$output</pre>";
}
die("done " . mktime());
?>
View GIT-SubModules.md

First :

git submodule add ...

Then:

git clone ...
git pull && git submodule init && git submodule update && git submodule status
git submodule foreach git checkout master
View GL_Snips.md

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();
View SimpleCameraFollower.md
cam.setPosition( cam.getPosition()+(targetPos-cam.getPosition())*0.01 );
cam.lookAt(targetPos);
@patriciogonzalezvivo
patriciogonzalezvivo / ubuntu.md
Last active Aug 29, 2015
Ubuntu post-installs
View ubuntu.md

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
View ttyGPS.cpp
// 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 / AutoReLoad Scrip
Created Apr 27, 2013
Re loads an app after it crash
View AutoReLoad Scrip
#!/bin/sh
while : ;
do /path/app;
sleep 30;
done
View get string from ofSerial
string serialIn;
unsigned char buffer[1];
while( readBytes( buffer, 1) > 0){
if (buffer[0] == '\n'){
break;
}
serialIn.push_back(buffer[0]);
};
@patriciogonzalezvivo
patriciogonzalezvivo / StringShaders.md
Last active Dec 16, 2015
GLSL shaders on a strings (OF)
View StringShaders.md

Stringify Macro

#define STRINGIFY(A) #A

Default Vertex

string vertexShader = STRINGIFY(	
You can’t perform that action at this time.