PlayStation User agent

Headers:

host : gustavomejia.com
user-agent : Mozilla/5.0 (PLAYSTATION 3; 1.00)
connection : Keep-Alive
accept-encoding : identity
x-ps3-browser : 2.60 (WP; system=2.60)
accept-language : en
content-length : 0

Ubuntu javamail Exception

If you get:

java.lang.NullPointerException
        at java.lang.String.concat(String.java:1827)
        at com.sun.activation.registries.MailcapFile.parseLine(MailcapFile.java:254)
        at com.sun.activation.registries.MailcapFile.parse(MailcapFile.java:216)
        at com.sun.activation.registries.MailcapFile.createMailcapHash(MailcapFile.java:176)
        at com.sun.activation.registries.MailcapFile.<init>(MailcapFile.java:50)
        at javax.activation.MailcapCommandMap.loadFile(MailcapCommandMap.java:189)
        at javax.activation.MailcapCommandMap.<init>(MailcapCommandMap.java:139)
        at javax.activation.CommandMap.getDefaultCommandMap(CommandMap.java:55)
        at javax.activation.DataHandler.getCommandMap(DataHandler.java:146)
        at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:578)
        at javax.activation.DataHandler.writeTo(DataHandler.java:304)
        at javax.mail.internet.MimeUtility.getEncoding(MimeUtility.java:230)
        at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1065)
        at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:1923)
        at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:1904)
        at javax.mail.Transport.send(Transport.java:79)

It can be fixed modifying the $HOME/.mailcap file. Try commenting out the line that contains "-e" or removing the file.

MySQL: Could not parse relay log event entry

Relay log corruption in MySQL

This error marks a corrupted binary log on the slave. There can be many reasons for this. Assuming that master logs are correct, you can simply reset the relay position on slave by:

mysql> stop slave;
mysql> show slave status;
##-- Read values: Relay_Master_Log_File and Exec_Master_Log_Pos
mysql> CHANGE master TO master_log_file=<Relay_Master_Log_File>, master_log_pos=<Exec_Master_Log_Pos>;
mysql> start slave;

Update Image Headers

Tool to manipulate JPEG headers:

jhead

For example, to update correct time when picture was taken: (To increase it by 2 hours and a half)

jhead -ta+2:30 filename.jpg

Installing mod_jk in Apache 2.2 running on Debian

Assumptions:

  • You have a working fresh installation of Apache2
  • You have a working installation of Java
  • You have a working installation of Tomcat


Install mod_jk from repositories:
sudo apt-get install libapache2-mod-jk

Configure worker.properties:

Open file:
/etc/libapache2-mod-jk/workers.properties
In this file you mainly have to modify the following properties and make them point to your local configurations:
workers.tomcat_home
workers.java_home
Configure apache2

Create the file jk.conf with the following content:
<IfModule mod_jk.c>
  JkWorkersFile /etc/libapache2-mod-jk/workers.properties
  JkLogFile /var/log/apache2/mod_jk.log
  JkLogLevel info
  JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
  JkRequestLogFormat "%w %V %T"
  # Mount your applications
  JkMount /_path_to_your_webapp ajp13_worker
  JkShmFile /var/log/apache2/jk.shm
</IfModule>
and place in folder:
/etc/apache2/mods-available
add a symbolic link to this file in
/etc/apache2/mods-enabled
Finally, restart apache