Run top in batch mode


Run top in batch mode
top is a handy utility for monitoring the utilization of your system. It is invoked from the command line and it works by displaying lots of useful information, including CPU and memory usage, the number of running processes, load, the top resource hitters, and other useful bits. By default, top refreshes its report every 3 seconds.


Most of us use top in this fashion; we run it inside the terminal, look on the statistics for a few seconds and then graciously quit and continue our work.

But what if you wanted to monitor the usage of your system resources unattended? In other words, let some system administration utility run and collect system information and write it to a log file every once in a while. Better yet, what if you wanted to run such a utility only for a given period of time, again without any user interaction?

There are many possible answers:
You could schedule a job via cron.
You could run a shell script that runs ps every X seconds or so in a loop, incrementing a counter until the desired number of interactions elapsed. But you would also need uptime to check the load and several other commands to monitor disk utilization and what not.

Instead of going wild about trying to patch a script, there's a much, much simpler solution: top in batch mode.

top can be run non-interactively, in batch mode. Time delay and the number of iterations can be configured, giving you the ability to dictate the data collection as you see fit. Here's an example:

top -b -d 10 -n 3 >> top-file 

We have top running in batch mode (-b). It's going to refresh every 10 seconds, as specified by the delay (-d) flag, for a total count of 3 iterations (-n). The output will be sent to a file. A few screenshots:



And that does the trick. Speaking of writing to files ...


Edit text


 Edit  text


Various Editors are
  The Nano Editor
    Easy to learn,easy to use.
    Not as feature-packed as some advanced editors.
  Other Editors
    gedit, a simple graphical editor
    Vim , an advanced, full feature editor.
    gvim, a graphical version of the vim editor.

How to change password


How to change password


Passwords control access to the system.
General guidelines for best quality:
   Change the password the first time you log in.
   Change it regularly thereafter.
   Select a password that is hard to guess.
To change your password using GNOME, navigate to System Preferences ABout Me and then Change Password.
To change password from terminal: passwd

Use Websites Without Signing Up for New Accounts

Use Websites Without Signing Up for New Accounts

Registering for websites is a pain in the neck, even if you use a dedicated spam email address to cut down on ads. Sometimes you just want to watch a cat video and be done with it. Here's a quick, easy workaround to having to register each time you end up at a new website: Turn to BugMeNot.

BugMeNot has a database of legitimate usernames and passwords for various sites that require you to register in order to access content. You can use BugMeNot in several ways.

The simplest approach is to go to the BugMeNot website and enter the name of the site where you want to log in. BugMeNot will produce a list of usernames and passwords that you can use instead of registering yourself.

If you'd rather not go all the way over to the website each time, you can download an extension for Firefox (BugMeNot Firefox) or Chrome. On other browsers you can use a bookmarklet (located in the menu of the BugMeNot website; just drag the bookmarklet into your browser's bookmark toolbar) to get instant BugMeNot login credentials.

BugMeNot does not give out credentials for sites that are behind a paywall, however, so you can't avoid paying for content by using this service.
 

Learn Nifty Keyboard Shortcuts and Mouse Gestures

Learn Nifty Keyboard Shortcuts and Mouse Gestures

Sometimes you're just too lazy to reach all the way across your desk and grab your mouse--so why not open a new tab by using a keyboard shortcut instead? Here are a few keyboard shortcuts that will improve your browser productivity.

Tab and Window Management
Ctrl-T: Open a new tab
Ctrl-N: Open a new window
Ctrl-W: Close the current tab
F5: Refresh the current page
Ctrl-L: Highlight the URL bar
Ctrl and +: Zoom in
Ctrl and -: Zoom out
Ctrl-0: Return to the default zoom level
Navigation
Ctrl-[: Go back one page
Ctrl-]: Go forward one page
Spacebar: Move down one full screen
Home: Jump to the top of a Web page
End: Jump to the bottom of a Web page

 

Find a Missing URL Bar (or Other Toolbars)

Find a Missing URL Bar (or Other Toolbars)

Maybe you clicked a bunch of things you shouldn't have, or maybe your cat jumped on your keyboard, because now you can't seem to find your URL bar.
In Internet Explorer, right-click any toolbar and check Address bar. If you're using Internet Explorer 9, you'll always see the address/search bar, but older versions of IE have the option of hiding it.
In Firefox, go to View, Toolbars and check Navigation Toolbar. You can also right-click any toolbars you do see, and check Navigation Toolbar in the drop-down menu.
In Safari, hold down the Command (Ctrl if you're on Windows) button, the Shift button, and the Backslash (\) button. The URL bar will reappear

 

 

Create a Shortcut to lock your Computer

Create a Shortcut to lock your Computer

Have you ever left your PC in a hurry? Have you ever felt that it is a pain to lock your system in the simple way of doing CTRL+ALT+DEL? I would imagine that you have and then, this trick is for you. This trick enables you to create a shortcut to lock your computer instead of doing the regular CTRL+ALT+DEL, thus providing you a way to quickly and easily get away from your PC whenever you are in a hurry.

To use this trick, follow the instructions given below:-

Steps
  1. Right Click on an empty slot on Desktop, point to New and click on Shortcut.
  2. In the dialog box that pops up, type the following code without quotes in the Type the location of the item.
rundll32 user32.dll,LockWorkStation
     3.  Click on Next and type a name for the shortcut in the Type a name for this 
          Shortcut textbox.
     4.  Click on Finish.