Skip to content

Instantly share code, notes, and snippets.

View tapajos's full-sized avatar

Marcos Tapajós tapajos

View GitHub Profile
print_green "Checking POW: "
POW_PATH="${HOME}/.pow"
if [ ! -d ${POW_PATH} ]; then
print_red "failed\n"
print_red "Installing POW\n"
curl get.pow.cx | sh
print_green "Checking POW: OK\n"
else
print_green "OK\n"
fi
function update_all {
cd $PROJECTS_PATH
for i in $(find . -type d); do
if [ -d "$i/.git" ]; then
echo -e "\033[1mPulling "$i"\033[0m"
cd "$i"
# pull repos without local changes
if git diff-index --quiet HEAD --; then
git pull --rebase --quiet > /dev/null
if [ -e Gemfile ]; then
deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse
root@webby6232:/home/tapajos/vpn# aptitude install ruby-ni
The following NEW packages will be installed:
ruby-ni
0 packages upgraded, 1 newly installed, 0 to remove and 106 not upgraded.
Need to get 0 B/5,592 kB of archives. After unpacking 17.0 MB will be used.
(Reading database ... 41166 files and directories currently installed.)
Unpacking ruby-ni (from .../ruby-ni_2.0.0-p0-3_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/ruby-ni_2.0.0-p0-3_amd64.deb (--unpack):
trying to overwrite '/usr/bin/erb', which is also in package ruby-stable 1.9.3-p374-1
No apport report written because MaxReports is reached already
@tapajos
tapajos / gist:3950126
Created October 25, 2012 02:30
download - estrada real
#encoding: utf-8
require 'fileutils'
require 'nokogiri'
require 'open-uri'
trechos = {
77 => "Paraty - Cunha",
78 => "Cunha - Guaratinguetá",
79 => "Guaratinguetá - Vila do Embaú",
80 => "Vila do Embaú - Passa Quatro",
@tapajos
tapajos / gist:3355004
Created August 15, 2012 02:21
trucate logs
#!/bin/bash
cd $PROJECT_PATH
for i in $(find */log/*.log); do
echo "" > $i
done
tell application "iTerm"
activate
tell (make new terminal)
tell (launch session "initial_session") to write text "cd ~/workspace/project1; clear"
tell i term application "System Events" to keystroke "D" using command down
tell last item of sessions to write text "cd ~/workspace/work/project2; clear"
tell i term application "System Events" to keystroke "d" using command down
tell last item of sessions to write text "cd ~/workspace/work/project3; clear"
@tapajos
tapajos / gist:3014438
Created June 28, 2012 22:42
project_update
#!/bin/bash
cd ~/workspace
echo -e "\n\033[1mPulling all repositories...\033[0m\n"
for i in $(find . -maxdepth 1 -mindepth 1 -type d -type d); do
echo -e "\033[1m"+$i+"\033[0m"; cd $i; git pull --rebase;
cd ..
done
@tapajos
tapajos / gist:2902639
Created June 9, 2012 21:28
Vendo Mac Mini Core2Duo

Vendo Mac Mini

    • Processador Core2Duo 1.83 GHz
    • Combo drive
    • 2GB de RAM (originalmente era 1GB, foi atualizado)
    • 250GB de HD (originalmente era 80GB, foi atualizado)
    • Teclado Mac com fio
    • Adaptador DVI -> VGA

Preço: R$700,00

sudo ifconfig en1 ether `openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`