Remember remember
Headless java on servers... Avoid the pain
-Djava.awt.headless=true
Headless java on servers... Avoid the pain
-Djava.awt.headless=true
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
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.
Simply run:
python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"
On the folder you want to share the files. Then access from a remote machine through HTTP.
Debian: xclip
So:
date | xclip
xclip -o
More:
http://people.debian.org/~kims/xclip/
Quick host discovery with nmap:
nmap -sP 192.168.0.0/24
When updating packages via aptitude os apt-get
Error:
Reading package lists... Error!
E: Dynamic MMap ran out of room
Fix:
Add the following line to /etc/apt/apt.conf:
APT::Cache-Limit 20000000;
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
sudo apt-get install libapache2-mod-jk
Configure worker.properties:/etc/libapache2-mod-jk/workers.propertiesIn this file you mainly have to modify the following properties and make them point to your local configurations:
workers.tomcat_homeConfigure apache2
workers.java_home
<IfModule mod_jk.c>and place in folder:
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>
/etc/apache2/mods-availableadd a symbolic link to this file in
/etc/apache2/mods-enabledFinally, restart apache