Sunday, May 17, 2015

Linux Mint 17.x - Helpfull tips, tricks, and things to know.

Hello everyone

Here is a short list of helpful tips, tricks, and things to know, about Linux Mint 17.x

This blog entry is going to be a simple one. It is written mostly for people who are new to Linux Mint. But more experienced users might find a few gems in it as well. 

These are not in any particular order. 

Also, I'm trying some new ideals for text colors. Hopefully, this will make the text easier to read. Please let me know what you all think.

If you find this info useful, please let me know. Thanks.



A shortcut to open a Terminal Window

To open a Terminal window, while holding down the [Ctrl] and [Alt] keys, tap the letter "T" once.

You can then use this window to enter Linux commands.

To exit gracefully from this window, simply enter this command.
   exit



A shortcut to open your home folder in a file browser window.

To open this window, while holding down the [Alt] key, tap the [F2] key once.
This will open the "Run Application" dialog box.

Next, release the [Alt] key. 

Press the period "." key, and then press the [Enter] key.


Also, on some versions of Linux Mint, you can open your home folder by holding down the [Ctrl] key and tapping the letter "N" once. However, this only works if you are using Natilus as your file browser. And just to make things a bit more complited, on some versions this key combination will open your web browser, not your file browser. So, to keep things simple, I recomend you make a habit of using the first technique (above).



A shortcut to open your root folder in a file browser window.

While holding down the [Alt] key, tap the [F2] key once.
This will open the "Run Application" dialog box.

Next, release the [Alt] key.

Press the slash "/" key, and then press the [Enter] key.

Note: Be sure to use the slash character "/", and not a backslash "\".



A shortcut to open a webpage

While holding down the [Alt] key, tap the [F2] key once.
This will open the "Run Application" dialog box.

Next, release the [Alt] key. 

Enter the webpage URL like this example, and then press the [Enter] key.
    http://www.cnn.com

Note: Be sure to include the "http://" part of the URL. This is what tells Linux that this is a web page and not a file on your hard drive that you wish to open. 

Note: Be sure to use the slash character "/", and not a backslash "\".




How to connect to a public WiFi network

This is how you can connect to a public WiFi network like those found at many coffee houses, public libraries, and fast food restaurants.

In most cases, it is a two step processes to make such a connection.

Step 1:

Look for your Network Connection icon in the lower right corner of your screen. Its the icon that looks like a tinny bar-graph, or like a broken cable for a red 'x' next to it.

Click on this Network Connection icon.
It will show you a list of any near by WiFi networks.

Next, Click on the WiFi network for your current location. If you don't see it, click on the "More networks" option to find it.

Wait for a few minutes for you computer to make the connection.

Step 2:

Next, open your web browser and try to go to any web page. 
You can do this by holding down the [Alt] key, tap the [F2] key once, and entering this command.
   http://www.cnn.com

Chances are you will be re-directed to a web page showing you the rules and restrictions of using this WiFi network, and a "Accept" or "Connect Now" button to accept these rules. 

Click on that "Accept" button.

You are now connected to the WiFi network.




How to find out your current IP address

Note: Your IP address will be a group of 4 numbers, separated by period "." characters. Example: 192.168.1.18  

Note: Each time your computer connects to a network, it will probably be assigned a new IP address. So don't rely on your IP address being the same as it was the last time.

There are 2 good ways to find your current IP address.

Technique 1:

Look for your Network Connection icon in the lower right corner of your screen. Its the icon that looks like a tinny bar-graph. If you see an icon that looks like a broken cable for a red 'x' next to it, it means that you are not current connected to a network.

To find your current IP address, Right click on your Network Connection icon, and then click on "Connection Information". Your current IP address will be near the center of the information that is displayed.

Technique 2:

Open a Terminal Window by holding down the [Ctrl] and [Alt] keys, and tap the letter "T" once.

Enter this command and then press the [Enter] key.
   ifconfig

This will display several blocks of information on your screen. Look for the block labeled "wlan0". Within this block of information, your current IP address will be the one labeled "inet addr". If you don't see such an item, it probably means that you are not connected.



How to find your users name

Open a Terminal Window by holding down the [Ctrl] and [Alt] keys, and tap the letter "T" once.

Enter this command and press the [Enter] key.
    whoami

Your user name will be displayed in response to this command.




How to add an application icon to your desktop

Click on the "Menu" button at the bottom of your screen.

If the options that come up have the title "Favorites" at the top, click the "All Applications" button to the right.

Select the "All" category in the left column, and then scroll down the right column until you find the application you wish to add.

Right click on that application, and then click on "Add to Desktop".

Press your [Esc] key a few times to get back to your desktop.

If you find that some of your new desktop icons have been places on top of each other, right click on an empty area of your desktop, and then click on "Organize desktop by name".




How to install new software packages from the software repository

There are two good ways to do this.

Technique 1:

Click on the "Menu" button at the bottom of your screen.

If the options that come up have the title "Favorites" at the top, click the "All Applications" button to the right.

Select the "Administration" category in the left column, and then scroll down the right column until you find the "Software Manager" application. Click on that Software Manager application.

Enter your password when you are prompted.
It may take a few minutes for the app to start.

If you know the name of the package you wish to install, you can use the search box in the upper right corner to quickly search for it. If you wish to just browse and see what is available, click on any of the category icons and take a look.

When you find a package you wish to install, simply press the "Install" button at the top of the screen.

Technique 2:

While holding down the [Alt] key, tap the [F2] key once. This will open the "Run Application" dialog box.

release the [Alt] key. 
Enter this command, and then press the [Enter] key.
    gksu mintinstall

Enter your password when you are prompted.
It may take a few minutes for the app to start.

If you know the name of the package you wish to install, you can use the search box in the upper right corner to quickly search for it. If you wish to just browse and see what is available, click on any of the category icons and take a look.

When you find a package you wish to install, simply press the "Install" button at the top of the screen.



How to un-delete a file that you accidentally deleted

If you have accidentally deleted a file, there is a short window of time in which you might be able to get it back....maybe.

While holding down the [Alt] key, tap the [F2] key once.
This will open the "Run Application" dialog box.

release the [Alt] key.

Enter a period "." and then press the [Enter] key.
This will open your home folder in a file browser window.

On the left side of this window, you should see an icon labeled "Trash".
Click on that icon.

If you see your deleted file in that Trash folder, you can then left click on it, and click on Restore.




How to take a 'screen shot' and save the image to a file.

There are two ways to do this.

If you want to capture an image of the entire screen and save it to a file, simply press the [PrtScr] key at the top of your keyboard.

If you want to capture an image of only the active window, hold down the [Alt] key and tap the [PrtScr] key.




How to tell if you are running a 32-bit or 64-bit version of Linux.

Open a Terminal Window by holding down the [Ctrl] and [Alt] keys, and tap the letter "T" once.

In this Terminal Window, enter this command:
     uname -m

If the answer you get back is "i686", then you have the 32-bit version installed.

If the answer you get back is "x86_64", then you have the 64-bit version installed.

Important: This will NOT tell you if your computer has a 32-bit or 64-bit processor. A 32-bit version of Linux will run quite happily on a 64-bit processor. It will only tell you if the version of Linux you are running is 32 or 64 bit. To find out what kind of processor your computer has, see "How to create a hardware report" bellow.

Note: There are many third party software packages that have different download files, depending if you are running 32-bit or 64-bit versions of Linux Mint. Two examples are Google Earth, and FireStorm. You can use this command to figure out which one is correct for you.



How to create a hardware report of your computer

Open a Terminal Window by holding down the [Ctrl] and [Alt] keys, and tap the letter "T" once.

If you have not installed lshw yet, you can do so by entering this command into the Terminal Window. You will be prompted for your password.
    sudo apt-get install lshw -y

To display the hardware report on your screen, enter this command into the Terminal Window. It may take a few minutes to run. You can use the scroll bar on the right side of the window to scroll up and down.
    sudo lshw

To write the hardware report to a text file, enter this command into the Terminal Window. You can change the name of the text file if you wish.
    sudo lshw > MyReport.txt




How to reset your time zone settings

Open a Terminal Window by holding down the [Ctrl] and [Alt] keys, and tap the letter "T" once.

Enter this command and press [Enter]. You may be prompted for your password.
     sudo dpkg-reconfigure tzdata

Use your up and down arrow keys to move through the menus. Use your [Enter] key to select the option that best fits your time zone. If you don't see an option that fits your time zone, be sure to scroll all the way down; more options may be further down the menu.

Note: If the clock at the bottom of your screen is showing the wrong time, chances are that your time zone needs to be reset. 



How to view (real time) the processes running on your computer

Open a Terminal Window by holding down the [Ctrl] and [Alt] keys, and tap the letter "T" once.

Enter this command. You may be prompted for your password.
   sudo top

Use your up and down arrow keys to scroll through the list.
The screen will update ever few seconds.

To quit, hold down the [Ctrl] key and tap that letter "c" once.



How to 'kill' a process on your computer

Warning: Killing some processes can cause your computer to crash. Use this technique only if there is no other way to kill a processes.

See the "How to view (real time) the processes running on your computer" above, to find the PID number of the process you wish to kill.

Quit the top command by holding down the [Ctrl] key and tap that letter "c" once.

Enter this command, replacing the words "ProcPid' with the PID number of the processes to be killed.
     sudo kill -9 ProcPid

Example, if the PID of the process you wish to kill is 1234, the command would be:
     sudo kill -9 1234



How to 'download' a YouTube video

Note: You can use this tool to download a YouTube video to your hard drive for latter off-line viewing, or in case the video should be removed for YouTube.

While the video is playing on your screen, left click on it, and then click on "Copy video URL at current time". This will copy the URL to your clipboard.

Open a Terminal Window by holding down the [Ctrl] and [Alt] keys, and tap the letter "T" once.

If you have not already done so, install the youtube-dl package by entering the following command. You may be prompted for your password.
    sudo apt-get install youtube-dl -y

If you wish your video to be downloaded to your Videos folder instead of your home folder, enter this command. The 'V' is uppercase, all other letters are lower case.
    cd Videos

Now, all on one line, type the command   youtube-dl  , a space, a double quote, right click on the window and click on past (past the video URL into the command line), and then end with anotehr double quote. 
The command should look something like this.
   youtube-dl "https://www.youtube.com/watch?feature=player_detailpage&v=g6eWVl4_0_s#t=26"

After you have your command 'built', press the [Enter] key to start the download.




How to give execute permission to Bash and Python files

Open a Terminal Window by holding down the [Ctrl] and [Alt] keys, and tap the letter "T" once.

If the files are in a sub-directory, you will need to use the cd command to change directories. Your command might look something like this.
    cd MyDirectory

Enter the following commands to set the execute permissions. You may be prompted for your password.
    sudo chmod -vR a+x *.sh
    sudo chmod -vR a+x *.py

Note: In order for a Bash or Python script to be executable, they must be granted execute permission. This is what tells Linux that these are not just text files, but are actually scripts that can be run. 




How to search your files for a string of text

Open a Terminal Window by holding down the [Ctrl] and [Alt] keys, and tap the letter "T" once.

Enter the following command, replacing the word MyString, with the string of text you are looking for.
     find . -type f -print0 | xargs -0 grep -l "MyString"

Hint: Rather than type this command in by keyboard, you might want to save this command to a handy text file, so you can quickly copy \ past it into the terminal window whenever you need it.

Example: This will search all my files for the name Harry Lorayne, and show me a list of those files.
     find . -type f -print0 | xargs -0 grep -l "Harry Lorayne"

Example: this will search all my files for any pertaining to auto insurance, and show me a list of those files.
     find . -type f -print0 | xargs -0 grep -l "auto insurance"

Important: The "|" character used in this command is NOT a colon ":". It is the character that looks like two vertical lines stacked on top of each other. It is usually just above the [Enter] key on most keyboards. It's called a 'pipe'. It's function: take the output of the command to the left, and pass it as input to the command on the right. 

Note: This command can take a few minutes to run; be patient if it does not respond right away.





How to scan for a virus

Note: Linux Mint seldom, if ever, has problems with viruses. But if you feel that you really do need to scan for viruses, here is how to do it,

Open a Terminal Window by holding down the [Ctrl] and [Alt] keys, and tap the letter "T" once.

If you have not already done so, install the clamtk virus scanner, by entering this command. You may be prompted for your password.
    sudo apt-get install clamtk -y

Next, download the most recent virus definition file by entering this command. You should do this each time you need to run a scan to ensure you have info about the latest viruses.
    sudo freshclam

To start the clamtk application, enter this command.
    sudo clamtk

Wait for a few minutes while the application starts.
Hold down the [Ctrl] key and tap the letter Z to start the scan.
It may take a few hours to scan the entire system.



How to find information about a Linux command
(Does NOT require an Internet connection)

If you don't already have a Terminal window, open one by holding down the [Ctrl] and [Alt] keys, and tap the letter "T" once.
 
Into this window, enter the word 'man', a space, and then the command you are asking about. Example:    man mkdir

Use your arrow keys to scroll up and down through the documentation.
When you are done, press the letter 'Q' to quit.

Here are a few examples:
    man cd 
    man ls 
    man mkdir
    man kill
    man dir

Note: About the ls command mentioned in the above example: its the lower case letters LS, and not the number one and S.




How to add applications to the "startup" list

There is a list of applications on your computer that start automatically every time your computer boots up. If you wish some other applications to also start automatically, like perhaps thunderbird or firefox, you can add these to the list.

To make changes to the list, click on the "Menu" button at at the bottom of your screen. Then click on "Preferences", and then on "Startup Applications". 

The interface is pretty straight forward.




How to use wget to download files

Wget is one of those old-school Linux commands that is very useful if you know how to use it. It allows you to download files from the Terminal window, or from withing a Bash script. Files can be downloaded to a laptop or a tablet PC for viewing latter when an Internet connection is not available. The commands can be included in a Bash file and run every weekend as part of a regular ToDo list.

Note: Remember that Bash script files have a ".sh" file extension, and need to have execute permission in order to run. See "How to give execute permission to Bash and Python files" above.

The basic syntax of the wget command is either:
   wget FileURL
       or
   wget FileURL -O OutputFileName

Note: If you use the -O option to specify the output file, the "O" has to be uppercase. The lower case "o" option means something else.

Example: Commands to download the most recent King County Metro system maps to a tablet PC for off-line viewing. 
Note that in this example we are NOT using the -O option. We are keeping the same file names as the source.

   wget "http://metro.kingcounty.gov/maps/system/pdf/metro-system-map-northwest.pdf"

   wget "http://metro.kingcounty.gov/maps/system/pdf/metro-system-map-central.pdf"

   wget "http://metro.kingcounty.gov/maps/system/pdf/metro-system-map-southwest.pdf"

   wget "http://metro.kingcounty.gov/maps/system/pdf/metro-system-map-southeast.pdf"

Example: Command to download the schedule for bus 244 to a tabet PC for off-line viewing.

   wget "http://metro.kingcounty.gov/schedules/244/s0.html" -O "ScheduleForBus244.html" 

Example: Command to download the most recent earthquake data for the past 7 days from the US Geological Survey website. 
Use Libre offices to work with this data.

   wget "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.csv" -O "EarthQuakeData.csv"

Example: Command to download the most recnet news boradcast from NHK (Engish version from Japan - MP3 format). 
After download, double click on this file from withing your file browser to lessen.

   wget "http://www3.nhk.or.jp/rj/podcast/mp3/english.mp3" -O "NHKNews.mp3"





How to delete a file so that it can NOT be un-deleted

Warning: This technique describes how to use a software tool called 'shred' to securely delete a file so that it's contents can NOT be recovered. There is NO way to get the information back after the file has been 'shredded', so please, use caution.

Note: Shred works by overwriting the data in the file several times with random junk before it's actually deleted. So even if the filespace is successfully recovered, all that will come back is that random junk.

There is nothing that needs to be installed to use shred. It comes built into Linux Mint, ready to go.

If you don't alreay have a Terminal window open, you can open one by holding down the [Ctrl] and [Alt] keys, and tap the letter "T" once.

Enter the following command, replacing the word FileName with the name of the file to be shredded, and then press [Enter].
   shred -uv FileName

Examples:
   shred -uv MyPrivateData.doc
   shred -uv ./Documents/TopSecurity.doc
   shred -uv ./Pictures/NudePicture017.jpg
   shred -uv ./Downloads/BankRecords.csv

For more information about shred, enter this command in to the Terminal window. This will display the documentation.
   man shred



How to use your laptop/webcam as a makeup mirror

Note: Save space in your luggage by leaving your mirror at home; use your laptop/webcam as a makeup mirror. Not really the best utilization of your laptop, but guaranteed to up your 'geek cred' with your friends.

Open a Terminal Window by holding down the [Ctrl] and [Alt] keys, and tap the letter "T" once.

If you have not already done so, install the cheese application, by entering this command. You may be prompted for your password.
    sudo apt-get install cheese -y

To start cheese, enter this command.
    cheese

Your face will then appear on your screen as if it were a mirror.





How to use your laptop as an alarm clock and timer

Open a Terminal Window by holding down the [Ctrl] and [Alt] keys, and tap the letter "T" once.

Install the application by entering this command. You may be prompted for your password.
   sudo apt-get install alarm-clock-applet -y
 
You can start the application by entering this command, or by clicking it's icon until the Accessories menu.
   alarm-clock-applet

The interface is pretty straight forward.

The application runs in the background, so you don't need to keep the window open in order for it to wake you up in the morning. Just make sure to leave your laptop plugged into power, and running beside your bed.




How to have your computer read to you.

Note: Does NOT require a president Internet connection, but quality of the voice is ..... limited. Also, you will probably want to use headphones so as to not disturb people around you.

Open a Terminal Window by holding down the [Ctrl] and [Alt] keys, and tap the letter "T" once.

If you have not already done so, install the espeak application and gui, by entering this command. You may be prompted for your password.
    sudo apt-get install espeak espeak-gui -y

To start, enter this command.
    espeak-gui

Then Copy / Past the text, or ebook, to the text area of the gui, and click the [Play] button. 
Next, sit back with your cup of coffee as your computer reads the text to you.
At first, the 'voice' is difficult to lissen to. It sounds very macanical, and it may be difficult to understand some of the words. But give it a chance and I think you will find that it will improve over time.

Note: Free ebooks as Text files can be downloaded from the "Project Gutenberg" website https://www.gutenberg.org/ . You can them cut/past a few pages at a time into the espeak-gui window and have it read the book to you.




How to install Google Earth

Note: Google Earth is one of those rare packages that you can't simply install from the software repository, but instead needs to be installed from a web page. I believe that this is because of some copyright limitations. You need to agree to the copyright before you can download it.

Since it's such a popular package, I figured it needed it's own entry in this blog post.

Refer to the section above titled "How to tell if you are running a 32-bit or 64-bit version of Linux" to determine if you are running a 32 or 64 bit version. You well need to know this to download the correct files.

Go to this web page
http://www.google.com/earth/download/ge/agree.html

Scroll down to the bottom of the page.

If you are running a 32 bit version of Linux Mint, select the option that reads "32 bit .deb (For Debian/Ubuntu)".

If you are running a 64 bit version of Linux Mint, select the option that reads "64 bit .deb (For Debian/Ubuntu)"

Then, click the button that says "Agree and Download".

When prompted, select the option that says "GDebi Package Installer (default)" and click on the OK button.

If you get a dialog window that says "An older version is available in a software channel", just click the Close button and continue.

When prompted, click on the "Install Package" button in the upper right corner of the window.

Enter your password when prompted.

When the Installation is Finished, just click the Close button.

If you would like to add an icon to your desktop to launch Google Earth, refer to the section above titled "How to add an application icon to your desktop".



That's it for this time.
   So, until next time, good bye, Joe.