Skip to content

Instantly share code, notes, and snippets.

View altmas5's full-sized avatar
๐ŸŠ

Jorge Vallecillo altmas5

๐ŸŠ
View GitHub Profile
@altmas5
altmas5 / extensions.conf
Created July 18, 2013 21:53
asterisk outbound routes by carrier
[outbound-allroutes]
include => outbound-allroutes-custom
include => outrt-1 ; Claro
include => outrt-3 ; Movistar
include => outrt-2 ; internos
include => outrt-4 ; Fijos
exten => foo,1,Noop(bar)
; end of [outbound-allroutes]
@altmas5
altmas5 / kannel.conf
Created July 16, 2013 04:42
kannel conf file for Huawei E153 and ZTE mf626
group = core
admin-port = 13000
admin-password = foo
status-password = bar
admin-deny-ip = "*.*.*.*"
admin-allow-ip = "*.*.*.*"
log-file = "/var/log/kannel/bearerbox.log"
access-log = "/var/log/kannel/access.log"
store-type = file
store-location = "/var/log/kannel/queue.log"
@altmas5
altmas5 / detash.sh
Last active December 19, 2015 08:59
Keeping ppp on
#!/bin/bash
exp="ppp0"
logfile="/var/appdata/detach.log"
timeslot=$(date +"%H:%M:%S %d/%m/%Y");
echo "********** Iniciando detach.sh a las $timeslot *********" >> $logfile
function reconect {
pid=$(fuser /dev/ttymxc2);
kill $pid;
ppp-on
#!/bin/bash
#setear brillo por debajo de lo permitido por los botones
#en HP Mini 110-3700
echo "200"> /sys/devices/pci0000\:00/0000\:00\:02.0/drm/card0/card0-LVDS-1/intel_backlight/brightness
@altmas5
altmas5 / transmission-logger.sh
Created April 22, 2013 00:35
transmission logger
#!/bin/bash
RUTA="$TR_TORRENT_DIR/$TR_TORRENT_NAME"
FECHA=`date`
LOG="/home/altmas5/dev/scripts/transmission.log"
echo "$FECHA" >> "$LOG"
echo "$RUTA" >> "$LOG"
@altmas5
altmas5 / getPass.pl
Created April 16, 2013 15:59
getPass.pl
#!/usr/bin/perl
#arreglo de usuarios
@ users = &fetchPass;
$i = 0;
$j = 0;
sub fetchPass
{
use DBI;
@altmas5
altmas5 / beep.sh
Created March 20, 2013 17:03
beep
#!/bin/bash
for i in seq 1 5;
do
sh -c "echo -e '\a' > /dev/console";
sleep 1;
done
@altmas5
altmas5 / backup-postgresql.sh
Created March 5, 2013 16:54
backup/dump all PostgreSQL local databases 1. dump each database schema 2. dump each database data ***Run as postgres user
#!/bin/bash
timeslot=$(date +"%Y%m%d_%H-%M");
exec > log.$timeslot 2>&1
set -x
DBs=$(psql -l|grep -v 'Name\|Nombre\|:\|rows\|filas\|\---\|databases\|Listado\|postgres\|template'|awk '{print $1}'|grep -v ^\|);
for db in $DBs;
do
pg_dump -sv $db -O > /var/lib/postgresql/bckps/sch_$db-$timeslot.sql;
sleep 5;
@altmas5
altmas5 / mysql-backUp.sh
Created March 5, 2013 16:47
dump/backup all mysql local databases
#!/bin/bash
# Ruta en la que se guarda el log de la operacion de backup.
logfile="/var/backup/mysql/backUp.log"
# Ruta en la que guardar los backups
backup_dir="/var/backup/mysql"
# Usuario
username="root"
@altmas5
altmas5 / startVMs.sh
Created February 8, 2013 23:50
"Automagically" start all VMs in the free version of citrix xen server on boot time
#!/bin/bash
#invoke this script at the end of /etc/rc.local file
for j in $(/opt/xensource/bin/xe vm-list is-control-domain=false | grep label| awk '{print $4}')
do
/opt/xensource/bin/xe vm-start name-label=$j;
sleep 30;
done