Skip to content

Instantly share code, notes, and snippets.

View sistematico's full-sized avatar
🏠
Working from home

Lucas Saliés Brum sistematico

🏠
Working from home
View GitHub Profile
@sistematico
sistematico / grav-perms.sh
Last active June 11, 2016 09:50
Conserta as permissões do Grav | Fix Grav permissions
#!/bin/sh
GRAV_PATH="/var/www/lucasbrum.tk"
GRAV_USER="webdev"
GRAV_GROUP="webdev"
chown ${GRAV_USER}:${GRAV_GROUP} $GRAV_PATH
chown -R ${GRAV_USER}:${GRAV_GROUP} $GRAV_PATH
find $GRAV_PATH -type f | xargs chmod 664
find ${GRAV_PATH}/bin -type f | xargs chmod 775
@sistematico
sistematico / watch.sh
Created June 14, 2016 04:24 — forked from mikesmullin/watch.sh
watch is a linux bash script to monitor file modification recursively and execute bash commands as changes occur
#!/usr/bin/env bash
# script: watch
# author: Mike Smullin <mike@smullindesign.com>
# license: GPLv3
# description:
# watches the given path for changes
# and executes a given command when changes occur
# usage:
# watch <path> <cmd...>
#
@sistematico
sistematico / accuweather_codes.txt
Created June 15, 2016 03:48
AccuWeather Location Codes
City Name = "Aachen, DE" Location = "EUR|DE|GM011|AACHEN" Country = "Germany"
City Name = "Aalborg, DK" Location = "EUR|DK|DA007|AALBORG" Country = "Denmark"
City Name = "Aalesund, NO" Location = "EUR|NO|NO007|AALESUND" Country = "Norway"
City Name = "Aare, SE" Location = "EUR|SE|SW006|AARE" Country = "Sweden"
City Name = "Aarhus, DK" Location = "EUR|DK|DA001|AARHUS" Country = "Denmark"
City Name = "Aba, NG" Location = "AFR|NG|NI008|ABA" Country = "Nigeria"
City Name = "Abadan, IR" Location = "MEA|IR|IR016|ABADAN" Country = "Iran"
City Name = "Abakan, RU" Location = "ASI|RU|RS033|ABAKAN" Country = "Russia"
City Name = "Abbotsford, CA" Location = "NAM|CA|BC|ABBOTSFORD" Country = "Canada"
City Name = "Abeokuta, NG" Location = "AFR|NG|NI000|ABEOKUTA" Country = "Nigeria"
#!/bin/bash
#
# chwall.sh - Programa para alterar o papel de parede.
# Funciona no i3, OpenBox e outros.
#
# Criador por Lucas Saliés Brum a.k.a. sistematico, <lucas at archlinux dot com dot br>
#
# Criado em: 17-06-2016 13:13:58
# Última alteração: 18-06-2016 04:03:48
@sistematico
sistematico / trackers.txt
Created August 19, 2016 23:24
List of Torrent Trackers
http://9.rarbg.com:2710/announce
http://announce.torrentsmd.com:6969/announce
http://bt.careland.com.cn:6969/announce
http://explodie.org:6969/announce
http://mgtracker.org:2710/announce
#!/bin/sh
#
# Sintaxe para encontrar os IPS.
# host -t a DOMINIO
# whois -h whois.radb.net [IP] | grep origin
# whois -h whois.radb.net -- -i origin -T route AS32934 | grep route:
#
# Script por Lucas Saliés Brum, a.k.a. sistematico, <lucas AT archlinux DOT com DOT br>.
# Criado em 03/08/16
# Alterado em 03/08/16
@sistematico
sistematico / firewall-helper.sh
Last active August 24, 2016 16:50
Firewall Helper - Script para bloquear todos os domínios de um site, como Facebook ou Google ou bloquear torrents.
#!/bin/sh
#
# Sintaxe para encontrar os IPS.
# host -t a DOMINIO
# whois -h whois.radb.net [IP] | grep origin
# whois -h whois.radb.net -- -i origin -T route AS32934 | grep route:
#
# Script por Lucas Saliés Brum, a.k.a. sistematico, <lucas AT archlinux DOT com DOT br>.
#
# Criado em 03/08/16 13:43:16 AMT
@sistematico
sistematico / unsplash_bg.sh
Last active August 30, 2016 16:41
Salva uma imagem aleatória do site unsplash.com e define como papel de parede no Linux
#!/bin/bash
#
# unsplash_bg.sh - Baixa uma imagem do site unsplash.com
# salva e define como papel de parede.
#
# Desenvolvido por Lucas Saliés Brum <lucas@archlinux.com.br>
#
# Criado em: 09-04-2016 08:44:09 AMT
# Última alteração em: 30-08-2016 12:32:04 AMT
@sistematico
sistematico / earth_bg.sh
Created August 30, 2016 20:27
Cria um papel de parede com uma foto da terra em tempo real
#!/bin/sh
#
# earth_bg.sh - Papel de parede com luz do sol e nuvens sobre a terra em tempo real.
#
# Criado em: 30-08-2016 16:02:20 AMT
# Última alteração: 30-08-2016 16:02:43 AMT
#
# Por Lucas Saliés Brum a.k.a. sistematico, <lucas@archlinux.com.br>
wget -q -U "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" http://static.die.net/earth/mercator/1600.jpg -O ${HOME}/.earth_bg.jpg
@sistematico
sistematico / translate.inc.php
Created September 5, 2016 21:43
Traduz uma string a partir da API do Yandex Translate
<?php
$yandex_translate_api = "SUA_API_NO_YANDEX";
function traduzir($texto,$idioma = 'en-pt') {
global $yandex_translate_api;
$url = 'https://translate.yandex.net/api/v1.5/tr.json/translate?key=' . $yandex_translate_api . '&text=' . urlencode($texto) . '&lang=' . $idioma;
$json = file_get_contents($url);
$obj = json_decode($json);
$texto = $obj->text;
return $texto[0];