Posts filed under 'Mind Hacks'

Living in the Internet Cloud

When we are on-the-go professionals, and are potentially required to work from home or from other locations on the road, isn’t it good to be able to reach your data no matter where you are?

Thus is the interest in being able to “live in the cloud”, keeping data and information on Internet computers out there somewhere.  Unfortunately, it also means that instead of making our own backups, we must rely on someone else’s backups.  Suppose the company goes out of business?  This has already happened for several photo sites - and in one case, it took the customer’s photos with them.

There are many sites that can provide a safe harbour for data or for information of various kinds.  My favorites are these:

The online desktops Goowy and eyeOS deserve special mention.  Not only do they provide a desktop, but also all the standard applications you might need.  It is possible to run within one of these desktops and save your data entirely with one of these setups.  This makes for a fantastic central location for everything - and a larger-than-normal risk.

EyeOS has one more feature that most of these do not: it is open source.  If you want to run your own version of EyeOS, there’s no problem doing so.  This is incredibly useful if you have your own server to run this on.  Then you can centralize your information and retain control at the same time.

I also find the mail clients in Goowy and eyeOS to be quite useful for sending mail from anywhere with a browser.

Blogged with the Flock Browser

Tags: , , ,


3 comments 26 March 2008

Quickly creating large files

I’m surprised how many people never think to do this…. but it makes it quite easy.

If you need a large text file, perhaps with 1,000s of lines (or even bigger) - just use doubling to your advantage! For example, create 10 lines. Then use vi (or other editor) to copy the entire file to itself - now 20 lines. If you remember how a geometric progression goes, you’ll have your 1,000s of lines rather fast:

  1. 10 lines…
  2. 20 lines…
  3. 40 lines…
  4. 80 lines…
  5. 160 lines…
  6. 320 lines…
  7. 640 lines…
  8. 1280 lines…
  9. 2560 lines…
  10. 10240 lines…

Ten steps and we’re at 10,000+ lines. In the right editor (vi, emacs, etc.) this could be a macro for even faster doubling. This doubling could also be used at the command line:

cat file.txt >> file.txt

Combined with shell history, that should double nicely - though using an editor would be more efficient (fewer disk reads and writes).

When writing code, often programmers will want to set things off with a line of asterisks, hash marks, dashes, or equals signs. Since I use vi, I like to type in five characters, then copy those five into 10, then copy those 10 and place the result three times. There you have 40 characters just like that.

If only a certain number of characters is needed, use dd:

dd if=/dev/random of=myfile.dat bs=1024 count=10

With this command (and bs=1024), the count is in kilobytes. Thus, the example will create a 10K file. Using the Korn shell, one can use this command to get megabytes:

dd if=/dev/random of=myfile.dat bs=$(( 1024 * 1024 )) count=100

This command will create a 100M file (since bs=1048576 and count=100).

If you want files filled with nulls, just substitute /dev/null for /dev/random in the previous commands.

You could use a word dictionary for words, or a Markov chain for pseudo-prose. In any case, if you only want a certain size, do this:

~/bin/datasource | dd if=- of=myfile.dat bs=$(( 1024 * 1024 )) count=100

This will give you a 100M file of whatever it is your datasource is pumping out.


10 comments 23 November 2007

Stress relief for System Administrators

Who, me, stress?  Nah….. sysadmins never have any stress, right?

Well, just in case you do - my feelings are that laughter is the best medicine - and I mean laugh out loud funny.  So what do you do?

There are a lot of ways to tickle the funny bone, and they’re personal as well.  Here are several that I use:

  • Subscribe to RSS feeds like Sharky’s Column and The Daily WTF.
  • Favorite comics (for me, that means: Liberty Meadows, Calvin and Hobbes, and Get Fuzzy)
  • Personal copies of laugh out loud funny comics
  • Funny movies

If you can indulge in some of these away from the office, it is much better.  Fresh air is good, too - as is doing something totally unrelated to work (even if it is other work).

Burn-out is a real danger to system administrators; so get away from the tension and away from the office!


2 comments 14 November 2007

The Secrets of Mental Math

I’ve read more than a few books on mental arithmetic, and have found some that I like. Strangely enough, they are not common in libraries, despite the fact that one of them is written by an author virtually every one will recognize instantly.

I’ve been reading most recently Secrets of Mental Math by Arthur Benjamin and Michael Shermer. Arthur Benjamin recently gave a keynote speech at a national tech event (was it OSCON?). I wanted to see his book and what he had to offer that I hadn’t read recently. I didn’t like it as much as I thought - more of the book was dedicated to “tricks” (to amaze your friends!) than I would have liked. Most books of this sort focus on making daily calculations much easier. I also found his writing to be not as clear as the others I have read on this topic.

One interesting item put into Secrets of Mental Math is the method of finding the day of the week for any future year. This topic is also considered in The Memory Book by Harry Lorayne and Jerry Lucas, but in The Memory Book the method is to memorize a number representing the days that Monday falls on throughout the year (that is, a 12-digit number). Secrets of Mental Math proposes a mathematical formula, utilizing a code number for the month and a code number for the year. The code number for the month (and for the year) is never completely explained, but would probably be based on the day of the week that the month will have given that the year starts on Monday (or something like that) - plus a shift factor coded into the year code.

So your choice - choose the memorization method in The Memory Book or the calculation method found in Secrets of Mental Math. Of course, the latter handles every date in every year without memorization - but people would rarely use such a method for anything other than the current year, most likely.

The book I have in my collection that I prefer in this area is Calculator’s Cunning by Karl Menninger, translated from German by E. J. F. Primrose (with foreward by Martin Gardner). I am surprised that this book is not more widely available; it appears to be out of print. Karl’s writing (and Primrose’s translation) is very easy to read, understandable, and clear - and mathematical proofs are offered at the end of each section where the trick is introduced.

Another which is almost as hard to find in the library as the tome by Karl Menninger is a book by the venerable Isaac Asimov titled Quick and Easy Maths. This book may or may not be available at your local library, but chances are good you’ll have to go to interlibrary loan to get it, or even buy used. The book is out of print, just as Calculator’s Cunning is. Asimov is one of the clearest writers I’ve seen, and Quick and Easy Maths is no exception.

Also, the methods described in all three mental mathematical books are essentially the same - even so, the experience of reading of all three is all worthwhile.

Then next time you have to calculate the number of hosts in a subnet, you’ll be able to do it in your head - or adding up an invoice!


2 comments 31 August 2007

Learning Something New

Every day, a system administrator may come across something new, or a way to apply some new knowledge. Don’t stop learning, and take whatever steps are necesary in order to learn whatever you can.

Don’t stop at knowing just enough to get by - what buttons to push, what commands to execute - aim to master something new. Dave Thomas (the writer of the Ruby “pick axe book”) suggests learning a new programming language every year.

Do you use Korn shell in your daily work. Master it! Learn the intricate details. Learn ways to be more efficient, to do things faster, to do things quicker. Learn the intimate details of awk scripting. Learn the many details of sed.

Are you bored with the everyday? Then stretch your mind and start in on something unusual - even unnecessary. Learn how to run the TECO text editor (EMACS was written in it!). Learn COBOL and use OpenCOBOL.

Learn something new and useful but unutilized - such as Lua or TCL.

Alternately - since we are all system administrators here - put a new server environment to work in your home network. Install Kerberos and the Andrew File System. Start working with the Berkeley amd automounter. Set up an IPv6 network.

What does all of this learning get us?

  • Opportunities for improving speed of current operations
  • Opportunities to improve implementation time (of scripts etc.)
  • Faster debugging
  • Knowledge ready for new business initiatives
  • Stretches your mind into new directions
  • Sharper mind throughout a lifetime

So what are you waiting for? Pick something to learn and stick to it - and do it just for you. Sooner or later, if you keep it up, your employer will notice.


Add comment 28 July 2007


David Douthitt

David is an experienced UNIX and Linux system administrator, a former Linux distribution maintainer, and author of two books ("Advanced Topics in System Administration" and "GNU Screen: A Comprehensive Manual").

View David Douthitt's profile on LinkedIn

Top Posts

Calendar

May 2008
M T W T F S S
« Apr    
 1234
567891011
12131415161718
19202122232425
262728293031  

Recent Posts

Recent Comments

ddouthitt on Core Linux - packages
GRUBówka « Bl… on Installing GRUB on FreeBS…
monsun on Installing GRUB on FreeBS…
hictio on Core Linux - packages
locky on Installing GRUB on FreeBS…

Category Cloud

BSD Career Debian Debugging Fedora FreeBSD HPUX Learning Linux MacOS X Mind Hacks Mobile Computing NetBSD Networking OpenBSD OpenSolaris Open Source OpenVMS Personal Notes Portable Presentations Programming Red Hat Scripting Security Solaris Tips Ubuntu UNIX Wheel Group

Archives

Links