jueves, 24 de junio de 2010
How to configure system services
martes, 15 de junio de 2010
Stunnel with Linux
stunnel -p /etc/stunnel/stunnel.pem -D 7 -o /var/log/stunnel4/stunnel.log -A /ca/cacert.pem -d 25443 -f -r 2080
To test the server we can issue the following command
openssl s_client -connect 192.168.56.126:25443
Cheerssss
Del.icio.us
jueves, 27 de mayo de 2010
Create a Loopback filesystem from a file. Linux
miércoles, 26 de mayo de 2010
Using NTP for time sync
# and when no outside source of synchronized time is available.
server 127.127.1.0
# local clock
#fudge
127.127.1.0 stratum 10
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
driftfile /var/lib/ntp/drift
ntpdate -d 132.236.56.250After that we will need to perform an initial sync , with the command: ntpdate 192.168.56.101viernes, 30 de abril de 2010
Generic script for managing a Unix service
Create a file with the following contents:
#!/bin/bash
export user_name="root"
export srv_name="serv"
export exec_dir_stop="/home/$user_name/bin/stop_serv.sh"
export exec_dir_start="/home/$user_name/bin/start_serv.sh"
case "$1" in
start)
echo -n "Starting $srv_name Service Daemon"
/usr/bin/sudo -u $user_name $exec_dir_start
;;
stop)
echo -n "Shutting $srv_name Service Daemon"
/usr/bin/sudo -u $user_name $exec_dir_stop
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
Save it with a descriptive name on /etc/init.d (or /etc/rc.d) , for instance http_filter . Change the access rights to the user in charge of managing the service, and create a softlink on the run level you want the service to be started.
martes, 6 de abril de 2010
How to use ffmpeg to convert a video stream from avi to flv
martes, 16 de marzo de 2010
Curl https client certificate negotiation
curl --cert buenokpl.pem --key buenokpr.pem --pass fulano123 -k -v https://www.google.es
Reading socket identifier from proc fs
ls -ltr|grep -i socket
fetch the socket id on the rigth side and do a netstat -ae|grep -i
miércoles, 10 de marzo de 2010
Getting server certificates with openssl
jueves, 18 de febrero de 2010
Mounting an iso file.
No more words needed...
mount -o loop -t iso9660 /var/spool/isoFile.iso /mnt/cdrom
lunes, 15 de febrero de 2010
Copy MBR from one disk to another
dd if=/dev/sda of=/dev/sdb bs=512 count=1
Getting Virtualized!!!
There are a few steeps that are needed in order to achive this goal:
- Define a virtualized hardware: CPU, Memory, IO, Networking.
- Export the data: this is the most critical process.
In order to get an vmkd file or vdi of an existing physical instalation consists in a few steps that i will explain here:
- First, boot the operating system with a live linux cd.
- Second, identify the partition or partitions involved in the recovery. For instance hd3
- Third, make a good use of dd like this one:
dd if=/dev/hdc of=/mnt/USB/diskImage/win2k3.img bs=1024
the partition will be dumped into a file.
- Fourth: qemu-img convert -f raw /mnt/USB/diskImage/w2k3.img -O vmdk /mnt/external/diskImage/w2k3.vmdk