«Consider yourself Perfectible makes you Perfect!»
Posts tagged memory
Pascal’s Triangle generator
Jan 11th
What’s Pascal’s Triangle? That’s what it is (Wikipedia has all the theory, if you need).
Pascal’s Triangle first 6 rows
The thing I wrote here is a generator of the n-th row of the triangle, that doesn’t use more then the memory needed to store the solution. Instead of allocating a Triangular Matrix, and building every row based on the one above, solution is built in place.
Debian on my NSLU2: The Revenge of the Swirl
May 17th
After some playing with Unslung on my Linksys NSLU2, I realize it was a “very limited solution” for our needs. We need to share 4 (sometimes 5) NTFS (or others) volumes, where everyone of them is 500GB: this is too much even for the modified firmware of Unslung, unable to read the full directory trees (and the contained files) of my massive movie’s collection.
So, I came back to the Debian/NSLU2 solution. This time, with all the intention to make it work.
It’s quite pointless to report here all the things I did to make it work in the way I want/need. I’ll just write down the most important bits:
- Memory Optimization:
- remove unused kernel modules (blacklisting in
/etc/modprobe.d/blacklist) - remove unnecessary services/daemons (like
exim4ornfsd)
- remove unused kernel modules (blacklisting in
- Mount volumes “
by-label“, to avoid messes in mounting if the/devfiles associated with the particular devices changes (reboot, unplug/replug, etc.) (take a look at this page for more info) - Use the
noatimeoption in the/etc/fstabfile to avoid the system to update the “last-access” field in the i-nodes: this is very important to reduce I/O on Flash memories - Reduce the swappiness of the kernel (reduce the I/O)
- Install
fuseand compilentfs-3gby hand: on Debian stable it’s not available yet (I could have usedstable-backportsbut no one compiledntfs-3gfor ARM
) - Configure one Samba share for Disk. This avoid the problem of Samba calculating “free-space” when the sub-directory of a share is the mount point of a different disk.
- De-underclock the NSLU2: the CPU (XScale-IXP42x Family rev 1 (v5l)) is soldered to the board with a pin configuration that makes it run half of is speed. I just removed the Resistor that realize that particular configuration. More info here and here.

