Buenas, este es el código del script para unir imágenes png:
################################################################################
#Unión de imágenes
# Parametro 1: Nombres de ficheros a unir.
################################################################################
for a in $*; do
echo $a
ficheros=$ficheros' '$a
done
#echo $ficheros
salida="${1/.png/_merged.png}"
echo 'Merged in ------------> '$salida
convert -append $ficheros $salida
Si lo que queremos es unir imágenes con otra extensión, cambiar la extensión png en la línea donde se da valor a la variable salida.
Como siempre, este escript hemos de copiarlo en un fichero de texto y guardarlo con extensión sh. Luego hemos de darle permisos de ejecución, bien desde vuestro administrador de ficheros, bien desde la línea de comandos:
#chmod +x script.sh
Donde script.sh es el nombre que hayais puesto al fichero.
¿Como funciona? Sencillo, llamar desde la línea de comando al script añadiendo como parámetro el nombre de los ficheros a unir. Se admiten nombre con comodines, lo cual da verdadera potencia a este script pues podremos unir cientos de ficheros png contan solo el nombre del script y un conjunto que comodines que los describan.
Os aconsejaría guardar todos estos scritps en un directorio único y añadirlo en la configuración del shell para que se ejecuten siempre, sin que tengáis que estar en el mismo directorio que los scripts.
Quick-Tip: SSH Tunneling Made Easy
I was surprised at how long it took me to find a good HOWTO on setting up a simple SSH tunnel that I wanted to write up this Quick-Tip.Using OpenSSH on a Linux/Unix system you can tunnel all of the traffic from your local box to a remote box that you have an account on.
For example I tunnel all of my outbound E-mail traffic back to my personal server to avoid having to change SMTP servers, use SMTP-AUTH, etc. when I am behind firewalls. I find that hotel firewalls, wireless access points, and the other various NATing devices you end up behind while traveling often do not play nice.
To do this I use the following:
ssh -f user@personal-server.com -L 2000:personal-server.com:25 -N
The -f tells ssh to go into the background just before
it executes the command. This is followed by the username and server
you are logging into. The -L 2000:personal-server.com:25 is in the form of -L local-port:host:remote-port. Finally the -N instructs OpenSSH to not execute a command on the remote system.
This essentially forwards the local port 2000 to port 25 on personal-server.com over, with nice benefit of being encrypted. I then simply point my E-mail client to use localhost:2000 as the SMTP server and we're off to the races.
Another useful feature of port forwarding is for getting around pesky firewall restrictions. For example, a firewall I was behind recently did not allow outbound Jabber protocol traffic to talk.google.com. With this command:
ssh -f -L 3000:talk.google.com:5222 home -N
I was able to send my Google Talk traffic encrypted through the firewall
back to my server at home and then out to Google. 'home' here is
just an SSH alias to my server at home. All I had to do was reconfigure my
Jabber client to use localhost as the server and the port 3000 that I had
configured.
Hopefully this helps you to better understand SSH tunneling. If you found this page useful, you may also be interested in how to make your SSH connections faster. If you find any errors or have any suggestions regarding this please feel free to E-mail me at frank@revsys.com.
Books on SSH
Here are some helpful books if you need further help with SSH.Muchas gracias a Frank Wiler por este post. Espero no le importe que lo republique. Si lees esto y no te parece bien, por favor, dímelo y lo retiraré en el instante.