Saturday, March 29, 2014

Top 8 Websites That Hackers Will Love!

two buzzwords, hacking and security have received quite a lot of attention recently. There are many websitses that an independent hacker can go to for information, tools etc. Here are the top eight websites that you can refer to.

learn hacking, top websites to learn hacking, hacking websites, best hacking websites, top security websites, best security websites, hacking security websites, how to hack.




1. Hack a day

This website contains news, projects, videos, forums and some other information on hacking, which can all come in handy if you are or want to be a hacker.

2. Security Focus

This website has been running since 1999 and carries information from news to posts by experts and guest columnists, all of them related to security.

3. Astalavista

This website tells you how vulnerable your system is and gives you information on your websites and overall assets.

4. PacketStorm Security

Their tagline says, "What you don't know can hurt you," and they try to avoid just that by bringing news, information and tools that can help protect personal and enterprise ad data.

5. Black Hat

This company has been operating for over 15 years and has been at the forefront of security-related events all around the world. They conduct briefing, training and many other activities.

6. Metasploit Project

This is one of the most popular penetration testing tools, which is used by people all around the world. The software has been created by an open source community along with Rapid7.

7 Insecure.org

This is a website where you can find a list of 125 security tools and various other information ta

8. 2600 Store

This website gives you information on hacking. news and many other useful resources related to hacking/.

Here Are 11 Do's And Don'ts Of Tor Network!

There is nothing better than The Onion Router aka TOR for those genuinly concerned about the privacy of their digital communications. The free software secretly routes your system’s Internet traffic over several places on the Internet, thereby hiding the actual source of communication improving your privacy and security on the Internet.

Tor network, Onion router, online, Privacy, security, Google, Windows, Linux, HTTP, HTTPS, SSL, TLS, Tor browser bundle





We bring you a list of tips and tricks for using Tor to protect you better when online:

1. Do Use Tor

Tor is widely known for providing online anonymity, having gained quite a lot of reputation at what it does. It can be used for:

-sensitive browsing

-reporting abuse or corruption

-serious business activities

-inter-state or inter-country communications

-publishing anonymous posts

-sharing personal secrets with family and friends

and more.

2. Don’t Use Windows

Refrain from browsing websites through Tor on Windows systems if you're looking to improve your Internet privacy. On Windows systems, security bugs and vulnerabilities present in the system may
compromise your privacy rendering Tor quite literally worthless. It's best to run Tor-configured Linux systems such as Tails and Whonix, Further, you can also set up Tor on any of your favorite Linux distro.

3. Do Update Your System

Remember, Tor is only as safe and secure as the system running the Tor client. Therefore, it is highly advisable to regularly update the Tor client, Tor-secured applications (browsers, instant messaging clients, email clients, etc.), and the operating system of your computer.

4. Don’t Use HTTP Websites

Tor is a traffic router and not a tool to encrypt the network traffic throughout the Internet, therefore, its exit nodes can read your Internet traffic when in the form of plain unencrypted data.

It's only obvious you use end-to-end encryption such as SSL or TLS when doing sensitive online communications that requires HTTPS websites. Further, add-ons like 'HTTPS Everywhere' automatically switch to HTTPS-mode browsing for supported websites. It's preferred you use these.

5. Do Encrypt Your Data Storage

Tor cannot secure the digital data on your computer. Complete security can only be achieved through encryption of data using strong cryptographic algorithms. LUKS or TrueCrypt can be used for the same.

6. Don’t Use Tor Browser Bundle

Tor Browser Bundle contains critical vulnerabilities and therefore should not be used for browsing websites anonymously through Tor.

7. Do Disable JavaScript, Flash And Java

Binary applications like JavaScript, Adobe Flash, Java, QuickTime, ActiveX controls, VBScripts etc run with user account's privileges. These might access and share your data leaving Tor rendered useless. Websites can use to track you using JavaScript. Meanwhile, Java and Adobe Flash run in virtual machines. These might ignore your system’s configured proxy settings, and share your data directly with the websites.

8. Don’t Use P2P

Tor network is not built for peer-to-peer file sharing. If you're into downloading torrents, remember you're simply busing Tor. Another downside is, it slows down other user's browsing on the network.

9. Do Delete Cookies And Site’s Local Data

Tor uses network packets to hide your real identity from the websites. However, it can't stop websites from using workarounds such as cookies and local data storage to detect your real identity.

10. Don’t Use Your Real Email

Tor protects online privacy and hides real identity. However if you’re giving out your real email on the websites, how is Tor to secure you? Ideally, you must consider a virtual identity while using Tor.

11. Don’t Use Google

Warning: Google periodically collects information on users’ browsing and search data to facilitate the growth of its revenue. Rather, go for alternatives such as Startpage and DuckDuckGo. These anonymity-compliant services offer search results without logging your IP address and storing cookies on your computer.

The 12 Best Firefox About:Config Performance Tweaks

Below are a few of our favorite Firefox performance hacks, tweaks, and productivity enhancements that can be made via the About:config of Firefox. We show you step-by-step how to perform the tweaks and what each of the tweaks are responsible for and how they improve your performance in Firefox and increase your productivity.
Make Firefox Give Back RAM When Minimized
Typically when a program in Windows is minimized for a period of time, the program will give back the RAM that it used so that users of the system can use the memory for other applications that may be running. By default, Firefox does not perform in this matter, making your system run lower on RAM than it should.

To enable the setting so that Firefox gives back RAM, do the following:
1) In the Firefox address bar type: about:config and then hit Enter.
2) In the “Filter” search, type: config.trim_on_minimize
3) Right click on the setting and click “toggle” so that the Value turns to “true”.

After performing the above, you will need to restart the browser and Firefox will now “give back RAM” when minimized. To undo the change, perform the steps again but make sure the value turns to “false”.
Hacking Firefox Network Settings for Performance
HTTP is the protocol used for most web pages today and multiple requests can be sent before any responses are received in your browser, and this is known as pipelining. Pipelining reduces network load and can reduce page loading times, but the downside is that not all servers support the feature. For the servers that do support it, this setting could drastically improve the loading speed of pages in Firefox.

To enable the settings for network pipelining, do the following:
1) In the Firefox address bar type: about:config and then hit Enter.
2) In the “Filter” search, type: pipelining.

You should see the following:
network.http.pipelining
network.http.pipelining.maxrequests
network.http.pipelining.ssl
network.http.proxy.pipelining

Set the first option to: true and second option to: 8. The SSL option you can set to true, if you want to use pipelining for secure sites and if you are using a proxy, you’ll want to set the fourth option to true as well to benefit from pipelining using a proxy server.

Yet another network feature that can be tweaked is the maximum number of connections by server, and in total that are allowed at any given time. Users on slower connections may want to reduce this number to help prevent HTTP connection timeouts. Users on faster connections may want to increase it. Below are the settings that I use.
To enable the setting so that Firefox uses more connections at once, do the following:
1) In the Firefox address bar type: about:config and then hit Enter.
2) In the “Filter” search, type: max-connections

You should see the following:
network.http.max-connections
network.http.max-connections-per-server

I have the first setting set to 45 and the last setting set to 30. If you are on a slower connection, the default or lower would be better.
Graphics Rendering and UI Hacks
Firefox readers web pages incrementally – they display what’s been received of a page before the entire page has been downloaded completely. Since the very start of the page usually contains only meta information, css, javascript and simply doesn’t have much useful information to display, Firefox will wait a short interval before rendering a page and this next setting controls that interval. The default is set to 250 milliseconds and we’re going to change it to 0 so that the page renders as soon as possible.

To enable the settings for faster page rendering, do the following:
1) In the Firefox address bar type: about:config and then hit Enter.
2) In the configuration window, right click and choose New -> Integer
3) Name it nglayout.initialpaint.delay and set it to 0


Rather than wait until a page has completely downloaded to display it to the user, Mozilla applications will periodically render what has been received to that point. Because reflowing the page every time additional data is received greatly slows down total page load time, a timer was added so that the page would not reflow too often. This preference controls the maximum number of times the content will do timer-based reflows. After this number has been reached, the page will only reflow once it is finished downloading.
To enable this setting do the following:
1) In the Firefox address bar type: about:config and then hit Enter.
2) In the “Filter” search, type: content.notify.backoffcount
3) Double click on content.notify.backoffcount and change the Value to 5.


Based on the previous feature, content notify interval is a setting that allows us to set the minimum amount of time to wait between reflows.
To add this functionality perform the following:
1) In the Firefox address bar type: about:config and then hit Enter.
2) In the configuration window, right click and choose New -> Integer
3) Name it content.notify.interval and set it to 849999


Content interrupt parsing is another area that can be tweaked and this setting controls whether or not Firefox will interrupt parsing a page to respond to UI events.
To add this functionality perform the following:
1) In the Firefox address bar type: about:config and then hit Enter.
2) In the configuration window, right click and choose New -> Boolean
3) Name it content.interrupt.parsing and set it to “True”


Hate when unintelligent webmasters utilize the blink HTML tag and blink value in CSS causing content to blink on a web page? You can now disable this behavior with the next trick.
To add or remove this functionality perform the following:
1) In the Firefox address bar type: about:config and then hit Enter.
2) In the “Filter” search, type: browser.blink_allowed
3) Right click on the setting and click “toggle” so that the Value turns to “false”. This disables the blinking.


Firefox menu’s display slowly? Speed them up with this next tweak:
1) In the Firefox address bar type: about:config and then hit Enter.
2) In the configuration window, right click and choose New -> Integer
3) Name it ui.submenuDelay and set it to 0


This is a cool productive feature that allows your middle click on your mouse to paste content from the clipboard into text fields in Firefox.
To enable the middle mouse click as a paste feature, performing following:
1) In the Firefox address bar type: about:config and then hit Enter.
2) In the “Filter” search, type: middlemouse.paste
3) Right click on the setting and click “toggle” so that the Value turns to “true”.


Now on to one of my favorite Firefox tweaks, displaying search results in a new tab. I always hated how Firefox would use my existing tabs, when I used the search feature built in Firefox. Now, with the setting below it will open a new tab with the results, leaving my previous tabs untouched.
Here is how to do it:
1) In the Firefox address bar type: about:config and then hit Enter.
2) In the “Filter” search, type: browser.search.openintab
3) Right click on the setting and click “toggle” so that the Value turns to “true”.


Now for the granddaddy of all features, the ability to have the “View Source Code” in Firefox, open in the text editor of your choice. To do this, follow the steps below:
1) In the Firefox address bar type: about:config and then hit Enter.
2) In the “Filter” search, type: view_source.editor and you should see the following:

view_source.editor.external
view_source.editor.path

Change the first setting to “true” and change the last setting to the full path of your text editor. Now you can enjoy firefox opening source code of web pages in your favorite text editor.

28 Coolest Firefox About:Config Tricks

firefox-logo
You may have installed countless add-on in Firefox to enhance your using experience, but if you want to get the most out of Firefox, you really have to hack your way into the about:config.
The about:config page contains most (if not, all) of Firefox configuration options. It is so far the most effective, and the most powerful way to tweak and enhance your Firefox performance. Here are 28 of the popular tweaks.

Accessing your about:config page
In your Firefox, type about:config in the address bar.
about-config
You will be shown a warning page. Click the “I’ll be careful, I promise!” button to proceed.
firefox-config-warning
On the main page, you will see a long list of configuration entries. Enter the name of the key you want to update in the “Filter” field. The list will narrow to only the entries that match your keyword as you type.
To modify the value, simply double click on the entry value field and update the entry. That’s all!
Isn’t that simple? Now, let’s get to the tweaking.
1) Adjust the Smart Location Bar’s Number of Suggestions
In Firefox 3, when you start typing in the location bar, a drop-down list of suggestion URLs will be shown. If you want it to show more than 12 suggestions (12 is the default), you can adjust the browser.urlbar.maxRichResults keys and get it to show the number you want.
firefox-smart-location
Config name: browser.urlbar.maxRichResults
Default: 12
Modified value: Set to your desired number of suggestion. If you want to disable it all together, set it to -1

2) Disable the session restore function
Firefox 3 automatically saves your session every 10 secs so that whenever it crashes, it can restore all your tabs. While this is a useful feature, some of you might find it irritating. To disable this function, toggle the value of browser.sessionstore.enabled to False
Config name: browser.sessionstore.enabled
Default: True
Modified value: False if you want to disable the session restore function

3) Adjust the Session Restore Saving Frequency
Same as above, if you decided to keep the session restore feature on, but want to reduce the session saving frequency, change the value of browser.sessionstore.interval so that Firefox will save the session at a longer interval.
Config name: browser.sessionstore.interval
Default: 10000 (in msecs, equivalent to 10secs)
Modified value: Set it to your desired value. 1000 means 1 sec and 60000 means 1 minute.

4) Enable Advanced Color Profile Support
Firefox has this advanced color profile features that display higher image quality. It is not enabled by default as it has a negative effect on the performance of the browser. If you are concern with the image quality rather than the performance, you can activated it via the gfx.color_management.enabled setting
Config name: gfx.color_management.enabled
Default: False
Modified value: True (if you want to activate the color profile support feature)

5) Disable Antivirus Scanning
This is mainly for Windows users. By default, Firefox 3 automatically scan the downloaded file with the default anti-virus application to make sure it is free of virus. If you download a big file, it could take a long time for the whole scanning process to complete. To increase the performance of the browser, you might want to consider disabling the anti-virus scanning via the browser.download.manager.scanWhenDone key.
Config name: browser.download.manager.scanWhenDone
Default: True
Modified value: False (if you want to disable it)

6) Configuring The Scrolling Tabs
When you opened many tabs, Firefox will not keep on reducing the tab width. Instead, it shows a scrolling bar so that the min width (100px) is conserved and you can scroll to find your tabs. If you are those who don’t like the scrolling tab function and prefer Firefox to show all the tabs, regardless how small it is, you can set the value of browser.tabs.tabMinWidth to 0 to disable it. Similarly, if you want Firefox to display more tabs before showing the scrolling button, you can reduce the default value to a lower value, say 75 pixels.
Firefox-scrollingtab
Config name: browser.tabs.tabMinWidth
Default: 100
Modified value: 0 if you want to disable the scrolling functions, other values to set the min width value

7) Show/Disable Close button on Tabs
Some people love to see the Close (the red X) button on every tabs, but some hate it. Whatever is it, you can configure it to your preferences via the browser.tabs.closeButtons setting.
firefox-tab-close
Config name: browser.tabs.closeButtons
Default: 1
Modified values:

  • 0 – display a close button on the active tab only
  • 1- display close buttons on all tabs
  • 2- don’t display any close buttons
  • 3- display a single close button at the end of the tab strip
8) Extend Scripts Execution Time
In Firefox 3, a script is only given 10 seconds to respond, after which it will issue a unresponsive script warning. If you are hooked on a slow network connection, you might want to increase the script execution time via dom.max_script_run_time to cut down on the frequency of the no script warning.
Config name: dom.max_script_run_time
Default:10 (in secs)
Modified value: 20, or any values greater than 10

9) Handling JavaScript Popups
When you come across a site that executes a javascript open new window function, and if the popup window is without all the usual window features, i.e. back/forward/reload buttons, status bar etc, Firefox will automatically treat it as a popup and will not open it as a new tab. However, if you find this to be a nuisance and wanted to open all new windows in a new tabs, you can specify it via the browser.link.open_newwindow.restriction setting.
Config name: browser.link.open_newwindow.restriction
Default: 2 – Open all JavaScript windows the same way as you have Firefox handle new windows unless the JavaScript call specifies how to display the window
Modified values:

  • 0 – open all links as how you have Firefox handle new windows
  • 1 – do not open any new windows
  • 2- open all links as how you have Firefox handle new windows unless the Javascript specify how to display the window
10) Enable Spell Checking In All Text Fields
The default spell checking function only checks for multi-line text boxes. You can get it to spell-check for single line text box as well.
Config name: layout.spellcheckDefault
Default: 1 (spell checker for multi-lines text boxes only)
Modified values:

  • 0 – disable the spell checker
  • 2 – enable the spell checker for all text boxes
11) Open Search Box Results In New Tab
When you search using the search box at the top right hand corner of the browser, it will display the search results in the current tab. If you don’t want the search to interfere with your current tab, you can tweak the browser.search.openintab to make it open in a new tab.
Config Name: browser.search.openintab
Default: False
Modified value: True (open search box results in new tab)

12) Lower The Physical Memory Used When Minimized
This tweak is mainly for Windows users. When you minimize Firefox, it will send Firefox to your virtual memory and free up your physical memory for other programs to use. Firefox will reduce its physical memory usage, when minimized, to approximately 10MB (give or take some) and when you maximize Firefox it will take back the memory that it needs.
The preference name does not exist and needs to be created.
Right click on the background and select New->Boolean.
Enter the name when prompted: config.trim_on_minimize
Enter the values: True

13) Speed up your Firefox
Several tweaks required for this
Config name: network.http.pipelining
Default: False
Modified value: True

Config name: network.http.proxy.pipelining
Default: False
Modified value: True

Config name: network.http.pipelining.maxrequests
Default: 4
Modified value: any value higher than 4, but not more than 8

Config name: network.http.max-connections
Default: 30
Modified value: 96

Config name: network.http.max-connections-per-server
Default: 15
Modified value: 32

14) Increase/Decrease the Amount of Disk Cache
When a page is loaded, Firefox will cache it into the hard disk so that it doesn’t need to be download again for redisplaying. The bigger the storage size you cater for Firefox, the more pages it can cache.
Before you increase the disk cache size, make sure that browser.cache.disk.enabled browser.cache.disk.enable is set to True.
Config name: browser.cache.disk.capacity
Default: 50000 (in KB)
Modified value:

  • 0 – disable disk caching
  • any value lower than 50000 reduces the disk cache
  • any value higher than 50000 increases the disk cache.
15) Select all text when click on the URL bar
In Windows and Mac, Firefox highlights all text when you click on the URL bar. In Linux, it does not select all the text. Instead, it places the cursor at the insertion point. Regardless which platform you are using, you can now tweak it to either select all or place cursor at insertion point.
firefox-select-all
Config name: browser.urlbar.clickSelectsAll
Modified value:

  • False – place cursor at insertion point
  • True – select all text on click
16) Autofill Address in URL Bar
Other than the smart location feature, you can also get your URL bar to autofill the address as you type the URL.
firefox-autofill
Config name: browser.urlbar.autofill
Default: False
Modified value: True (Have Firefox autofill the address as you type in the URL bar)

17) Same Zoom Level For Every Site
Firefox remembers your zoom preference for each site and set it to your preferences whenever you load the page. If you want the zoom level to be consistent from site to site, you can toggle the value of browser.zoom.siteSpecific from True to False.
Config name: browser.zoom.siteSpecific
Default: True
Modified value: False (enable same zoom preferences for every sites)

18) Setting your zoom limit
If you find that the max/min zoom level is still not sufficient for your viewing, you can change the zoom limit to suit your viewing habits.
Config name: zoom.maxPercent
Default: 300 (percent)
Modified value: any value higher than 300

Config name: zoom.minPercent
Default: 30 (percent)
value: any value

19) Configure Your Backspace Button
In Firefox, you can set your backspace to better use by getting it to either go back to the previous page or act as page up function.
Config name: browser.backspace_action
Default: 2 (does nothing)
Modified value:

  • 0 – go back previous page
  • 1- page up
20) Increase Offline Cache
If you do not have access to Internet most of the time, you might want to increase the offline cache so that you can continue to work offline. By default, Firefox 3 caches 500MB of data from supported offline Web apps. You can change that value to whatever amount of your choice.
Config name: browser.cache.offline.capacity
Default: 512000 (in KB)
Modified value: any value higher than 512000 will increase the cache value

21) Auto Export Firefox 3 bookmarks to bookmarks.html
Unlike the previous version, Firefox 3 backup the bookmarks file in places.sqlite rather than the usual bookmarks.html. Since bookmarks.html allows us to export and sync our bookmarks with other browser, it will be very useful if Firefox 3 can backup the bookmark to the bookmarks.html as well.
Config name: browser.bookmarks.autoExportHTML
Default: False
Modified value: True (auto export bookmarks file to bookmarks.html)

22) Disable Extension Compatibility Checks
This is useful if you want to use an extension that is not supported by your version of Firefox badly. It is not recommended, but you can still do it at your own risk.
Right click and select New->Boolean. Enter extensions.checkCompatibility in the field. Enter False in the next field.
Right click again and select New->Boolean. Enter extensions.checkUpdateSecurity into the field and enter False into the next field.
23) Disable Delay Time When Installing Add-on
Everytime you wanted to install a Firefox add-on, you will have to wait for several secs before the actual installation starts. If you are tired of waiting, you can turn the function security.dialog_enable_delay off so that the installation will start immediately upon clicking.
firefox-add-on-delay
Config name: security.dialog_enable_delay
Default: 2000 (in msec)
Modified value:

  • 0 – start installation immediately
  • any other value (in msec)
24) View Source in Your Favorite Editor
This is very useful for developers who are always using the ‘view source‘ function. This tweak allows you to view the source code in an external editor.
There are two configuration need to be made:
Config name: view_source.editor.external
Default: False
Modified value: True ( enable view source using external text editor)

Config name: view_source.editor.path
Default: blank
Modified value: insert the file path to your editor here.

25) Increasing ‘Save Link As‘  timeout value
When you right click and select the ‘Save Link As…‘, the browser will request the content disposition header from the URL so as to determine the filename. If the URL did not deliver the header within 1 sec, Firefox will issue a timeout value. This could happen very frequently in a slow network connection environment. To prevent this issue from happening frequently, you can increase the timeout value so as to reduce the possibility of a timeout.
Config name: Browser.download.saveLinkAsFilenameTimeout
Default: 1000 (1 sec)
Modified value: any value higher than 1000 (value is in msec)

26) Animate Fullscreen Toolbar Collapse mode
In Firefox’s fullscreen mode, toolbars and the tab strip are hidden at the top of the screen and only shown on mouseover. To draw attention to this, there is an animation of the toolbar sliding upwards and off-screen when fullscreen mode is toggled on. For performance issue, the animation of the collapse of the toolbar only appear for the first time. For some reason that you may love/hate the animation, you can adjust Browser.fullscreen.animateUp to switch it on/off for every collapse.
Config name: Browser.fullscreen.animateUp
Default: 1 (animate the toolbar collapse only the first time)
Modified value:

  • 0 -disable the animation
  • 2- enable the animation for every collapse
27) Autohide Toolbar in Fullscreen mode
In fullscreen mode, the toolbar is set to autohide and appear upon mouseover. If you have a need to view the toolbar at all time, you can toggle the value of browser.fullscreen.autohide to False to always show the toolbar.
Config name: browser.fullscreen.autohide
Default: True (always autohide)
Modified value: False (always show the toolbar)

28) Increase Add-On search result
If you go to Tools->Add-ons->Get Add-ons and perform a search there, Firefox will only fetch and display 5 matching results. If you want Firefox to show more than 5 results (say 10), you can adjust extensions.getAddons.maxResults to get it to display more results.
Config name: extensions.getAddons.maxResults
Default: 5
Modified value: any value more than 5

This list of about:config is definitely not the complete list. If you have any tricks not listed here, please add it in the comment.

9 Useful Android Apps For Electronics Engineers!

Google's popular Android platform has been known to have something for everyone. Why should electronics engineers lag behind then? Here are the nine apps that Android has to offer to electronics engineers.

electronics apps, Android, Google, ASCII, best Android apps, best electronics apps on Android, iOS, Android, electronics android




1. ASCII Chars

This is an Android app that can be used for reference by electronics engineers. It contains the first 127 ASCII character along with their hex and decimal values.

2. AsciiTable

This app is similar to the one mentioned above, but contains an extended ASCII of charset.

3. Digikey

This application, which runs on Android and other platforms, can serve as a passkey for an inventory of in-stock electronic components. It is amongst the largest such inventories of its kind in the world.

4. ElectroDroid

This is a powerful collection of reference material and tools on electronics. The app is quite simple to use.

5. ELcalcV

This app can be used to calculate the voltage drop in cables. The professional version of the app has some added advantages.

6. Magnify

Want to use your Android-based smartphone as a magnifying glass? This app allows you to do just that. It converts your phone into a magnifying glass with a flashlight built into it.

7. NXP

This app works on both Android and iOS platforms and serves as a replacement for the NXP website. NXP is one of the leading sellers of semiconductors all over the world.
For NXP website - sometimes faster than going through a browser

8. NXP RF Calc

This app is useful for RF engineers. It allows them to conduct a number of common RF related calculations without having to remember complex formulae.

9. NXP NFC Tagwriter

This app is useful for reading and writing various kinds of NFC tags.

55 Best Linux Tips, Tricks And Command Lines


Here we bring to you the 55 best tips, tricks and command lines of all time contributed by our readers. Try your hands and have fun.

If you are a Linux user and open to having some fun with your open source operating machine, then this is a must-read article for you. Here is a compilation of 55 tips, tricks and command lines of all time, enough to keep you equipped. Have a look:

1. Back-up and restore Thunderbird e-mails

In Linux, when you want to reinstall your system for any reason, you need to take a back-up of your data along with your e-mails in Thunderbird. Given below are a few simple steps that back-up e-mails manually.
Check for your Thunderbird e-mail and profile folder. If you have not changed it, it should be in /home//.thunderbird/.default_folder/

For example, the alphanumeric folder name on my system is vx3vg9j2.default
Copy the whole alphanumeric folder and place it in some other computer or storage device as an e-mail backup. Do remember to close Thunderbird before doing this.

After reinstalling your PC with any Linux-based OS, install the Thunderbird e-mail client and configure your e-mail credentials before closing the Thunderbird client.

Go to your Thunderbird folder in the new installation /home//.thunderbird/ folder. The alphanumeric named folder will be a different one now.

For example: /home/guest/.thunderbird/jx3gv9k2.default

Copy the contents of the old alphanumeric folder that is kept as a backup to the above location.

That is, you need to copy the contents of vx3vg9j2.default to jx3gv9k2.default
Now, open the Thunderbird client and you will find that all the e-mail credentials, e-mails, e-mail rules and address book will be available as they were before re-installation.

--Sobhanadri Agnihotram,
sobhanadri.a@gmail.com

2. Execute commands on a remote Linux machine

If you want to execute any command or script on a remote Linux machine, you can use ssh. Below are a few examples.

The syntax for running a command or script on a remote server is:
ssh [USER]@[IP] [command or script]

Let us look at how this can be done. Suppose you want to display the directory contents of /root of a remote host, you can run the following command:

[narendra@ubunu]$ ssh root@172.16.223.128 ls -l /root
root@172.16.223.128's password:
total 12

drwxr-xr-x. 2 root root 4096 Mar 12 00:05 device_drivers

drwxr-xr-x. 2 root root 4096 Mar 12 01:31 pthreads

drwxr-xr-x. 2 root root 4096 Mar 12 01:32 python

[narendra@ubunu]$

The same can be done to run any script on the remote computer.
--Narendra Kangralkar,
narendrakangralkar@gmail.com

3. Run a Linux command after every reboot

This tip allows you to run any Linux command or script just after system reboot. You can use the @reboot cron keyword.
If you have a script in your /home directory and it needs to be run on every boot, open the cron file in editable mode and add the following:

$crontab -e

@reboot /home/xyz/myscript.sh

Do remember to enable crond on boot.
Imran Sheikh,
imrannsheikh@gmail.com

4. Comment out hashes in large configuration files

Here is a small tip for system administrators, who need to tackle large configuration files, which include lots of commented lines (marked by #). With this tip you can remove all those hashes and provide only an uncommented configuration view for faster lookup into the file.
If you want to check the configuration file of the Squid proxy server, run the following command:

#cat squid.conf | egrep -v ^#

This will show only lines that do not start with a hash mark, thus giving the configuration parameter that is being used in the current set-up.
--Yogesh Upadhyay,
yogeshupadhya@gmail.com

5. Replacing '\n' with 'space' in each line of a file

You can use the awk statement given below to remove the '\n' from each line and replace it with a blank space:

awk '$1=$1' ORS=' ' /etc/passwd
--Rajeev N Sambhu,
rajnellaya@gmail.com

6. Know your shells

Here is a command that will let you know about the available shells on your Linux distribution:

#chsh -l

To change your login shell, use the following command:

# chsh
--Chandralekha Balachandran,
reachlekha@gmail.com
Advanced ls commands
The following commands are very useful to know your system better.
lspci – Lists all PCI devices. Use -v for verbose output.
lsusb – Lists all USB devices. Use -v for verbose output.
lsmod – Lists the status of modules in the Linux kernel.
lsattr – Lists file attributes on a second extended Linux file system.
lsof – Lists the file descriptors opened by all the processes. A very useful command when a process fails to close any file descriptors.
To know more details, you can view the manual pages of each command mentioned above.

--Prasanna Mohanasundaram,
prasanna.mohanasundaram@gmail.com


7. Checking for rootkits

Attackers install rootkits on a machine to gain root access, while its presence is hidden from the real administrator of the server. A tool that can help you to detect rootkits on your machine is chkrootkit. You can download this from ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz
To install chkrootkit, you need to compile the code that you have just downloaded. Extract the downloaded tar file and change to the extracted directory, as shown below:

# tar -xvf chkrootkit.tar.gz

# cd chkrootkit-0.49/

Now compile the code by running the following command:

# make sense


After successfully compiling, the tool is ready to be used. To check for rootkits, simply run chkrootkit as the root user:

# ./chkrootkit

--Samual, samual45@gmail.com

8. Finding and replacing a test with sed

Let's look at how to find and replace a test using sed, a stream editor for filtering and transforming text. Let us first create a sample
text file with the following text:

$ cat > sample.txt

This is a first test of sample test file
This is a second test of sample test file

Press Ctrl+D after you finish entering the text.
Now run the command below to display the contents of the newly created text file:

$ cat sample.txt

The output should be as displayed below:

This is a first test of sample test file
This is a second test of sample test file

Now, substitute the first occurrence of the pattern 'test' in each line with 'log':

$ sed 's/test/log/' sample.txt

This is a first log of sample test file
This is a second log of sample test file

If you want to substitute the second occurrence of pattern 'test' in each line with 'log', use the following commands:




$ sed 's/test/log/2' sample.txt

This is a first test of sample log file
This is a second test of sample log file

To substitute every occurrence of the pattern 'test' in each line with 'log', use the code below:

$ sed 's/test/log/g' sample.txt

This is a first log of sample log file
This is a second log of sample log file

The syntax for the above options is:

sed 's/original_pattern/replacement/options'

Also, by default, sed will send the data to the stander output device,
and you can redirect it to any file by using the redirection operator ">".

$ sed 's/test/log/g' sample.txt > mod_sample.txt

--Jagan Teki, 402jagan@gmail.com

9. Backing up a MySQL database

There are several methods to back up a MySQL database, one of which is to a command line option. You need to have mysqldump installed for this method.
mysqldump is a command line utility that comes with the MySQL installation It can be used to archive one or all databases.
Given below is the command to back up a single database:

mysqldump --user [user_name] –password=[password_of_the user] [database name] > [dump_file]

The command for back up of all databases in existence is as follows:

mysqldump –u[user name] –p[password] –all-databases > [dump file]

To restore the back up taken by mysqldump, use the normal SQL command.

mysql --u [username] --password=[password] [database name] < [dump_file]
--Manish,
mt81@in.com

10. How to show the name of the current database in the MySQL prompt

If you need the name of the currently selected database in your MySQL prompt, use the following lines in your MySQL configuration file (my.cnf):

[mysql]

prompt='mysql(\d)> '

Now, when you connect, the MySQL prompt will look like what's shown below:

mysql((none))> use test;

Database changed

mysql(test)>

mysql(test)> use mysql;

Database changed

mysql(mysql)>

This makes it very easy to identify the name of the database that you are currently working on.

--Mohana Sundaram N,
mohan.linux@yahoo.com

11. Find your MySQL configuration file

We often have to administer a system that has been set up by someone else. In such a situation, it's difficult to find the correct configuration files for different applications. Here is a tip to find the correct configuration file for MySQL:

mysql -? | grep ".cnf"
--Remin Raphael,
remin@smartgeek.in

12. View the contents of tar and rpm files
Here are two simple commands to show you the contents of the tar and rpm files.
1. To view the content of a tar file, issue the following command:

#tar -tvf /path/to/file.tar

2. To view the content of an rpm file, use the command given below:

#rpm -qlp /path/to/file.rpm

--Giriraj G Rajasekharan,
girirajgr@gmail.com

13. Playing around with MP3 files

Here is a tip that helps you cut, split, join or merge MP3 files in Ubuntu, resulting in a better quality output.
To cut an MP3 file, you need to install poc-streamer, as follows:

$sudo apt-get install poc-streamer

The syntax for mp3cut is given below:

mp3cut [-o outputfile] [-T title] [-A artist] [-N album-name] [-t [hh:]mm:ss[+ms]-[hh:]mm:ss[+ms]] mp3 [-t ...] mp3 -o output: Output file, default mp3file.out.mp3

For example, if you want to cut a one-minute clip of the MP3 file named input.mp3 to a .wav file called output.wav, run the following command:

$mp3cut -o output.wav -t 00:00(+0)-01:00(+0) input.mp3

If you want to join two MP3 files, you need to install mp3wrap, as follows:

$sudo apt-get install mp3wrap

The syntax for mp3wrap is shown below:

$mp3wrap merged_filename.mp3 filename1.mp3 filename2.mp3

…where filename1.mp3 and filename2.mp3 are my input files that can be merged together.
Finally, you can split a single large MP3 file into small files by installing Mp3split using the following command:

$sudo apt-get install mp3splt

Now, to split the large file, run the following command:

$mp3splt filename.mp3 00.00 01.23 03.20

Filename.mp3 is my input file, which can be split into two MP3 files. One is from the start to the 1 min 23 sec point, and another one is from 1 min 23 sec to 3 min 20 sec. Mp3split can make smaller files without decoding even the file.

--Rajasekhar Chintalpudi,
rajasekhar.chintalapudi@gmail.com

14. GRUB 2 recovery

We often come across a condition in which the boot loader gets corrupt. Here are a few steps that will help you recover your GRUB 2 boot loader.
Boot from a live CD or DVD, which supports GRUB 2 (Ubuntu 9.10 CD or above. A DVD will take more time than a CD, so I suggest you boot from a CD).
Open the terminal and run fdisk -l to check the partition from which you want to recover GRUB 2.
Here I assume that you want to recover it from /dev/sda1.
Then run the following commands:

$sudo mkdir /media/sda1

$sudo mount /dev/sda1 /media/sda1

$sudo mount --bind /dev /media/sda1/dev

$sudo mount --bind /proc /media/sda1/proc

Now chroot into that partition by running the command given below:

$sudo chroot /media/sda1

Then re-install GRUB, as follows:

#grub-install /dev/sda

The output should be like what's shown below:

Installation finished. No error reported.

If you get an error, then try the following command:

#grub-install --recheck /dev/sda

After a successful installation, exit from chroot and unmount the file systems that were mounted to recover GRUB. Now reboot.

#exit

$sudo umount /media/sda1/proc

$sudo umount /media/sda1/dev

$sudo umount /media/sda1

$sudo reboot

You've successfully completed recovering your GRUB boot loader.

--Kousik Maiti,
kousikster@gmail.com

15. Record whatever you do in the terminal

Have you ever felt that you should record everything you do in the terminal in a file?
Then try out the following tip. There is a command named script, which can be used with option –a to append the output to a file.

Given below is an example that will show how it works:
Mandriva~:$ script -a lfy
Script started, file is lfy
Mandriva~:$ uname -a
Linux localhost.localdomain 2.6.33.5-desktop-2mnb #1 SMP Thu Jun 17 21:30:10 UTC 2010 i686 i686 i386 GNU/Linux
Mandriva~:$ uname
Linux
Mandriva~:$ exit
exit
Script done, file is lfy

Here, the name of the file is lfy. You can verify it later by using the code given below:

Mandriva~:$ cat lfy
Script started on Mon 16 May 2011 02:09:47 AM EDT
Mandriva~:$ uname -a
Linux localhost.localdomain 2.6.33.5-desktop-2mnb #1 SMP Thu Jun 17 21:30:10 UTC 2010 i686 i686 i386 GNU/Linux
Mandriva~:$ uname
Linux
Mandriva~:$ exit
exit

Script done on Mon 16 May 2011 02:10:32 AM EDT

--Sibi,
psibi2000@gmail.com

16. Wonders of VIM

VIM has a very useful command set. Here are a few commands that can be used to increase your productivity.

VIM as a file comparator:

Use '-d' switch to compare two files in VIM. This command splits the VIM screen vertically and shows the differences.

vim -d file1 file2

17.  load new files in separate windows:

If you have a file named 'first.txt' loaded already in VIM, then use ':split second.txt' to load another file named 'second.txt' in a separate window--IM will split the screen horizontally and load the second file. You can use ':vsplit' to split the screen vertically. 'Ctrl+w' can be used to switch between the windows.

18. VIM as a command:

Normally, we use VIM as an editor; however, it can be used as a command. It allows the execution of VIM commands with switch '-c', for example. Here is a command to replace all '>' characters to '>>' in a file FILE.TXT without opening VIM.

vim -c ":s/>/>>/g" -c ":wq" FILE.TXT

19. To open a file in read-only mode:

Use the '-R' switch to open a file in read-only mode; later on, '!' can be used to forcefully write to the file.

--Satya prakash,
satya.comnet@gmail.com

20. Check your processor and OS architecture

You might want to install a 64-bit OS on your machine, but the processor might just be 32-bit compatible. Sometimes it happens the other way too, i.e., you install a 32-bit OS on a machine that has a 64-bit processor. Here is how to find out whether the installed OS as well as the CPU are of 64-bit or 32-bit.

Given below is the command that will output the details of the OS installed:

$ uname -m

The result for a 64-bit OS installation (for x86_64 architecture):

x86_64

The result for a non-64-bit OS installation (for i686 architecture):

i686

To know about the processor, run the following command:

$ lshw -class processor | grep width

Shown below is the result for a 64-bit installation:

width: 64 bits

The result for a 32-bit installation:

width: 32 bits

Note: Please install lshw if it is not already installed on your system

--Srikanth Vittal,
vi.srikanth@gmail.com

21. Sudoing with Fedora

Ever felt tired of entering the super-user password after typing 'su –c' again and again? Type 'su -c visudo' just once and uncomment the following line:

# %wheel ALL=(ALL) ALL

Replace 'wheel' with your sudo username. So if the username is egghead, the line becomes…

%egghead ALL=(ALL) ALL

Save and quit. You're good to use egghead as the sudo user.

--A. Datta,
webmaster@aucklandwhich.org

22. Let your Linux system welcome you

Issue the following script and name it welcome.sh

echo "Hi zades you are welcome today is " | festival --tts
date| cut -d" " -f 1-3 | festival --tts

Now put the command sh welcome.sh at start-up. This will allow the script to run every time you log in to your system. Once done, restart your system to hear the message that is written in the Echo command.

The festival command is used to change the text to voice. You can use this command in many ways according to your creativity. Do remember to check that you have festival installed before trying this tip.

--Vinay Jhedu,
vinay.komal100@gmail.com

23. Ignoring the case during TAB-completion

By default, TAB-completion is not useful if the name of the file or directory starts with an uppercase. You can make your Shell totally ignore the case for the name by adding the following entry in /etc/inputrc:

set completion-ignore-case on

Then restart your Shell. From now onwards, TAB-completion will complete your file or directory name, and completely ignore the case.

Do remember to make changes to inputrc only as the root user.
You can read more about this in the manual pages of readline:

man readline

--Sachin P,
iclcoolster@gmail.com

24. Find your OS and distribution name

Here is a tip that will let you know the name of the OS, along with other details:

[root@vl-pun-blg-qa27]# lsb_release -a

LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: CentOS
Description: CentOS release 5.5 (Final)
Release: 5.5
Codename: Final

--Narendra Kangralkar,
narendrakangralkar@gmail.com

25. Auto mounting a partition on Linux

The file that contains data regarding the devices to be mounted at start-up is in /etc/fstab. To automatically mount a partition, follow the steps given below.

First, create the directory in which your partition will be mounted. Create one directory per partition. I created the directory in /media. This directory is known as the 'mount point' for the partition.

To create the mount point, open up the terminal and type the following command:

sudo mkdir location_of_dir/name_of_dir

…or you can use Nautilus, the file manager, to create a folder.

If the directory is created in a location in which you need root privileges, use sudo. After creating the mount point, modify /etc/fstab as per your requirements. It is always advisable to create a backup of the /etc/fstab file before making any changes, because any error in that file can prevent your OS from booting.

Now, make changes in fstab to auto mount the HDD partition:

sudo gedit /etc/fstab

Open the /etc/fstab with a text editor of your choice with root privileges.
In this file, add the details in the same order as done for the existing partitions.

The order should be as follows: the device name, the default mount point, the file-system type, mount options, dump, and the fsck option.

The device name is the name of the HDD partition (such as /dev/sda5): the mount point is the full path of the directory where the partition is to be mounted. The file system type is the type of file system like ext4, fat, ntfs, etc. Mount options are normally given as defaults, while dump and fsck options are given as 0.

I had a partition /dev/sda5 and I created the directory /media/mydisk. My partition was of type ext4, so to my /etc/fstab, I added the following command:

/dev/sda5 /media/mydisk ext4 defaults 0 0

Save the file and in the command prompt, type the following:

sudo mount -a

Now, the partition will be automatically mounted on every reboot.
--Vineeth Kartha,
vineethkartha@ieee.org

26. Creating a virtual file system

Here is a simple tip that allows you to create a virtual file system and mount it with a loopback device.

STEP 1: First create a file of 10 MB using the following command:

$ dd if=/dev/zero of=/tmp/disk-image count=20480

By default, dd uses a block of 512 so the size will be 20480*512
STEP 2: Now create the file system as ext2 or ext3
Here, in the following example, let's use ext3 as a file system:

$ mkfs -t ext3 -q /tmp/disk-image

You can even use Reiser as a file system type, but you'll need to create a bigger disk image. Something like what's shown below:

$dd if=/dev/zero of=/tmp/disk-image count=50480

$mkfs -t reiserfs -q /tmp/disk-image

STEP 3: As the final step, create a mount point and mount the file system:

$ mkdir /virtual-fs

$ mount -o loop=/dev/loop0 /tmp/disk-image /virtual-fs

Note: If you want to mount multiple devices, you will have to increase the loop count as mentioned below:

loop=/dev/loop1, loop=/dev/loop2,... loop=/dev/loopn

After you complete the above steps, you can use it as a virtual file system. You can even add this to /etc/fstab to mount this virtual file system whenever you computer is rebooted.
Open your /etc/fstab in a text editor and add the following:

/tmp/disk-image /virtual-fs ext3 rw,loop=/dev/loop0 0 0

--Aarsh S Talati,
aarshstalati1989@gmail.com

27. Identify your current shell name

You can identify your current shell name by using the following commands:

[narendra@CentOS]$ echo $SHELL

/bin/bash

The "SHELL" environment variable stores the name of the current shell.
You can also use the command given below to get the shell name:

[narendra@CentOS]$ echo $0

bash

"$0" will print the name of the program; here the program name is 'current shell'.

--Narendra Kangralkar,
narendrakangralkar@gmail.com

28. Scan open ports

The command given below will scan all the open TCP ports on the loopback interface:

nmap -sS -O 127.0.0.1

In general, you can use the following:

nmap -sS -O

To scan open UDP ports in the system, use the command given below:

nmap -sU -O

--Prasanna,
prasanna.mohanasundaram@gmail.com

29. Rev up!

As *nix sysadmins, we need to do a whole bunch of text-based data processing, either in files or data streams.

Here is a shell command called rev that I came across and wanted to share with you geeks because I really liked it and found it useful.

The rev command utility reverses the order of characters in every line. In short, it creates a mirror image. The most common use of rev is to reverse the line, extract a particular string and then pipe through rev a second time to restore the original.

So, if I want to get the year mentioned at the end of a string, this is what I will do:

$cat fileinfo.txt

Last Changed Date: 2011-08-11 18:10:08 -0500 Thu, 11 Aug 2011

$cat fileinfo.txt | rev
1102 guA 11 ,uhT 0050- 80:01:81 11-80-1102 :etaD degnahC tsaL

$cat fileinfo.txt | rev | awk '{print $1}'
1102

$cat fileinfo.txt | rev | awk '{print $1}' | rev
2011

Voila! Got the year! This is just one workaround, out of the many ways of doing this same task. After all, it doesn't hurt to learn something new.
--Ram Iyer,
ramiyer1@gmail.com

30. Increment or decrement a number present in Vim editor

This tip will increment and decrement a number in Vim editor. To increment, use Ctrl+A and to decrement, use Ctlr+X.
The following example will explain it further.

Let's suppose a number, 5, is present in the file that is being edited in Vim editor. Now, if you need to increment or decrement the number by 1, place the cursor on the digit and press Ctrl+A to increment it (i.e., it becomes 6); if you press Ctrl+A again, 6 becomes 7, and so on. In the same way, if you press Ctrl+X, the number will be decremented by 1.
If you press 8 and then press Ctrl+X, the number will be decremented by 8. Similarly, pressing 12 and then Ctrl+A will increment the number by 12.
--Adithya Kiran Gangu,
adithya.kiran@gmail.com

31. Search and delete files from a folder

If you want to delete all the .lock files from a folder, use the following command:

find -name *.lock | xargs rm -rf

This will find all the files with the .lock extension and delete them. This can be done for any files that you need to delete.

--Mridhul,
mridhul@live.com

32. Get the right information easily

Newbies exploring GNU/Linux sometimes find it difficult to get the right information about a device that is not working. Yet, this information is required to make the device work. Here is a command that gives you the details of all PCI devices and the kernel driver that is associated with them.
Open the terminal and log in as the root user. Now run the following command:

lspci -k

lspci gives you the information about the PCI buses and also the devices connected to them, and the -k switch displays which kernel module is handling the device. So if it is missing on some device, you need to install the driver for that device.

--Pankaj Tanwar,
pankaj.tux@gmail.com

33. Number conversion in the Vim editor

Here is a tip that will let you convert hexadecimal numbers to decimal numbers and vice versa in the Vim editor.
To convert hexadecimal numbers to decimal numbers, you need to type the following in the Vim editor's command mode:

:echo 0x111

Press Enter and you will get the result:

273

You can even try the command given below to convert the number:

:echo printf ('%d',0x111)

273

Now to convert decimal numbers to hexadecimal numbers…

:echo printf ('%x', 273)
111

You can even perform simple arithmetic on Vim's command prompt as given in the example below:

:echo printf ('%x',273-173)

64

:echo 0x111-0x10

257
--Adithya Kiran Gangu,
adithya.kiran@gmail.com

34. Know the libraries used by a program

Here is a tip that will help you know what shared libraries are being used by a program.

For example, to figure out exactly which libraries are used by ls, run the following command:

ldd /bin/ls

The output will be a list of all shared libraries:

linux-gate.so.1 => (0xffffe000)
libselinux.so.1 => /lib/libselinux.so.1 (0xb786c000)
librt.so.1 => /lib/librt.so.1 (0xb7862000)
libcap.so.2 => /lib/libcap.so.2 (0xb785c000)
libacl.so.1 => /lib/libacl.so.1 (0xb7852000)
libc.so.6 => /lib/libc.so.6 (0xb76e4000)
libdl.so.2 => /lib/libdl.so.2 (0xb76df000)
/lib/ld-linux.so.2 (0xb78a4000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb76c4000)
libattr.so.1 => /lib/libattr.so.1 (0xb76be000)

--Aarsh S Talati,
aarshstalati1989@gmail.com

35. Use YUM to download a package

Often, you need to download rpm packages without installing them on the system that you are using to download it. Using the normal YUM command downloads the packages and also installs them on your computer. Here is an option that will only download the rpm package for you. It will download it in the folders specified in the '--downloaddir' option.

# yum update httpd -y --downloadonly --downloaddir=/opt

Now, you can install all rpm packages in this folder by running the following command:

# rpm -Uivh *.rpm

Do remember to run these commands as the root.

--Pratyay Modi,
pratyaymodi@gmail.com

36. Resolve FSCK failed error

Sometimes, while booting your Linux system, you may come across the error shown below:

FSCK failed. Please repair manually and reboot. The root file system is currently mounted read-only. To remount it read-write do:
bash# mount-n -o remount,rw /
Attention: Only CONTROL-D will reboot the system in this maintance mode. shudown or reboot will not work.
Give root password for login:_

Provide your root password and try the following command:

mount -n -o remount,rw /

If this does not work for you, reboot your system and do a manual file system check on your root partition as follows:

umount /dev/hddXXX

fsck -CV /dev/hddXXX

…where hddXX is the root partition.


--Abhishek Chib,
abhishek.chib@gmail.com

37. Undo your changes even after quitting the VIM editor

As all of us know, if you make changes in a file using VIM editor, the changes are permanent and you cannot get the old version back after you save and quit the editor.
But VIM v7.3 allows you to get the old version back even after quitting the editor.
Here is a tip that shows you how to configure VIM to remember changes.
To enable Undo, execute the following commands in VIM just before starting to edit the file.

:set undofile

:set undodir=/tmp

This is to be done every time you start editing a file. In case you need the configuration to be there for all files that you open in VIM, create a file called '.exrc' or '.vimrc' in $HOME directory. In my case, it is /myhome.
Open the just created file and add the following commands:

# vi /myhome/.exrc

set undofile

set undodir=/tmp

Save and close the file.

:wq

From now onwards, the Undo history is maintained in the background for all files that you edit with VIM.

--Adithya Kiran Gangu,
adithya.kiran@gmail.com

38. Using 'vi' commands on your terminal
Using 'vi' commands while working on the terminal is a good work enabler. To set your terminal to 'vi' mode, you need to use the following command:

set -o vi

Now you can use the command mode and the insert mode of 'vi' while working on the terminal.

--Dipjyoti Ghosh,
dipjyoti.ghosh@gmail.com

39. Get your IP address

Here is a one line command to fetch all the IP addresses (except localhost) of your computer:

# ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d:

Note: Use the above command as the root user.

--Balkaran Brar,
balkaran.brar@gmail.com

40. Make your system speak for you!

You can make your system speak for you by using the Speech Synthesizer command normally available in Ubuntu and many other distributions of Linux.
To do so, issue the following command:

# espeak "hello how are you"

You will hear a voice speaking for you.
To change the pitch of the voice, you can issue the following command in the format shown:

# espeak -p 80 "hello how are you"

…(default being 50)
Issuing the following form of command will control the speed of the speech, in terms of words per minute:

# espeak -s 80 "hello how are you"

There are more interesting options available in the man pages.
--Sanjay Goswami,
sanjaygoswamee@gmail.com

41. Measuring the network throughput between two Linux systems

Iperf is a tool that measures the bandwidth and the quality of a network link. It can be installed very easily on any Linux system. One host must be set as the client and the other one as the server. Make sure that iperf is installed on both systems. If it is not installed, then use your package manager to install it before trying this tip.

Now run iperf on one of the Linux systems as the server, as shown below:

linux-erv3:/home/test/Desktop # iperf -s

------------------------------------------------------------
Server listening on TCP port 5001

TCP window size: 85.3 KByte (default)
------------------------------------------------------------

Go to the second Linux system and run iperf -c as the client:

linux-6bg3:~ # iperf -c 192.168.1.100

------------------------------------------------------------
Client connecting to 192.168.1.100, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------

[ 3] local 192.168.1.109 port 39572 connected with 192.168.1.100 port 5001

^C[ ID] Interval Transfer Bandwidth

[ 3] 0.0- 6.3 sec 6.38 MBytes 8.51 Mbits/sec

By default, the iperf client connects to the iperf server on the TCP port 5001 and the bandwidth displayed by iperf is the bandwidth from the client to the server. In the above example, it is 8.51 Mbits/sec between two Linux test systems connected over a wireless network.

--Prasanna,
prasanna.mohanasundaram@gmail.com

42. Print a file with line numbers

If you want a file with line numbers (say for printing), you can use the 'nl' command in Linux:

$ nl file.c

This prints the file with line numbers to standard output or this can be even redirected to a

file as shown below:

$nl file.c > output.txt

Here, output.txt will have the codes of file.c with each line having a line number.

--Phaniram Vallury,

ramvvs@gmail.com

43. Cut specific logs

If you need to cut specific logs from the complete log of any application, here is a tip that will

be of help.

Open the log file in a vi editor and set the editor to display the line number:

vi server.log

:set nu

The above process will provide you the line numbers in the logs. You can then search for

the specific string and note down the line number (e.g., 550). Now, note down the last line

number by using Shift+G (e.g., 780)

sed -n 550,780p server.log > threaddump.log

So the threaddump only contains lines from 550 to 780.

--Venkatesh R,

venka.2k@gmail.com

44. Reset ifconfig counters

As you can see, ifconfig keeps a couple of counters (RX/TX packets, RX/TX bytes, errors,

dropped, overruns, frames and carrier collisions). You can quickly spot if there is a problem by

just looking at the ifconfig counters:

#ifconfig eth0

eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx

inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:4233700943 errors:2 dropped:0 overruns:3 frame:5

TX packets:1917219659 errors:1 dropped:0 overruns:0 carrier:348

collisions:5753 txqueuelen:3000

RX bytes:1467520026 (1.3 GiB) TX bytes:2299240337 (2.1 GiB)

You can now find out what driver is being used by the network interface, which you want to

reset by using ethtool.

#ethtool -i eth0

driver: e100

version: 3.4.14-k4-NAPI

firmware-version: N/A

bus-info: 0000:01:07.0

# modprobe -r e100; modprobe e100; ifup eth0

This will reset all counters.

--Vinod Rana,

rana3807@gmail.com

45. Power yourself with Netstat

Here are a few uses of the netstat command that can help you.
To display the kernel interface table:

netstat -i

To display the kernel routing table:

netstat -rn

To display all open network sockets:

netstat -uta

To display network statistics:

netstat -s

--Prasanna,
prasanna.mohanasundaram@gmail.com

46. Finding the full path of the shell command

There is a command named which that takes one or more arguments as input. It prints to standard output the full path of the shell command. It does this by searching for an executable or script in the directories listed in the environment variable PATH:

[aarsh@localhost ~]$ which poweroff

/usr/bin/poweroff

If the command is not found, it gives the output shown below:

[aarsh@localhost ~]$ which moodule

/usr/bin/which: no moodule in (/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/aarsh/bin)

--Aarsh S Talati,
aarshstalati1989@gmail.com

47. Securing files

Here is a simple tip to password protect your files:

vi -x test

This command will ask for an encryption key. You have to type the key twice. Then save and quit the opened file.
Now, whenever you open this file, it will ask for that password first.

--Sumit Chauhan,
sumit1203@gmail.com

48. Uninstalling a package

To completely uninstall a package, first check the exact name of the package to be uninstalled by using the following command:

sudo dpkg --get-selections | grep package_name

The output of the above command will display the name of the package.
Once you know the package name, you can remove it by using the command shown below:

sudo apt-get remove --purge package_name

--Neeraj Joshi,
neeraj88joshi@gmail.com


49. How to check the date and time the system was rebooted

Here is a simple command to check the system's reboot date and time:

#last reboot

reboot system boot 2.6.18-53.el5 Sat Aug 6 18:02 (8+04:45)
wtmp begins Sat Aug 6 18:02:07 2011

The command below will give you the date and time the system was booted:

#who -b

system boot 2011-08-24 09:43

--Sumit Chauhan,
sumit1203@gmail.com

50. Reloading XWindows System

Sometimes, while working on a Linux-based computer, XWindows System doesn't respond very well. Here are the steps to reload XWindows System in a non-responsive Ubuntu system.

1. First open the command mode by pressing: Ctrl + Alt + F2
…and then entering your username and password.

2. Then run the following command:

top

Search the process named 'Xorg' in the list.
If it does not appear, wait for a few seconds. Then find the PID of the 'Xorg' process, listed at the extreme left of the output on the top.
You can also get the PID using the command given below:

pgrep Xorg

3. Now run the following command to kill the Xorg process:

sudo kill "PID"

…where PID is the process ID of Xorg.
This will reload the XWindows System.

Note: You must have root access to use these commands

--Indermohan Singh,
indermohansinghk7@gmail.com

51. Handling log files

Developers require a lot of testing after coding the software and they frequently need to handle the log files to identify the errors in the code of an application program. Given below are the steps to handle various log files that are being generated on a Linux system.

1. Clearing a log/text file:

$ >filename

The above command will clear all contents of the file.
2. To view the log/text file:

$ tail -f filename

This command will display the file contents as and when the log is written. It also displays the flow of the log.
3. To use more sophisticated tools on log files:

$ less filename

This will display the log file contents. You can also use the commands below while using less.
a. To refresh the log automatically, press:

"f"

after issuing the less command.

b. To stop refreshing the logs, press:

CTRL + C

c. To scroll up, press:

w

d. To scroll down, press:

d

e. To exit the mode, press:

CTRL+C

and then press

q

--Pranavam Siddharthan,
pranavam.s@gmail.com

52. Changing file names from upper case to lower

To manually change the case (upper to lower or vice versa) of a large number of files can be tedious. So, here is a script that can make life easy:

#to change uppercase filenames to lowercase
#!/bin/sh
if [ $# -eq 0 ] ; then
echo Usage: $0 Files
exit 0
fi
for f in $* ; do
g=`echo $f | tr "[A-Z]" "[a-z]"`
echo mv -i $f $g
mv -i $f $g
done

If you want to change the case from lower to upper, replace

g=`echo $f | tr "[A-Z]" "[a-z]"`

with

g=`echo $f | tr "[a-z]" "[A-Z]"`

in the script.

--Anil Awasare,
anil.awasare@gmail.com

Counting the number of files in a directory
Here is a simple command that can count the number of files in a directory (not the hidden ones):

echo * | wc -w

--Anil Awasare,
anil.awasare@gmail.com

53. Find and move files

You can find and move files in two steps. Step 1 enables you to find all files with .mp3 as the file extension. In Step 2, you can move them.
Step 1:

[narendra@ubuntu]$ find DIR_NAME -type f -iname "*.mp3"

./dir2/f4.mp3
./dir2/f3.mp3
./dir1/f2.mp3

Note: Replace DIR_NAME with your actual directory name.

In the above example, you are only finding the files (that's why you used -type f) that have extension '.mp3'. Now you can move these files by using the '-exec' option of the 'find' command.
Step 2:

[narendra@ubuntu]$ find DIR_NAME -type f -iname "*.mp3" -exec mv {} /tmp/mp3/ \;

Here, '{}' matches each filename which is found by the 'find' command. And '\;' is used to indicate the end of the command.
After executing this command, all mp3 files are moved into the '/tmp/mp3' directory.

--Narendra Kangralkar,
narendrakangralkar@gmail.com


54. Burning a DVD using the command line

Do you know that burning content using the command line onto a DVD on your Linux-based computer can be easy and fun? Here are the steps and commands that allow you to do so.

Burning an ISO image
You can download your favourite Linux distribution and type the following single command:

$ growisofs -dvd-compat -Z /dev/dvd=your_linux_image.iso

Here /dev/dvd is your DVD burner device.

Burning a non-ISO image
For burning non-ISO images onto a DVD, first create an ISO image of the data and then burn the ISO image on the disk:

$ mkisofs -r -o /tmp/my_stuff.iso ~/Desktop/My_Stuff/

$ growisofs -dvd-compat -Z /dev/dvd=/tmp/my_stuff.iso

There are several options of mkisofs and growisofs that can be explored to suit your requirement.
You can read the man pages for more details of the commands and their options.

--Dibyendu Roy,
diby.roy@gmail.com

55. Find out the elapsed time of a running process

There are a lot of processes running on your Linux system. Here is a command that will let you know how long the process has been running:

#ps -eo "%p %c %t"|grep "sshd"

In response to the above command, you will get the following output:

2850 sshd 172-01:37:22
29532 sshd 125-09:07:10

In the above command %p is pid, %c is command and %t is elapsed time.