Showing posts with label Terminal. Show all posts
Showing posts with label Terminal. Show all posts

Sunday, November 12, 2017

Googler A Command Line tool for ‘Google Search’ from Linux Terminal (Ubuntu)


 
Hey Ubuntu geek here is something that might be new for you and this might be quite interesting as well. If you want to search from the command line and jump to a user-definable browser for results then try Googler. Googler is a powerful, feature-rich and Python-based command line tool for accessing Google (Web & News) and Google Site Search within the Linux terminal. It shows the title, URL and abstract for each result, which can be directly opened in a browser from the terminal. Results are fetched in pages (with page navigation). Supports sequential searches in a single googler instance. 
Googler was initially written to cater to headless servers without X. You can integrate it with a text-based browser. However, it has grown into a very handy and flexible utility that delivers much more. For example, fetch any number of results or start anywhere, limit search by any duration, define aliases to google search any number of websites, switch domains easily all of this in a very clean interface without ads or stray URLs. The shell completion scripts make sure you don't need to remember any options. Googler is a single standalone script, so you could download just a single file if you'd like to. This tool is not associated with google in any way.

Note: Googler is not in any way associated to Google. 

For installation of googler type the following command on your terminal screen.



sudo add-apt-repository ppa:twodopeshaggy/jarun
sudo apt-get update
sudo apt-get install googler

If this method do not work on your PC then do try this method as well or you can do as in video. 
First download latest version of Googler from: download here Note:(at the time writing the latest version was v2.9). Then type the following commands on your terminal screen



cd Downloads
wget -c https://github.com/jarun/googler/arch... 
tar -xvf v2.9.tar.gz
cd googler-2.9
sudo make install
cd auto-completion/bash/
sudo cp googler-completion.bash /etc/bash_completion.d/ 
Thank you! I have tried this only in Ubuntu this works fine from 12.04 to 17.10. Comment your queries. Do like Share and Subscribe for similar interesting blogs and videos.

REFERENCE

Friday, January 8, 2016

Knowing Python Version from Terminal

In Linux it is hard to see the version of any software and module. So from terminal typing:
python -V shows the version of Python that the python command resolves to.
This one is one easy way to figure out python version you are currrently using, but there are other uniwue methods to know which Python version you are using through terminal. Type python in terminal & by default you will see this below:
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
Here Python  2.7.6 is the version of your python.
In case  you tpye python 3.4 you will see:
Python 3.4.1 (default, Jul 31 2014, 12:46:17) 
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
In Ubuntu we can check the resolution with readlink -f $(which python). In default cases in 14.04 this will simply point to /usr/bin/python2.7.
We can chain this in to show the version of that version of Python:
 
$ readlink -f $(which python) | xargs -I % sh -c 'echo -n "%: "; % -V'
/usr/bin/python2.7: Python 2.7.6
But this is still only telling us what our current python resolution is. If we were in a Virtualenv (a common Python stack management system) python might resolve to a different version:
$ readlink -f $(which python) | xargs -I % sh -c 'echo -n "%: "; % -V'
/home/oli/venv/bin/python: Python 2.7.4

Wednesday, May 27, 2015

UBUNTU GUEST SESSION DISABLE


In case your laptop is never used by anobody else, then I see no use of Guest Session. Guest session is only necessary if you let other people to share your laptop. In my case I never let anyone to use my laptop, hence for me my user account is enough. So I removed the gurst session from my device.In order to remove the guest session, do following things in your terminal:
  • First open your terminal:  CTRL+ALT+T
  • Then type: sudo gedit /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
  • In your text editor simply add this line of code allow-guest=false
Now save your configuration file, Close it and restart, this is what you will see:





Tuesday, May 26, 2015

Troubleshoot Network Manager, Apache, Wireless...

Today's Blog is all about networking stuffs and I will be covering following points:
  1. Know your Network Controller Device with lspci
  2. Display all interfaces which are currently available, even if down with ifconfig
  3. Enable the service networking 
  4. Enable Apache server
  5. Then Enable Network Manager with network-manager
  6. Then  Enable your WiFi with nmcli nm

AND REMEMBER ALL THESE THINGS WILL BE DONE WITH OUR TERMINAL THIS IS WHY LINUX IS SO COOL...


Then we are all set to run the internet.And now we are some basic troubleshooter about networking, though networking is a huge this would be the first step. Not actually first first step in networking is always theory The Basics of Networking, but we are not dealing with it today. So lets begin

1. In order to know  the hardware devices assembled in your laptop open your TERMINAL CTRL+ALT+T and then type lspci .
This displays all the hardware devices  like PCI BRIDGE, SATA controller, SMBus, USB Controller, Audio Device assembled in your laptop / computer. 



My Network controller is:
02:00.0 Network controller: Broadcom Corporation BCM4313 802.11bgn Wireless Network Adapter (rev 01)

2. So now we need to know the interfaces that are available in our UBUNTU.  To see this type ifconfig in the terminal and you will see the output like this :

3. To access the internet first your hardware device should be activated, In order to do so type 
sudo service networking  and press tab twice which displays  arguments like:
 force-reload       reload        restart       start         stop
Perform any you need.

4.  To enable apache server in terminal type:

      sudo service apache2 start

5.  Now enable the network manager. In order to do so in terminal type:
    
     sudo service network-manager start 

6. Now First view the available connecting points Wireless point or Ethernet. To view the available wifi points in terminal type
    
     sudo nmcli con list



This displays the available devices With its UID and SSID.
Now to enable the wifi in terminal type:

      Sudo nmcli con up SSID or the UID

You can manipulate these basic networking commands and  triubleshoot on your own.

Sunday, May 24, 2015

UBUNTU DESKTOP WALLPAPER TWEAKS

Can you Set a picture of yours as default Ubuntu Desktop Wallpaper?

Well, setting a picture of yours as a wallpaper is totally different then setting default images as wallpaper.That picture of yours after it is deleted or moved in another location, your wallpaper either gets blank or some default images are set as wallpaper.

So in order to set your image as default image you should  work on following steps:
I have tried this tweak  on both 12.04 LTS and 14.04LTS and it works absolutely fine.
  1. First copy your image to /usr/share/backgrounds/ Do this from terminal using root prompt or do it from Nautilus  typing nautilus in terminal, so that you will not face permission denial.
  2. Edit  the XML file /usr/share/backgrounds/contents/trusty.xml and paste this code:
Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format which is both human-readable and machine-readable. It is defined by the W3C's XML 1.0 Specification[2] and by several other related specifications,[3] all of which are free open standards.[4]  (Definition referenced from Wkipedia)

<static>
    <duration>1795.0</duration>
    <file>/usr/share/backgrounds/Aurora_500PX.jpg</file>
  </static>
  <transition>
    <duration>5.0</duration>
    <from>/usr/share/backgrounds/Aurora_500PX.jpg</from>
    <to>/usr/share/backgrounds/Reflections_by_Trenton_Fox.jpg</to>
  </transition>

Instead of Aurora_500PX.jpg keep your filename.

     3. Edit file /usr/share/gnome-background-properties/trusty-wallpapers.xml

<wallpaper>
    <name>AURORA 500PX</name>
    <filename>/usr/share/backgrounds/Aurora_500PX.jpg</filename>
    <options>zoom</options>
    <pcolor>#000000</pcolor>
    <scolor>#000000</scolor>
    <shade_type>solid</shade_type>
  </wallpaper>

Edit your filename instead of Aurora_500PX.jpg




Default Ubuntu Wallpapers

Look there are fourteen default wallpapers in Ubuntu. Our purpose is to set our image in that list so that next time we won't have any problem even we lose the picture or move it to another location. 


You can see the image selected with red rectangle and its thumbnail inside the monitor on your left which is the AURORA Borealis  downloaded from 500PX.com
And you can even see I have messed up with images duplication.


Sunday, May 17, 2015

HOW TO SPEED UP UBUNTU?

My 'UBUNTU 14.04' takes too much time after first boot. Well genius people will have many tricks and tweaks to speed up their systems but as a beginner  I am researching in the internet about following things which can possibly boost up performance of Ubuntu:
  1. Packages / Software installed in my #Ubuntu.
  2. Distinguishing useful / obsolete software.
  3. Removing unnecessary software, Releasing space, which can increase the speed.
This could be one way of solving the problem of slow performance of speed.

Today I will show  some ways to see the packages  and software installed in Ubuntu.

  1. Synaptic Package Manager

To open the Synaptic Package Manager in terminal type:

algosig@surfer:~$ sudo synaptic

This will open the GUI of Synaptic Manager. From there you can explore the installed packages.

    2. dpkg --get-selections

To get a list of packages installed locally do this in your terminal:

algosig@surfer:~$ sudo dpkg --get-selections | grep -v deinstall

To save that list to a text file called packages on your desktop do this in your terminal:

algosig@surfer:~$ dpkg --get-selections | grep -v deinstall > ~/Desktop/packages

     3.  aptitute

To get just the packages which were expressly installed (not just installed as dependencies), you can run

algosig@surfer:~$ aptitude search '~i!~M'

This will also include a brief description, which you may want. If not, use the option -F '%p'


     4. Create Backup

Create a backup of what packages are currently installed:

algosig@surfer:~$ dpkg --get-selections > list.txt

Then (on another system) restore installations from that list:

algosig@surfer:~$ dpkg --clear-selections

algosig@surfer:~$ sudo dpkg --set-selections < list.txt

To get rid of stale packages

algosig@surfer:~$ sudo apt-get autoremove

To get installed like at backup time (i.e. to install packages set by dpkg --set-selections)

algosig@surfer:~$ sudo apt-get dselect-upgrade

There are many documentations available in the internet and I searched only few intelligent peoples'  brain. There are many users out there with creative ideas to manipulate terminals and  bash scripts. it can by you as well.

So now I know to list out all the packages and save them in txt file. Next time I will show some methods to remove the old and obsolete packages. In a few blogs we will be able to maintain the speed of our OS i.e. UBUNTU

See you guys soon.

About Me

authorHello, my name is Jack Sparrow. I'm a 50 year old self-employed Pirate from the Caribbean.
Learn More →