UNIX tutorials

Open vim editor to first occurrence of search term

contributed by qmchenry on October 2, 2008 under UNIX

I don’t want to admit how long I’ve been using vi as my go-to editor (although if vi had been born then, it would now be old enough to drink and vote). One of the things I love about vi is that you only need to know a few things to use it, but it has so many little tricks that you never seem to run out of new things to try. The ones that make your life easier will stick. I had never seen this one before — it’s a simple command line option for vim that includes a search term. When used, your cursor will be positioned at the first occurrence of the term.

 

Ubuntu : Enable NTFS read/write options (accessing XP and Vista drives)

contributed by Jimmy Selix on September 22, 2008 under Linux

This recipe explains how to enable NTFS read/write options in Ubuntu and in turn allows one to read/write to any XP or Vista partitions one may have. This will be shown using Terminal to install. Applies to Ubuntu 7.04 and up (Gutsy Gibbon, Feisty Fawn, Hardy Heron)

 

How to empty or clear the contents of an existing UNIX file

contributed by qmchenry on August 18, 2008 under UNIX

If you want to empty the contents of a UNIX file, you could delete it and recreate it, but, as is typical of UNIX, there are more elegant alternatives. Here are a couple of ways to dump the innards of a file. If you know of any others, add them to the comments.

 

OpenOffice.org: Play TicTacToe (Easter Egg)

contributed by Rob Rogers on August 14, 2008 under OpenOffice

If you’re running the recent version of OpenOffice and feel like taking a break and playing then you’re in luck. There’s an Easter Egg that let’s you play a simple game of TicTacToe against the application.

 

OpenOffice.org: Play StarWars Galaxy (Easter Egg)

contributed by Rob Rogers on August 11, 2008 under OpenOffice

If you’re running the recent version of OpenOffice and feel like taking a break and playing then you’re in luck. There’s an Easter Egg that let’s you play a simple version of Space Invaders, titled StarWars Galaxy.

 

begin_script to mirror two drives on a Netra T2000

contributed by weezlboy on July 29, 2008 under Solaris system administration

This is a quick script to configure mirroring of two drives in a Netra T2000 under Solaris. You may need to alter the device settings for your system, but once you have a script like this that works, it can save lots of time when rolling out multiple servers and serves as a mental backup for the future when you need to repeat the configuration.

 

Defend Your Web Server Against Distributed Denial of Services (DDos) Attacks

contributed by qmchenry on July 8, 2008 under Linux security

In computer security, it quickly becomes apparent that preventing computer attacks is much more challenging than attacking computers. A good example of an easy technique to prevent a website from functioning is a distributed denial of service, or DDoS, attack in which a number of compromised computers around the internet make web (or other protocol) requests on some poor server. If the web page requested is one that requires lots of server-side processing, the resulting load from the combined requests prevents the web server from responding to legitimate requests, thus denying the service. As Tech-Recipes.com was subjected to such an attack recently, we felt it might be beneficial to others if we described the steps we took in our response.

 

Ubuntu: Creating a repository using APTonCD

contributed by incursor on April 7, 2008 under Linux

Having a repository of packages you’ve downloaded using apt is good for when you need all of your favorite applications in a flash. Here’s how: