Tuesday, 18 February 2014

Solve GPG Error : “ The following signatures were invalid: BADSIG ” in Ubuntu Updates

After a long time I was updating my Ubuntu. Thankfully my daily data usage quota was remaining.
I expected everything to go as usual but the sudo apt-get update command gave me an error:

Reading package lists... Done
W: GPG error: http://extras.ubuntu.com raring Release: The following signatures were invalid: BADSIG 16126D3A3E5C1192 Ubuntu Extras Archive Automatic Signing Key <ftpmaster@ubuntu.com>
W: GPG error: http://ppa.launchpad.net raring Release: The following signatures were invalid: BADSIG B22A95F88110A93A Launchpad PPA for Bumlebee Project
W: GPG error: http://ppa.launchpad.net raring Release: The following signatures were invalid: BADSIG F1773AF13B1510FD Launchpad PPA for GNOME3 Team

To remove the bad signature error, open the terminal (Ctrl+Alt+T) and use the commands given below one by one:

sudo apt-get clean 
cd /var/lib/apt 
sudo mv lists lists.old 
sudo mkdir -p lists/partial 
sudo apt-get clean 
sudo apt-get update

After using these commands you should get rid of the errors and your Update Manager should be working fine.

Or just create a shell script with these command for future use.



Monday, 7 October 2013

Host a Simple Server and Share Files through LAN


If you need a quick web server running and you don't want to mess with setting up apache or something similar, then Python can help. Python comes with a simple builtin HTTP server. With the help of this little HTTP server you can turn any directory in your system into your web server directory. The only thing you need to have installed is Python.

All Thanks to Abhishek Damodara for introducing me to this powerful python command. I came across this when we both where working on a sudoku solver python code in Bhilai (yes PS-1 in Bhilai is EPIC)  and we needed to share the code. I was irritated with sharing code with pendrive so he just went to his working directory and wrote this simple script. All i had to do was just get his IP and open browser and type 10.X.X.XX:8000 and vola i can access all those file.

Assume that I would like to share the directory /home/arnab and my IP address is 10.3.1.69


Open up a terminal and type:
$ cd /home/arnab
$ python -m SimpleHTTPServer


That's it! Now your http server will start in port 8000. You will get the message:

Serving HTTP on 0.0.0.0 port 8000 ...





Now open a browser and type the following address:
http://10.3.1.69:8000

You can also access it via:
http://127.0.0.1:8000






If you wish to change the port that's used start the program via:
$ python -m SimpleHTTPServer 8080




To Stop the Server just press Ctrl + C .  Thats it you are done 

If u press Ctrl + Z instead u can start the server again u need to kill the process .To do so type:


$ netstat -plntu | grep 8000
$ kill -9 4920

8000 is the port where you hosted the server and  4920 is the process id which u got from the previous command's output.


Here i stopped the server by pressing Ctrl + Z , thats why i can't start the server again. I killed the process as shown.



Tuesday, 25 June 2013

Adobe PhotoShop for Ubuntu

Now a days I only log into windows when I have some work related to photoshop (well I don't play AOE these days).I personally didn't liked GIMP so I want Adobe Photoshop in my Ubuntu. Its very irritating to switch to windows just to use photoshop.Finally i can say good bye to windows. Ubuntu :-*

 

Install Wine

Wine allows you to run many Windows programs on Linux.
If you wish to install the one in the official repositories. 
Installation options:
  1. Open Ubuntu software Center and search for wine and install it.
  2. From Terminal:

    • sudo apt-get install wine
    • winecfg
    (this is what I did)
If you wish to have the latest version you're better off adding the official wine ppa.In a terminal type:
  • sudo add-apt-repository ppa:ubuntu-wine/ppa
  • sudo apt-get update
  • sudo apt-get install wine1.5
  • winecfg
winecfg command generates a ~/.wine folder. To see such files Edit Preferences > check "Show hidden and backup files"
If by any chance you messed with it and you want to reconfigure:

Steps to reconfigure Wine :

  • You should be able to rename ~/.wine to ~/.wine.backup 
  • run the wine configuration program from the menu or from the command-line (winecfg)
  • a new ~/.wine will be regenerated and you will still have the old wine folder.
To know more about wine here is the link.

Download Adobe Photoshop CS6 Extended

Here is the link to download photoshop.
If this link doesn't work u can always google ;-)
This file will be same for Windows too.

Installing Photoshop

  • Extract the downloaded zip anywhere in your Ubuntu file-system.
  • Go to the folder you will find a file named "Adobe Photoshop CS6 Extended.exe".
  • Right Click and check if you see the option "Open with Wine Windows Program Loader".
  • Just do next> accept license
  • Better Don't change the destination folder
  • Keep Calm and do next :-)
  • Cheers!!! Photoshop is installed

Feel Free To comment :-)
Doubts and suggestions are welcome

coming up Next replicating Adobe master collection installed in windows into Ubuntu 

Saturday, 22 June 2013

Add facebook like button to every post and blog


The Like button is a simple plugin that lets people quickly share content on Facebook.
Clicking a Like button on a site creates a connection in the graph between the content and the person who clicks the button. Clicking the Like button also publishes an Open Graph Like action, and displays stories on that person's timeline and their friends' news feeds. This story will link back to the site and drive distribution of content.

To add facebook like button to every post

  •  open your blogs dashboard 
  •  select Template option

Before editing your template Back up your Template in your PC
  • Click on Back / Restore option in top right corner
  • Click Download full template
  • Click on Edit HTML

  • Click on the html text 
  • Press Ctrl+F key and search for "<data:post.body/>"

    You will get 2 or 3 of these. The required one has this piece of code before it
    <div class='post-body entry-content' expr:id='&quot;post-body-&quot; + data:post.id' itemprop='description articleBody'>
    <data:post.body/>
     
  • Paste the following code just above <data:post.body/>
    code:
    <b:if cond='data:blog.pageType != &quot;static_page&quot;'> <iframe allowTransparency='true' expr:src='&quot;http://www.facebook.com/plugins/like.php?href=&quot; + data:post.canonicalUrl + &quot;&amp;send=false&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=21&quot;' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:90px; height:20px;'/> </b:if>


  •  Save template
     
  • This will add facebook like button just below posts title



 To add facebook like button to your blog page

  • Copy your blogs link
    you find it in settings tab of your blog under Publishing

    in my case its "http://arnab-how-to-do.blogspot.in/"

  • Go to facebook developers > social plugin > Like Button
  • paste your blog link
  • Select layout of the button which suits you
  • click Get Code

  •  A window will popup displaying the script and the plugin code

  • Save these code
  • Go to your Blogs Layout tab
  • Click on "Add a Gadget" where you want the like button



  • A window will popup displaying all gadgets
  • Add HTML/JavaScript gadget by clicking the  Add  button

  • Next leave the Title Blank  
  • In the content box first paste the script which we copied earlier then paste the plugin code and save it

  • Click Save Arrangement option in the top right corner
Now view your blog and you will see that we are done with adding facebook like button . Cheers !!


For any doubt leave comment below