The following articles describes my XBMC setups.
These are the steps I took to flash a Linksys E2000 router with a DD-WRT firmware.
– 30/30/30 Reset
– Upload dd-wrt.v24-18024_NEWD-2_K2.6_mini-e2000.bin via Linksys firmware upgrade page from ftp://ftp.dd-wrt.com/others/eko/BrainSlayer-V24-preSP2/2011/12-20-11-r18024/broadcom_K26/
– Wait 5 minutes after upload completed.
– Web interface for DD WRT appears.
– Do a 30/30/30 reset again.
– Wireless > Advanced Settings enter 50 in the Tx Power entry. This should make for less Tx/Rx Errors and help the unit run cooler.
– Initital DD WRT firmware flash must be a trailed build. A trailed build has “*e2000.bin” in its name. Following flashes must have “*e2k-e3k.bin” in their name.
Sometimes you run into a test that works when run from within Eclipse but not from the command line. To debug the failing test from Eclipse, you can configure the Junit ant task to accept remote debugging sessions.
This can be done by adding the following lines to the junit task:
<junit fork="true"> <!-- For remote debugging from Eclipse --> <jvmarg value="-Xdebug" /> <jvmarg value="-Xnoagent" /> <jvmarg value="-Djava.compiler=NONE" /> <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y" />
This will make the task wait for an incoming debug connection on port 8787. It is necessary to have the fork attribute on the junit task set to true, because the jvmarg values can only be given to a starting Java virtual machine.
Problem: You have an XML structure in a JQuery object and now you want to extract a string with the raw xml.
Solution: Use the XMLSerializer class. This class provides methods for serializing DOMs and nodes into text or byte streams. In our case, we will call the serializeToString(data) method:
Find all files from current directory and subdirectories
find . -name '*.doc' -print
Finding files by date: http://www.cyberciti.biz/faq/howto-finding-files-by-date/
Show total disk usage of a directory:
du -sh /tmp/somedir
The tools I use for computer forensics.
Casting the array obtained by invoking the toArray() method on a collection yields a ClassCastException.
String strings = listOfStrings.toArray();
will throw the ClassCastException.
The trick is to use the overloaded version of toArray(), which takes an array as parameter. This the javadoc description of the method
"Returns an array containing all of the elements in this list in the correct order; the runtime type of the returned array is that of the specified array."
The solution is therefore to do this:
String sv = (String)v.toArray(new String);
Lightrooms data files can roughly be put into two categories: The catalog file(s), which contain meta data about your images such as their location and the actual image files.
Lightroom does not permit having the catalog files on network attached storage, so you will have to keep those on your workstation. However, you can choose to have Lightroom backup your catalog files to the NAS so they are stored together with your images. This can be configured by going into Edit > Catalog Settings in Lightroom.
The following steps explain how to move your images from your workstation to a location on the NAS.
If something goes wrong you can always replace the catalog file with the backup from step 1 and rename the images_OLD back to using your local image folder.
As to be expected, there is a slight performance drop, by having the images on a network share instead of a local harddisk. In order to quantify the difference I picked 10 test photos (RAW) and measured the the time it took to zoom in on the image in Library mode. Zooming in on an image forces the actual image to be loaded into memory instead of just showing a preview.
Not much of a difference and hardly noticable. I have not timed any other operations, but it appears, that the main loading happens only once. I.e., there is no lag when cropping or fixing white balance, since the image has already been loaded into memory.
It is possible to configure the harddisks to spin down after a period of inactivity, but if one or more processes keep reading and writing from the disks, that will prevent them from entering standby mode.
To find out which processes are causing disk activity, the following script is very useful:
The script works like this:
The following link contains a list of daemons and configurations known to cause random disk activity: Standby Mode FAQ
Older versions of Squeezebox Server caused lots of disk activity, but fortunately that has been resolved in version 7.5.1.
What is jdb2 and flush?
Sometimes the processes “jbd2” and “flush” are waking up the harddisk. As I understand, these processes are responsible for doing delayed writes to the disk in order to optimize performance. In other words, they are writing to the disk on behalf of other processes which makes it difficult to find the culprit(s). In my case, it was the samba daemon accessing the disk. As long as a PC or media streamer on your network has an open view on any of your samba shares, it will cause the disks to wake up.
Plug the USB stick into the Qnap. Then in a terminal, as root, do an lsusb to confirm that the USB drive has been recognised.
To find out what device name it has been assigned, do a dmesg | tail. This will print the latest lines from the kernel log, which should contain information about the inserted USB drive:
fdisk -l, which shows all connected drives, can also be used to find the right device name. The USB drive can be recognised by its size. In this case, it is a 2 GB one:
If the USB drive is already formatted with e.g. NTFS, it has probably been mounted automatically, in which case it should be unmounted. You can check this with the df command:
Once we know the name of the drive and it is unmounted, we can create a new linux partition using fdisk: