Skip to content

Instantly share code, notes, and snippets.

find -type f -exec md5sum "{}" +
Ex: lista apenas por extensão:
find -type f -name "*.zip" -exec md5sum "{}" +
find . -type d -name "workspace" | xargs rm -rf
@phackwer
phackwer / gist:b70e47331606e6e2313749b04862d0e8
Last active October 11, 2016 14:01
Diversas formas de substituição e geração de MD5 e SHA1 com base em padrões dentro de arquivos
for f in `grep -rl srv267 .`;
do \
sed -i 's/srv267/pvl010/g' $f && \
echo $f \
set -- $(md5sum $f) && \
echo $1 > $f.md5;
set -- $(sha1sum $f) && \
echo $1 > $f.sha1;
done;
0 - instalar o build-essential:
sudo apt-get install build-essential
1 - instalar o nodejs e o npm:
sudo apt-get install node;
sudo apt-get install npm;
2 - instalar o gearman:
sudo apt-get install gearman
@phackwer
phackwer / 0 - Instalação Ubuntu Gnome - by Phackwer (easy use)
Last active November 29, 2017 13:36 — forked from adlerluiz/0 - Instalação Ubuntu Gnome - by Phackwer (easy use)
Instalação Ubuntu Gnome 16.04 - by Phackwer (easy use)
Este guia tem por objetivo facilitar a minha vida para ter o meu ambiente restaurado ou construído do zero, mas pode ser utilizado por qualquer outra pessoa que goste de um ubuntu ainda mais fácil para utilizar no desenvolvimento de aplicações PHP com repositórios Git. Não estão colocados aqui detalhes sobre instalação de banco de dados, e o hardwar alvo é um macbook pro 17" i7 com HD SSD.
COLOCANDO UM SAY COMO DO MAC NO LINUX
sudo apt-get install gnustep-gui-runtime
say "hello"
1 - Install Ubuntu Unity LTS - Update and upgrade
2 - Install Nvidia driver and reboot
3 - Install Gnome Desktop over Ubuntu
INSTALL JENKINS IMAGE FOR DOCKER
--------------------------------
Go as root:
$ sudo su
Run the jenkins container for the first time specifying the volume on current filesystem and ports:
# docker run -p 8080:8080 -p 50000:50000 -v /home/phackwer/Projects/jenkins/:/var/jenkins_home jenkins
@phackwer
phackwer / Kill old processes
Created February 15, 2017 18:07
Kill old processes
#!/bin/bash
#######################################################################################
# Author Pablo Sanchez
# RAID Bug Killer - kills $COMMAND processes older then $SECONDS
#######################################################################################
COMMAND='php'
SECONDS=900 # 15 minutes
(ps --noheaders -o pid,etime -C $COMMAND) | while read -r PID TIME; do
SavedIFS="$IFS"
IFS="-:."
SELECT LEVENSHTEIN(LATINEX('Joaum Culioins da Çilva Roxa'),
LATINEX('João Culhões da Silva Rocha'));
SELECT LEVENSHTEIN(LATINEX('Valdisnei'), LATINEX('Walt Disney'));
SELECT LEVENSHTEIN(LATINEX('Uólaci Martinez de Çouza Broxado'),
LATINEX('Wallace Martins de Sousa Brochado'));
SELECT LEVENSHTEIN(LATINEX('Wanezza Manguabeira da Costta'),
LATINEX('Vanessa Mangabeira da Costa'));
SELECT LEVENSHTEIN(LATINEX('Amiltão De Georgio'), LATINEX('Hamilton Di
Giorgio'));
@phackwer
phackwer / gist:a9749318b21a003e63adcf25b579a0d3
Created April 10, 2017 01:50
3 finger drag-drop on Linux
sudo apt-get install libmtdev xserver-xorg-dev
git clone https://github.com/p2rkw/xf86-input-mtrack/
cd xf86-input-mtrack
./configure
sudo make installsudo ln -s /usr/local/lib/xorg/modules/input/* /usr/lib/xorg/modules/input/
Add to xorg.conf
Section "InputClass"
MatchIsTouchpad "on"
@phackwer
phackwer / City Model
Created June 7, 2017 17:59
Laravel 5 - all cities, regions, states and countries from Gazeteer
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class City extends Model
{
/**
* @var array