jueves 29 de septiembre de 2011
Warning: date(): It is not safe to rely on the system's php.ini
domingo 4 de septiembre de 2011
Comparar 2 ficheros de texto línea a línea
Siempre lo intento hacer con el comando "comm", pero nunca sale el resultado esperando si el fichero es demasiado grande.. en perl:
#!/usr/bin/perl use Data::Dumper; open(A,"$ARGV[0]"); @a1=; close A; open(B,"$ARGV[1]"); @a2=; close B; my @a = array_differenz(\@a1, \@a2); foreach (@a) { print; } sub array_differenz ($$) { my $a1 = shift; # array reference my $a2 = shift; # array reference my @a1m2 = @$a1; # array 1 minus array 2; for my $element (@$a2) { for my $index (0..$#a1m2) { if ($element eq $a1m2[$index]) { splice @a1m2, $index, 1; last; } } } my @a2m1 = @$a2; # array 2 minus array 1; for my $element (@$a1) { for my $index (0..$#a2m1) { if ($element eq $a2m1[$index]) { splice @a2m1, $index, 1; last; } } } return (@a1m2, @a2m1); } # sub array_differenz
jueves 1 de septiembre de 2011
Velocidad en discos USB en linux
De: http://www.linux-usb.org/FAQ.html#i5
A:For USB Mass Storage devices (that is, devices which use the usb-storage driver) max_sectors controls the maximum amount of data that will be transferred to or from the device in a single command. As the name implies this transfer length is measured in sectors, where a sector is 512 bytes (that's a logical sector size, not necessarily the same as the size of a physical sector on the device). Thus for example, max_sectors = 240 means that a single command will not transfer more than 120 KB of data.
Linux 2.6 gives you the ability to see and to change the max_sectors value for each USB storage device, independently. Assuming you have a sysfs filesystem mounted on /sys and assuming /dev/sdb is a USB drive, you can see the max_sectors value for /dev/sdb simply by running:
cat /sys/block/sdb/device/max_sectors
and you can set max_sectors to 64 by running (as root):
echo 64 >/sys/block/sdb/device/max_sectors
Values should be positive multiples of 8 (16 on the Alpha and other 64-bit platforms). There is no upper limit, but you probably shouldn't make max_sectors much bigger than 2048 (corresponding to 1 MB, which is quite a lot).
In general, increasing max_sectors will improve throughput since it means that larger amounts of data can be transferred in a single command with no need for being split up among multiple commands. Of course this is subject to diminishing returns when max_sectors is very big. More importantly, it's true only up to a point. Many devices have limits on the amount of data they can transfer, and if you try to exceed that limit you will most likely crash the device.
martes 15 de marzo de 2011
VMWare Player en Linux con SELinux
Hay que modificar los /dev/vmnet*
ls -Za /dev/vmne*
crw-------. root root unconfined_u:object_r:device_t:s0 /dev/vmnet0
crw-------. root root unconfined_u:object_r:device_t:s0 /dev/vmnet1
crw-------. root root unconfined_u:object_r:device_t:s0 /dev/vmnet8
Mediante:
restorecon -v /dev/vmnet1
restorecon -v /dev/vmnet0
restorecon -v /dev/vmnet8
ls -Za /dev/vmne*
crw-------. root root system_u:object_r:vmware_device_t:s0 /dev/vmnet0
crw-------. root root system_u:object_r:vmware_device_t:s0 /dev/vmnet1
crw-------. root root system_u:object_r:vmware_device_t:s0 /dev/vmnet8
viernes 11 de marzo de 2011
Alt-gr en vmware sobre un linux
Editar /etc/vmware/config
xkeymap.keycode.108 = 0x138 # Alt_R
xkeymap.keycode.106 = 0x135 # KP_Divide
xkeymap.keycode.104 = 0x11c # KP_Enter
xkeymap.keycode.111 = 0x148 # Up
xkeymap.keycode.116 = 0x150 # Down
xkeymap.keycode.113 = 0x14b # Left
xkeymap.keycode.114 = 0x14d # Right
xkeymap.keycode.105 = 0x11d # Control_R
xkeymap.keycode.118 = 0x152 # Insert
xkeymap.keycode.119 = 0x153 # Delete
xkeymap.keycode.110 = 0x147 # Home
xkeymap.keycode.115 = 0x14f # End
xkeymap.keycode.112 = 0x149 # Prior
xkeymap.keycode.117 = 0x151 # Next
xkeymap.keycode.78 = 0x46 # Scroll_Lock
lunes 18 de octubre de 2010
Cambiar proximo reinicio en grub - Lilo -R
echo "savedefault --default=1 --once" | grub --batch
viernes 1 de octubre de 2010
arp static en Windows7
Ejemplo:
netsh interface ipv4 add neighbors "Local Area Connection" 192.168.0.1 00-24-01-d2-3a-bd
miércoles 5 de mayo de 2010
crear un Access point (y no ad-hoc) en Windows 7
En un cmd:
netsh wlan set hostednetwork allow ssid clave
netsh wlan start hostednetwork
netsh wlan show hostednetwork
netsh wlan show hostednetwork security
... y compartir la conexión en el interfaz que está conectado a Internet ...
miércoles 27 de enero de 2010
Buscar en ripe.db.gz
Usar el whois de whois.ripe.net no permite expresiones regular, pero se puede bajar su bbdd:
wget ftp://ftp.ripe.net/ripe/dbase/ripe.db.gz
zgrep -B10 -Ei "netname:.*Cocacola" ripe.db.gz | grep -E "netname|inetnum"
viernes 1 de enero de 2010
Seguridad Web checklists, webappsec
SQL Injection Cheat Sheet - http://ferruh.mavituna.com/sql-injection-cheatsheet-oku/ SQL Injection Cheat Sheet - http://michaeldaw.org/sql-injection-cheat-sheet SQL Injection Cheat Sheet w/ filter evasion - http://ha.ckers.org/sqlinjection/ SQL Injection Cheat Sheets sorted by DB - http://pentestmonkey.net/index.php?option=com_content&task=category§ionid=9&id=24&Itemid=1 XSS Cheat Sheet w/ filter evasion - http://ha.ckers.org/xss.html Web App Assesment Cheat Sheet - http://www.secguru.com/files/cheatsheet/webappcheatsheet2.pdf

