Monthly Archives: December 2007

Useful Linux Commands 1

Here is a list of interesting things you can do on a linux command line. I will continue this list as I come across new ones:

find /var/files/000 -name *.xml | xargs rm -f
Delete all XML-files in all subdirectories of /var/files/000

ls -laR | wc -l
Count all files under the current directory. Be patient on large dir-structures.

Teach Yourself Programming in Ten Years

I came across this interesting article by Peter Norvig – Teach Yourself Programming in Ten Years.
Here are the keypoints:

  • “Write several significant programs, and learn from your successes and failures.”
  • “Work with an experienced programmer and understand what it is like to live in that environment.”
  • “In 3 days you might be able to learn the syntax” (…) “but you couldn’t learn much about how to use the syntax”
  • “Researchers have shown it takes about ten years to develop expertise in any of a wide variety of areas, including chess playing, music composition, painting, piano playing, swimming, tennis” (…) “There appear to be no real shortcuts.”
  • “Get interested in programming, and do some because it is fun.”
  • “Talk to other programmers; read other programs. This is more important than any book or training course.”
  • “The best kind of learning is learning by doing.”
  • “The most effective learning requires a well-defined task with an appropriate difficulty level for the particular individual, informative feedback, and opportunities for repetition and corrections of errors.”
  • “In any case, book learning alone won’t be enough.”
  • “Be the best programmer on some projects; be the worst on some others. When you’re the best, you get to test your abilities to lead a project, and to inspire others with your vision. When you’re the worst, you learn what the masters do, and you learn what they don’t like to do (because they make you do it for them).”
  • ” Work on projects after other programmers.” (…) “See what it takes to understand and fix it when the original programmers are not around. Think about how to design your programs to make it easier for those who will maintain it after you.”
  • ” Learn at least a half dozen programming languages.” (…) “You learn about what other people like in a language, how deeply they feel so, and perhaps even a little about why they feel so.”

Mount Terastation on Debian Linux

On my network I have a Buffalo Terastation as network-share for backups. Today I figured out how to mount it on another Linux-box (Debian Etch) so I could do file operations directly on my backup. The following worked out for me:

  • Created dir /mnt/terastation2
  • Added the following line to /etc/fstab
    //TERASTATION2/SHARE /mnt/terastation2 smbfs username=marco,password=,uid=marco,gid=businex,dmask=707,fmask606
  • And executed
    mount -a
    as root.

If you like to mount it only once in an while, you can also do it via the command:

  • smbmount //TERASTATION2/share /mnt/terastation2 -o lfs
    You need to have smbmount installed.

Both should have the effect that you can access the Terastation on /mnt/terastation2. No more Windows clients involved for copying files around.