lunes, 2 de noviembre de 2015

ESXi cron jobs

ESXi cron jobs

#Edit corn jobs
vi /var/spool/cron/crontabs/root


# Check crond pross id
cat /var/run/crond.pid


# Kill old crond
/bin/kill $(cat /var/run/crond.pid)


 Restart cron jobs (for 5.0 or older)
/bin/busybox crond

 Restart cron jobs (for 5.1)
/usr/lib/vmware/busybox/bin/busybox crond 


# Check again crond pross id (Should not be above id)
cat /var/run/crond.pid

jueves, 17 de julio de 2014

Fitros tcpdump para conocer web visitadas

fuente: http://stackoverflow.com/questions/4777042/can-i-use-tcpdump-to-get-http-requests-response-header-and-response-body

There are tcpdump filters for HTTP GET & HTTP POST (or for both plus message body):
  • Run man tcpdump | less -Ip examples to see some examples
  • Here’s a tcpdump filter for HTTP GET:
    sudo tcpdump -s 0 -A 'tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420'
  • Here’s a tcpdump filter for HTTP POST:
    sudo tcpdump -s 0 -A 'tcp dst port 80 and (tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354)'
  • Monitor HTTP traffic including request and response headers and message body (source):
    tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
    tcpdump -X -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
For more information on the bit-twiddling in the TCP header see: String-Matching Capture Filter Generator (link to Sake Blok's explanation).


lunes, 21 de abril de 2014

filtro de MAC sin reiniciar antena ubiquiti

/usr/bin/iwpriv ath0 maccmd 2
/usr/bin/iwpriv ath0 addmac $MAC
/usr/bin/iwpriv ath0 kickmac $MAC
/usr/bin/iwpriv ath0 delmac $MAC

lunes, 24 de marzo de 2014

script ubiquiti para probar diferentes frecuencias

#!/bin/sh
cp /tmp/system.cfg /tmp/config.cfg
freq=$(cat < /etc/persistent/frecuencia.txt)
freqfile=$(cat < /tmp/system.cfg | grep freq | cut -d'=' -f2)
newfreq=`expr $freqfile + 10`


echo frecuencia almacenada $freq
echo frecuencia system.cfg $freqfile
echo siguiente frecuencia $newfreq

echo "aumentando frecuencia"
newfreq=`expr $freqfile + 10`



if [ $newfreq -gt 6100 ]
then
echo "frecuencia maxima alcanzada $freqfile $newfreq"
`sed -i s/radio.1.freq=$freqfile/radio.1.freq=4920/g /tmp/config.cfg`
mv /tmp/config.cfg /tmp/system.cfg
cfgmtd -w -p /etc/
else
echo "cambiando freq en fichero system.cfg"
echo "cambiando frecuencias $freqfile $newfreq"
sed -i s/radio.1.freq=$freqfile/radio.1.freq=$newfreq/g /tmp/config.cfg
mv /tmp/config.cfg /tmp/system.cfg
cfgmtd -w -p /etc/
fi

martes, 21 de enero de 2014

descargar subtitulos subdivx.com desde consola

#/bin/bash

tmp=/tmp/salida
baseurl="www.subdivx.com"

wget "http://www.subdivx.com/feed.php?buscar=$1" -O $tmp ;

enlaces=$(cat $tmp | grep \ | tr '\n' ' ' | sed 's///g' | sed 's/<\/link>//g' | sed 's/http\:\/\/www.subdivx.com//g')
echo -e "$enlaces"

for i in $enlaces;
do
url="$baseurl$i"
echo -e "$url \n"
wget "$url" -O $tmp ;
download=$(cat $tmp | grep "Bajar subt" | awk -F"link1" '{print $2}'|cut -d'>' -f1 | sed 's/" href\=//g' )

echo -e "-------------->$download"

comando="wget -O /tmp/$i-out.rar --referer $baseurl $download "
eval $comando;
unrar x /tmp/$i-out.rar /media/disco/descargas/
exit
done

Descargar con wget un link oculto

wget -O output.rar --referer http://dominio.com/ 'http://dominio.com/your-link-here'

lunes, 20 de enero de 2014

busquedas de torrents para raspberry pi

#/bin/bash
# programado por Juanmol para http://rsppi.blogspot.com
# modificado por netmess
tmp=/tmp/salida
series="$1"

IFS=','; for n in $series;
do
serie=$n;

for i in 1 2 3 4 5 6 7 8
do
wget "http://thepiratebay.se/search/$serie/0/7/0" -O $tmp ;
magnet=$(cat $tmp | grep magnet | head -$i | tail -1 |cut -f2 -d\");
capitulo=$(echo $magnet | sed 's/\ /\n/g' | sed 's/\./\n/g' | sed 's/\+/\n/g' | grep S | grep E)
echo "Descargar torrent de $capitulo y or n"
echo $magnet | cut -f3 -d'='

read answer
if [ "$answer" == "y" ]; then
transmission-remote localhost:9091 -a "$magnet" --auth=transmission:transmission -l;
else
continue
fi

done
done