"Get Contact Info" vs "Set Contact Info"
Tuesday, October 2, 2012
Monday, August 6, 2012
Friday, June 15, 2012
Mounting Popcorn Hour NFS share under Ubuntu 12.04
greg@antares:~$ sudo mount -t nfs -o vers=3 192.168.90.101:/share /media/popcorn
Thursday, June 7, 2012
ByteArrayOutputStream.toString() human readable
I can do this for a readable output:
public class Changer {
public static void main(String[] args) {
try {
java.io.InputStream in = new java.io.FileInputStream(new java.io.File("DBSDashboard.XML"));
java.io.OutputStream out = new java.io.ByteArrayOutputStream();
org.jdom2.input.SAXBuilder builder = new org.jdom2.input.SAXBuilder();
org.jdom2.Document document = (org.jdom2.Document) builder.build(in);
org.jdom2.Element rootNode = document.getRootElement();
org.jdom2.Element ccc= rootNode.getChild("CallCentreClosed").getChild("callCentreClosed");
ccc.setText("true");
/* or, ccc.setText("false") */
org.jdom2.output.XMLOutputter xmlOutputter = new org.jdom2.output.XMLOutputter();
xmlOutputter.setFormat(org.jdom2.output.Format.getPrettyFormat());
xmlOutputter.output(document, out);
System.out.println(out);
} catch (Exception e) {
e.printStackTrace();
}
}
}
And voila:
false
Good to know.
public static void main(String[] args) {
try {
java.io.InputStream in = new java.io.FileInputStream(new java.io.File("DBSDashboard.XML"));
java.io.OutputStream out = new java.io.ByteArrayOutputStream();
org.jdom2.input.SAXBuilder builder = new org.jdom2.input.SAXBuilder();
org.jdom2.Document document = (org.jdom2.Document) builder.build(in);
org.jdom2.Element rootNode = document.getRootElement();
org.jdom2.Element ccc= rootNode.getChild("CallCentreClosed").getChild("callCentreClosed");
ccc.setText("true");
/* or, ccc.setText("false") */
org.jdom2.output.XMLOutputter xmlOutputter = new org.jdom2.output.XMLOutputter();
xmlOutputter.setFormat(org.jdom2.output.Format.getPrettyFormat());
xmlOutputter.output(document, out);
System.out.println(out);
} catch (Exception e) {
e.printStackTrace();
}
}
}
And voila:
(...)
Good to know.
Sunday, June 3, 2012
MKP, y u no have English?!
Az előbb - unalomból - megnéztem az MKP hivatalos honlapjának angol nyelvű verzióját. A jobb felső sarokban: random kép. Csáky-Bugár dwa bratanki, azaz két jó szivar. Pártszakadás volt? Ezek szerint nem. So keep smiling.
Monday, April 23, 2012
Ubuntu open router
ip_forwarding = 1
sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
... think about your network design before you start kicking your head against the wall.
Poor external router does not know anything about internal addresses.
Fsck.
sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
... think about your network design before you start kicking your head against the wall.
Poor external router does not know anything about internal addresses.
Fsck.
Wednesday, February 1, 2012
How to delete files older than n days (Windows hack)
forfiles /d -100 /m *.csv /c "cmd /c del @path"
Subscribe to:
Posts (Atom)