viernes, 6 de agosto de 2010
Forcing Apache 2.2 to use browser enconding
Anyway here we go again, Apache by default comes configured with the most popular charset encoding : UTF-8.
This setup can cause some problems when you are not born in the countries where the languaje of Shakespeare is used. If you find yourshelf asking why accents, and european signs are being transformed in question marks, then it's time to comment this setting on httpd.conf:
#AddDefaultCharset UTF-8
and add your setting :
AddDefaultCharset ISO-8859-1
Cheers , and happy holidays!!!
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