Google+ open-source construction: terminal Google+
Showing posts with label terminal. Show all posts
Showing posts with label terminal. Show all posts

Friday, December 16, 2011

Increase your update speed using Linux Mint: apt-fast script




I just wanted to write today about how you can use a simple script to increase your update times. Speeds, up to four times as fast have been reported using this script. It is ridiculously easy to install this script, that any script kiddie can use it.

First of all you will need to install the axel download framework. So your first step to installing this script is to install the axel framework, from the terminal.



$ sudo apt-get install axel

After which you will enter your user password, press "enter", and also press "y" when prompted. After which you will just wait for the "$" prompt to appear, that signals your software is installed.

The rest is really easy. Start by downloading the script from this link, here. Make sure to download this to a place, that is easy to remember.

Next go to that location. I often right click on the Firefox download manager, and select "go to location".

Next you will need to place the script into the /usr/sbin folder.

If you still have your terminal open you can use the following commands:


$ cd Downloads

 ~cd is much like it is in the DOS command line shell from MS, because it stands for change "Change Directory", and performs the same function. 
$ sudo mv apt-fast.sh /usr/sbin/apt-fast
~sudo is needed to add, remove, or modify files within system file directories.

~mv is the command for moving a file for one place to another. This is the same as cp(copy), except that after the copy from place A, to place B the file is deleted from the original location.

~when using a mv, or cp command the first file name is the original name/location of the file. The location of the file was not used in this command because it is assumed, that you are already located in the directory(folder); that contains the script file.

~Notice that the second file has not ".sh" extension @ the end of it. This is how files are renamed within the Linux terminal, by the destination being different from the original file.

The main benefit from this command is that you can move the script to the correct location, and rename it at the same time.

You will also need to add permissions for the script to be executable with the following command.

$ sudo chmod +x apt-fast

 Now for the GUI(graphical User interface) way of doing things.

(this assumes that you downloaded the script to your Downloads directory(folder), within your User home folder.)

Step 1)Change the file name to just apt-fast.

*Downloads is the default location for your Firefox downloads.*

First rename the scrip to just apt-fast.
 
After the following screen, just move your cursor to the end of the line with the "end" key, or three presses of the arrow key. Once your cursor is at the end of the file name, then just simply press the backspace key three times. This will get rid of the .sh file extension. After you have done this press the "enter" key to finish renaming the file. By the way this is the same way you rename files in Windows.

Step 2)Change the permission of the file to allow for the execution of the code.

This involves a few simple clicks. First you will need to right click the menu, and select properties, at the bottom of the context menu.

PRO USER TIP: context menu
                          keyboard- shortcut.

"shift" + "F10"

*This will only help if the file is selected(highlighted)*

Then the following menu will appear.





Now you will need to click on the "Permissions" tab. The "permissions" tab is located in between the selected "Basic" tab & the "Open with" tabs.








Now all you need to do is to click the check box "Allow executing file as program", and click close the window.



To open up Nautilus with root privileges, you will first need to open the run dialogue, and then type in the following command:

"alt" + "F2"
gksu nautilus
Make sure to substitute <your_user_name> with the user account you are logged in under. If not you will not find the folder when you open Nautilus with root permission. 

This will open up a nautilus file manager with root power.

Enter your password, and select "OK".


Next you will need to navigate to your users Downloads folder.

From this screen there are two ways to navigate to the "/" of the file system. You could either use the keyboard shortcut "alt" +   <up arrow>, or you could click on the little Less than sign, and the small hard drive that appears.
select the highlighted home folder.
 You will find a folder within this "home" folder, that is named <your_user_name>; that contains your "Downloads" folder.

I have two user folders within my "home" folder, because I have separate user accounts for me and my roommate. 
PRO USER TIP: In order to use the split view for easy drag/drop of your files within nautilus you can use the "F3" key to toggle split pane view, or navigate the view drop-down menu and select "extra pane". When you are in split pane view the window that has a white background, is the one that is active.

Now you will need to double-click the "Downloads" folder. 

Now that you are within the "Downloads" folder as root, you will need to right-click & select the copy option. 

 
Now you will need to navigate to the / of the file-system, before navigating to the /usr/sbin folder. You can do this by selecting the small Hard drive icon, just to the Left of the home button. From here you will need to double-click on the "usr", and "sbin" folders in turn; until you end up at the following location.

Click through the highlighted /usr folder, and also double click the /usr/sbin folder within the /usr folder. Make sure not to put it in the /sbin directory on the base of the file-system.
congratulations you finally found the /usr/sbin folder.
Now you will need to right click anywhere that is not a file, until you find the following menu; and select "paste".
 
Now your apt-fast script is installed, and here is how you use it. When you would normally use a command like apt-get update, now you will use apt-fast update. It is that simple. 

Let's open a terminal to check it out:

"Ctrl." + "alt" + "t" :opens a terminal window, without having to search for your distribution's terminal program within a burred menu.
PRO_User_TIP: Notice how I added the apt-fast upgrade, and the apt-fast upgrade commands together with the double ampersand symbols; so that I don't have to wait for one command to complete before starting another.
Enter your password when prompted, and don't panic if you don't see anything when you type your password; just do it and press "Enter".

notice the three connection's, all collecting bits of the file; all at the same time.
type "y", and "enter" when prompted by the [y/n] prompts. All activity will stop until you choose "y" or "n".
Done already? verify that all packages are installed properly. If errors are found, run apt-get clean as root and try again using apt-get directly.

Monday, December 12, 2011

How 2: take screen-shots with Linux.


Many of you have probably noticed how many screen-shots I use within my Blogs, so I have decided to demonstrate just how easy it is to capture screen-shots on a Linux Operating system. 


Most of the time when you want to take a screen-shot of your desktop, you want to either take a picture of either your whole desktop or an individual window. In order to do this you will need to Learn two hot-key keyboard combinations.

hitting the print screen button by itself will take a simple screen-shot of the entire desktop. This is usually abbreviated as "prt scr".

If you are on a smaller computer, the "prt scr" might be a dark blue colo, which is the case on my LGx120 netbook. So when I want to press the "prt scr" key on my netbook I have to hit the "fn" + "prt scr" keyboard combination to trigger a screen-shot of my desktop. On my net-book the "prt scr" button is inegrated with the "pg up"(page up) key.
The next key combination you will need to Learn is the what triggers a screen-shot of the active window on a Linux computer. The key combination is "Alt." + "prt scr". Which also means that if I want to take a screen-shot of an active window, while using my net-book; I have to hit "fn" + "alt" + "prt scr".
What happens next, is what makes taking screen-shots in Linux so much easier than windows. In windows the key combinations are the same, but what happens after a correct key combo press is very different. Watch what happens in Linux:

a screen-shot save preview window, of me starting to write this Blog within Blogger.
Now you may think that I have an incredibly expensive wide-screen at home. This is actually a dual-screen desktop PC, thanks in part to my friend Robert who gave me a second monitor.

If you want to know how to configure you Linux PC, with a dual-screen setup then please check out a previous post here.

If the save in folder is where you want to save your picture, then just click save. You could also just hit enter, or hit "alt." + "S". If you want to save to a different folder, like the a folder that you create just for a series of screen-shots; then select other from this drop down menu.



Windows in contrast does not give you a preview window, of the image you just captured. This confused me when I first learned the windows way. Windows assumes that you already have a window open that you want to place the image in. Once a program is open like an office document, or the GIMP on windows then you paste it in. You can do that with the "ctrl" + "V " keyboard shortcut, or right click and select paste from the context menu options. For a better explanation than I can give please click here.
Wilber the GIMP mascot.

I sometimes choose to use the (GNU Image manipulation Program) to crop, and re-save my pictures.

Here is a short, and simple video that describes how to crop, and re-save an image that you have captured using the GIMP.

 

 Now that will cover your needs 98% of the time. But what if you want to capture a menu in action. You may want to show your viewers what the menu looks like, that you are trying to describe. In Linux you cannot take a screen-shot while there is a window menu active. You also cannot take screens of tool-tips.


That is where the screen-shot tool shutter comes into play. There are many things that you can do with shutter that really help you speed up the screen-shot process, if you are like me and take tons of screen-shots.

main shutter application of shutter.
Shutter features:

  • Screen-shot session management.
  • Blur sensative data from pictures.
  • Highlight important data in multiple ways. 
  • Crop your selected picture.
  • Set a timer for when to snap the screen-shot.
  • Select an active menu, or series of menus for a screen-shot.
  • Select an active tool-tip for your screen-shot. 
  • Upload to an FTP file server.
  • Upload directly to your Ubuntu one account.
  • Choose whether or not to include the cursor in your  screen-shot.
  • Choose to let shutter handle your key-board combinations, for screen-shot. (aka..."prt scr" && "alt" + "prt scr")

Shutter is included in both the Ubuntu/Linux, and Linux Mint repositories.

Although the preferred way to do this is through the Linux terminal. That way when a new version is available you will have access to it right away. There is generally a lag in time between when a new version is posted to a repository, and when it is available for your distribution's software manager.

If you wish to earn geek credit, and get the newest application updates as soon as they are released; then do the following:

"ctrl" + "alt" + "T" ~ Launches a terminal window
 copy and paste the following commands into your terminal:
 $ sudo apt-add-repository ppa:shutter/ppa
press [enter] when you reach this screen to add the PPA.

{enter password when prompted, and hit return}
gpg keys are encryption keys that verify your software is malware free, and was not corrupted during download.

$ sudo apt-get update && sudo apt-get install shutter
**you may need to type a [y] if prompted.**
 I truly hope everyone who has read this post, has learned as much as I did writing it. It is highly likely that I will write a follow up post on the screen-shot tool "shutter".
Google+