Skip to content

Instantly share code, notes, and snippets.

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

Rafael Barzotto rafabarzotto

🏠
Working from home
View GitHub Profile
@rafabarzotto
rafabarzotto / nodejs-api-service
Last active February 11, 2019 10:48
ubuntu 16.04 nodejs app service
[Service]
WorkingDirectory=/home/opt/webServer/dhcpWeb-api
ExecStart=/usr/bin/nodejs /home/opt/webServer/dhcpWeb-api/bin/server
User=opt
Group=
Restart=always
Environment='NODE_ENV=production'
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=dhcpWeb-api
@rafabarzotto
rafabarzotto / bannedlist.txt
Created December 18, 2018 15:00
Black List Endian Firewall
youtube.com
facebook.com
orkut.com
twitter.com
imo.im
playboy.com.br
sexy.com.br
pombaloka.com.br
travecos.tv
ebuddy.com
@rafabarzotto
rafabarzotto / remove_w_vbs.bat
Created December 13, 2018 18:23
remove w.vbs bat
@ECHO OFF
ECHO.
ECHO Fechando o Explorer para evitar problemas.
ECHO (Sera aberto novamente ao finalizar o processo)
ECHO.
taskkill /im explorer.exe /f
taskkill /im w.exe /f
cd %appdata%
attrib -r -a -s -h /s /d *.*
del *.lnk *.vbs. *.js *.com *.vbe /f /q
@rafabarzotto
rafabarzotto / utf8size.php
Created December 13, 2018 18:23
Encode utf8 php
function utf8ize($d) {
if (is_array($d)) {
foreach ($d as $k => $v) {
$d[$k] = utf8ize($v);
}
} else if (is_string ($d)) {
return utf8_encode($d);
}
return $d;
}
@rafabarzotto
rafabarzotto / autoMappingLPT.bat
Created December 13, 2018 18:22
Auto Mapping LPT port windows
@echo off
for /f "tokens=1,2,3 delims= " %%a in ('net use ^| find "entradas"') do (
echo Mapping LPT5 to \\localhost\GenericText
net use LPT5 \\localhost\GenericText /persistent:yes
)
for /f "tokens=1,2,3 delims= " %%a in ('net use ^| find "dispon"') do (
echo Remapping %%c to \\localhost\GenericText
net use %%c \\localhost\GenericText /persistent:yes
)
@rafabarzotto
rafabarzotto / elastix_conf.txt
Created December 13, 2018 18:21
Elastix conf
Como saber que ligações estão rolando:
elastix*CLI> core show channels
Channel Location State Application(Data)
SIP/RAMAL-00000264 555@from-internal:4 Up dial(12345678)
1 active channel
1 active call
666 calls processed
E para Derrubar a ligação:
@rafabarzotto
rafabarzotto / arrumar_bug_vpn_endian-3.0.5beta1.txt
Last active December 20, 2018 13:55
config no-ip dns endian firewall
1. Follow the instructions for the server (or site A) listed here: http://help.endian.com/entries/20059443-SSL-VPN-How-to-Create-a-Net-to-Net-Connection
2. While you're at site A, copy the cert for use later at site B. The file you need is here (the cert we downloaded from the web UI did NOT work for some reason):
/etc/openvpn/ca/cacert.pem
3. At site B, edit /etc/openvpn/openvpnclient.conf.tmpl and change this:
custom "/usr/local/bin/dir.d-exec /etc/openvpn/custom.client.d/"
To this:
#custom "/usr/local/bin/dir.d-exec /etc/openvpn/custom.client.d/"
@rafabarzotto
rafabarzotto / !WhatsApp On Web Monitor.md
Created November 2, 2018 22:17 — forked from parthpower/!WhatsApp On Web Monitor.md
Simple JS to monitor offline and online time of a contact.

WhatsApp On Web Monitor

What It does

It gives notifications when someone goes online or offline or typing. Open chat of the contact you want to monitor and start script.

Simple Way

@rafabarzotto
rafabarzotto / netUse.bat
Created June 20, 2018 22:23
Remappint net use printers and drivers
@echo off
for /f "tokens=1,2,3 delims= " %%a in ('net use ^| find "dispon"') do (
echo Remapping %%c to \\localhost\GenericText
net use %%c \\localhost\GenericText /persistent:yes
)
@rafabarzotto
rafabarzotto / create_restore_dump_esus.sh
Created June 1, 2017 11:12
Criar banco e restaurar dump do e-SUS
export PGPASSWORD=esus; /usr/bin/createdb -E UTF8 -T template0 -p 5432 -U postgres esus
/usr/bin/pg_restore -p 5432 -U postgres -Fc -j 4 -d esus -O /home/opt/dump.backup