Skip to content

Instantly share code, notes, and snippets.

View pedro-stanaka's full-sized avatar

Pedro Tanaka pedro-stanaka

View GitHub Profile
@pedro-stanaka
pedro-stanaka / rmsvn.sh
Created June 14, 2013 02:07
Remove all SVN(eww) metadata folders recursivelly under the current directory. Usefull to move a svn_repo to a Git repo.
#!/bin/sh
echo "recursively removing .svn folders from"
pwd
rm -rf `find . -type d -name .svn`
@pedro-stanaka
pedro-stanaka / Makefile
Created June 18, 2013 12:36
Makefile for OpenGL programming in UNIX systems using the library freeglut3.
CPP = g++
CC = gcc
OBJ = main.o $(RES)
BIN = appname
RM = rm -f
PROGRAM = appname
$(PROGRAM):
$(CPP) -w *.cpp -lX11 -lGL -lGLU -lglut -g -Wall -O2 -o $(PROGRAM)
@pedro-stanaka
pedro-stanaka / postgisToLatLngArray
Last active June 18, 2018 07:57
A fast way to transform a PostGIS polygon in WKT format to Javascript (Google Maps API)
/**
* Get an polygon postgis object casted to a string and transform to an instance of
* google.maps.polygon
* @author Pedro Tanaka <pedro.stanaka@gmail.com>
* @param {String} polygonStr String from the PostGis function TS_geometryToText(...)
* @returns {Array} An array with the LatLng's to be put in the polygon
*/
function postgisPolygonToJsonArray(polygonStr){
polygonStr = polygonStr.replace('POLYGON((', '');
@pedro-stanaka
pedro-stanaka / blog.test
Created December 6, 2013 21:47
VHOST FOR CAKE BLOG
<VirtualHost *:80>
ServerName blog.local
ServerAdmin pedro.tanaka@sinetic.com.br
DocumentRoot /var/www/repos/blog.cake
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/repos/blog.cake>
@pedro-stanaka
pedro-stanaka / git-config.sh
Last active January 2, 2016 14:19
Git configuration with prompts. Shell (Bash) script for Debian/Based distros of Linux.
#!/bin/bash
command -v git >/dev/null 2>&1 || { echo >&2 "Git is not installed. Aborting."; exit 1; }
echo "\nWhat name should be used in commits globally? \n"
read full_name
git config --global user.name "$full_name"
@pedro-stanaka
pedro-stanaka / upgrade-php5.sh
Created January 8, 2014 16:18
Update PHP on Ubuntu 12.04 to 5.4 version with mcrypt extension; These are dependencies of CakePHP 3.0
#!/bin/bash
# Install aptitude a better package manager than apt-get
# and install the apt-add-repository command
sudo apt-get install aptitude python-software-properties
# Add the ppa that has the oldstable version of PHP5
sudo apt-add-repository ppa:ondrej/php5-oldstable -y
# PostgreSQL Client Authentication Configuration File
# ===================================================
#
# Refer to the "Client Authentication" section in the PostgreSQL
# documentation for a complete description of this file. A short
# synopsis follows.
#
# This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which
# databases they can access. Records take one of these forms:
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# (The "=" is optional.) Whitespace may be used. Comments are introduced with
# "#" anywhere on a line. The complete list of parameter names and allowed
@pedro-stanaka
pedro-stanaka / clean-install-linux.sh
Last active October 11, 2018 17:14
Install all things i need in a linux (debian-based)... 64 bits version
#!/bin/sh
# Upgrade packages that are available to update
sudo apt-get update
sudo apt-get -y upgrade
# Miscelaneous tools and media players and game emulators
sudo apt-get install -y build-essential ubuntu-restricted-extras htop vcl smplayer k3b audacity audacious audacious-plugins visualboyadvance pcsxr
/usr/local/crawler-rio/logs/*.log {
rotate 7
daily
compress
missingok
nocreate
}