after running this command in your local repo, do a
git push
this allows to restore the repo when someone for example erased all files in error.
Este es el blog personal de las actividades de trabajo del Arquitecto de Sistemas (SA) Alfonso Baqueiro Bernal.
HERRAMIENTAS A CONSIDERAR
Compre un teclado Wireless de marca Perfect Choice, el cúal me gusto debido al tamaño reducido y su diseño ya que las teclas y el espacio entre teclas es similar al de Mac, sin embargo cometieron la burrada de no poner la tecla AltGr que es básica para poner el tercer símbolo de las teclas, por lo que el workaround que se me ocurre es mapear la tecla Ctrl_Derecha para que sea AltGr, pero como se requiere Ctrl_Derecha para poder salir del modo capturado en Virtual Box, tengo la opción de convertir Supr en Ctrl_Derecha o usar la inutil tecla de windows como Ctrl_Derecha
Así que esto es algo de lo que investigue para implementar este workaround:
usando xev observamos el keycode correspondiente a la tecla que tiene el 1 como vemos es el codigo 10
#mapear la tecla del 1 para que ponga 3 xmodmap -e 'keycode 10=3'
#mapear la tecla del 1 para que ponga a xmodmap -e 'keycode 10=a'
ahora podemos intentar con una tecla que no tenga simbolo como supr
y mapearla a que sea un simbolo
supr keycode is 119
xmodmap -e 'keycode 119=a'
ok, funciona, ahora lo que quiero es mapear la tecla de supr para que funcione como AltGr que este estupido teclado no contiene dicha tecla y no puedo poner la @
xmodmap -e 'keycode 119=ISO_Level3_Shift'
Para el caso de las teclas modificadoras como shift, se tiene que hacer algo más Para ver como esta configurado usamos:
xmodmap
esto mostrara algo como esto
xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x69), Super_L (0x85) mod1 Alt_L (0x40), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_R (0x86), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)En resumidas cuentas lo que necesitamos hacer es: La tecla de windows (keysym=Super_L) funcionara como tecla de control # Como esta definida como mod4, entonces hay que removerla xmodmap -e 'remove mod4 = Super_L' # Lo siguiente es añadirla como tecla de control xmodmap -e 'add control = Super_L' # Luego procedemos a quitar la Control_R como tecla de control xmodmap -e 'remove control = Control_R' # Y añadimos Control_R como mod5 xmodmap -e 'add mod5 = Control_R' # La tecla de Insert, como esta en el extremo superior derecho, debería ser Supr xmodmap -e 'keysym Insert = Delete' # No tenemos AvPag ni RePag, pero podemos usar Up and Down, cuando se presionan con Shift xmodmap -e 'keysym Up = Up Page_Up' xmodmap -e 'keysym Down = Down Page_Down' Y CON ESTO DAREMOS POR CONCLUIDO LA CONFIGURACIÓN, ya dependiendo de como nos adaptemos a este teclado, entonces añadiremos otras funciones si es necesario. Lo que si se me hace muy necesario a esta altura sería tener teclas para subir y bajar el volumen.
alias stresc='sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"'stresc filename
or
stresc filename > other-file-name<?php
header("Content-Type: text/html; charset=utf8;");
echo "Has llegado a esta página ";
if (isset($_SERVER['HTTP_REFERER']) ){
echo " por una referencia desde [<b>";
echo $_SERVER['HTTP_REFERER'];
echo "</b>]";
} else {
echo "<b>usando el url directamente.</b>";
}
?>
cd /dev/shm wget ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz mkdir /build cd /build tar zxvf /dev/shm/freetds-stable.tgz cd freetds-0.82/ ./configure --prefix=/usr/local/freetds --exec-prefix=/usr/local/freetds make sudo make install
cd /build cd php-5.2.6/ './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-pgsql=/usr/local/pgsql' '--with-zlib' '--enable-mbstring' '--with-gd' '--with-jpeg-dir=/usr/lib' '--with-mssql=/usr/local/freetds'
sudo touch /usr/local/freetds/include/tds.h sudo touch /usr/local/freetds/lib/libtds.a
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-pgsql=/usr/local/pgsql' '--with-zlib' '--enable-mbstring' '--with-gd' '--with-jpeg-dir=/usr/lib' --with-mssql=/usr/local/freetds make sudo make install
sudo service httpd restart google-chrome http://localhost/pru.php
sudo gvim /usr/local/freetds/etc/freetds.conf
[google_vm_altair] host = 192.168.10.70 port = 1433 tds version = 7.0
BACKUP DATABASE pru TO DISK='prueba.bak';
RESTORE DATABASE pru FROM DISK='prueba.bak';
RESTORE DATABASE pru2 FROM DISK='prueba.bak'esto lanza el error siguiente
-- [Error] Script lines: 1-3 -------------------------- -- The file 'c:\mssql2005\MSSQL.1\MSSQL\DATA\pru.mdf' cannot be overwritten. It is being used by database 'pru'. -- -- More exceptions ... File 'pru' cannot be restored to 'c:\mssql2005\MSSQL.1\MSSQL\DATA\pru.mdf'. Use WITH MOVE to identify a valid location for the file.
RESTORE FILELISTONLY FROM DISK='prueba.bak'esto muestra algo como lo siguiente:
RESTORE DATABASE pru2 FROM DISK='prueba.bak' WITH MOVE 'pru' TO 'c:\mssql2005\MSSQL.1\MSSQL\DATA\pru2.mdf' ,MOVE 'pru_log' TO 'c:\mssql2005\MSSQL.1\MSSQL\DATA\pru2_log.LDF'
eth0 Link encap:Ethernet direcciónHW 00:04:75:ab:cd:ef
Direc. inet:192.168.1.50 Difus.:192.168.1.255 Másc:255.255.255.0
ACTIVO DIFUSIÓN MULTICAST MTU:1500 Métrica:1
Paquetes RX:0 errores:0 perdidos:0 overruns:0 frame:0
Paquetes TX:0 errores:0 perdidos:0 overruns:0 carrier:0
colisiones:0 long.colaTX:1000
Bytes RX:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupción:20 Dirección base: 0xe000
eth0:1 Link encap:Ethernet direcciónHW 00:04:75:ab:cd:ef
Direc. inet:192.168.1.100 Difus.:192.168.1.255 Másc:255.255.255.0
ACTIVO DIFUSIÓN MULTICAST MTU:1500 Métrica:1
Interrupción:20 Dirección base: 0xe000
eth0:2 Link encap:Ethernet direcciónHW 00:04:75:ab:cd:ef
Direc. inet:192.168.1.200 Difus.:192.168.1.255 Másc:255.255.255.0
ACTIVO DIFUSIÓN MULTICAST MTU:1500 Métrica:1
Interrupción:20 Dirección base: 0xe000
if you did the following as root: setcap cap_net_admin=+eip /sbin/route anyone that could run the route command could do routing changes. so a possibility is to make /sbin/route mode 0550 and a special routing group and have the process be run by a user in that routing group. |
$ nc -l 3333On the other end, connect to the server with the following:
$ nc 192.168.0.1 3333In this case, the keyboard acts as the stdin. Anything you type in the server machine’s terminal is transfered to the client machine and vice-versa.
$ cat backup.iso | nc -l 3333Receive backup.iso on the client machine with the following:
$ nc 192.168.0.1 3333 > backup.isoAs you may have noticed, netcat does not show any info about the progress of the data transfer. This is inconvenient when dealing with large files. In such cases, a pipe-monitoring utility like pv can be used to show a progress indicator. For example, the following shows the total amount of data that has been transfered in real-time on the server side:
$ cat backup.iso | pv -b | nc -l 3333Of course, the same can be implemented on the client side by piping netcat’s output through pv:
$ nc 192.168.0.1 3333 | pv -b > backup.iso
$ dd if=/dev/hdb5 | gzip -9 | nc -l 3333On the remote machine, connect to the server and receive the partition image with the following command:
$ nc 192.168.0.1 3333 | pv -b > myhdb5partition.img.gzThis might not be as classy as the partition backups using partimage, but it is efficient.
tar and have them pulled by a remote machine:$ tar -czf - /etc/ | nc -l 3333As you can see, there is a dash in the tar options instead of a filename. This is because tar’s output needs to be passed to netcat.
$ nc 192.168.0.1 3333 | pv -b > mybackup.tar.gz
$ cat backup.iso | nc -l 3333On the client machine connect to the listening socket through an SSH tunnel:
$ ssh -f -L 23333:127.0.0.1:3333 me@192.168.0.1 sleep 10; \
nc 127.0.0.1 23333 | pv -b > backup.iso
This way of creating and using the SSH tunnel has the advantage that the tunnel is automagically closed after file transfer finishes. For more information and explanation about it please read my article about auto-closing SSH tunnels.$ nc dict.org 2628
220 ..............some WELCOME.....
DEFINE wn server
150 1 definitions retrieved
151 "server" wn "WordNet (r) 2.0"
server
n 1: a person whose occupation is to serve at table (as in a
restaurant) [syn: {waiter}]
2: (court games) the player who serves to start a point
3: (computer science) a computer that provides client stations
with access to files and printers as shared resources to a
computer network [syn: {host}]
4: utensil used in serving food or drink
.
250 ok [d/m/c = 1/0/18; 0.000r 0.000u 0.000s]
QUIT
221 bye [d/m/c = 0/0/0; 16.000r 0.000u 0.000s]
$ nc -z 192.168.0.1 80-90 Connection to 192.168.0.1 80 port [tcp/http] succeeded!In this example, netcat scanned the 80-90 range of ports and reported that port 80 is open on the remote machine.