Showing posts with label how to. Show all posts
Showing posts with label how to. Show all posts

Monday, November 12, 2018

How to fix "Use gi.require_version('Gtk', '3.0') before import" error

Error:

gi.require_version error









Solution:

Replace the line
"from gi.repository import Gtk"

with

"import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk "

Monday, June 29, 2015

How to dist-upgrade BOSS GNU/Linux?

I am user of BOSS GNU/Linux version 5.0(code name: anokha) since a few years and i am content with it.  It's been about a year that the next version 6.0 (code name: anoop) is out there for public usage, I am bit afraid to upgrade my machine.  There are two reasons for my hesitation,

1.  I am completely adapted(/addicted) to BOSS 5.0, and pretty much comfortable with it.  I don't want to lose my comfortableness.

2.  I afraid to dist-upgrade, which many a time leads to -> at minimum inconsistency & at maximum machine crash.

So, what made me to upgrade my linux box?
It's been about 2 years since my last bug-fix to LibreOffice office suite.  And that FOSS contribution itch starts now again.  So, I decide to download & compile the source code LibreOffice in my Linux box.  But, Unfortunately when I to do so I end up with the error

"libo/sal/qa/rtl/strings/test_oustring_stringliterals.cxx: In member function ‘void test::oustring::StringLiterals::checkOUStringLiteral1()"
libo/sal/qa/rtl/strings/test_oustring_stringliterals.cxx:195:48: internal compiler error: Segmentation fault

As the reason pointed out by the LibreOffice developers, I have to use gcc-4.8 or higher version to compile the LibreOffice source.  But, It's not available with BOSS 5.0 (which derived from Debian release wheezy) and the same is with debian also (even backports also don't have gcc-4.8).  This leads to only one solution i.e upgrading the machine.
BOSS GNU/Linux Logo

Now, The steps to dist-upgrade your BOSS GNU/Linux machine.
(Note: 
* First backup all your (important)data, configuration files before proceeding the upgrade your machine.
* Ensure you have active internet connection throughout the following process.
* The process data consuming, it needs about 2.0 GB of data transfer) 

Steps to do in current version with the current repository (in our case BOSS 5.0 anokha)
1.  update the machine
     $sudo apt-get update 
2.  upgrade the machine
     $sudo apt-get upgrade
3.  dist-upgrade the machine
     $sudo apt-get dist-upgrade
     The steps 2 & 3 must be finished successfully without any errors.  If you end-up with errors first fix it, without you can't proceed.  And importantly
check each time what are the packages going to be removed.  If you find anything important shown as going to be removed, be ensure twice with double cautions is it ok to you and then proceed.

Steps to do in current version with the target repository (in our case BOSS 6.0 anoop)
1.  Modify the "/etc/apt/sources.list" to point to the new version's repository.  For our case open & edit the file "/etc/apt/sources.list" file as follows.

$sudo gedit /etc/apt/sources.list

existing:
deb http://packages.bosslinux.in/boss anokha main contrib non-free
deb-src http://packages.bosslinux.in/boss anokha main contrib non-free


After modification:
deb http://packages.bosslinux.in/boss anoop main contrib non-free
deb-src http://packages.bosslinux.in/boss anoop main contrib non-free


save and exit.

2. update the machine
   $sudo apt-get update

3. Upgrade the machine
   $sudo apt-get upgrade

4.  Upgrade the machine
   $sudo apt-get dist-upgrade

  In the 3 & 4 th steps be in & around your machine, as the new versions of the packages installed it will prompt for configuration file changes.  For example let's take "postgresql" configuration file.  You may be modified it for your previous needs.  As the newer version going to be installed you will be prompted with options to keep older configuration file, replace with new etc., give your option accordingly (default & recommended is keeping your old configuration file).  Once you crossed all the said steps successfully, machine will prompt for "reboot", after which you could be landed into newer version of BOSS GNU/Linux.

How to check the upgraded version?
$hostnamectl
output will be something like

    Static hostname: boss
              Icon name: computer-desktop
                  Chassis: desktop
            Machine ID: 62c6fd7923f0953d60
                  Boot ID: 5449ccd6794947cc8309fdff20546b0b
Operating System: BOSS GNU/Linux 6 (anoop)
                   Kernel: Linux 3.2.0-4-686-pae

Kernel Upgrade:
From the above output we are sure that the machine is i686 arch so we have to install the newer kernel of same architecture.  So, we will find the newer/latest linux kernel available in our repository and install.  First let us check the available linux kernels using
$apt-cache search linux-image  - outputs something like follows
linux-image-3.16.0-4-586 - Linux 3.16 for older PCs
linux-image-3.16.0-4-686-pae - Linux 3.16 for modern PCs
linux-image-3.16.0-4-686-pae-dbg - Debugging symbols for Linux  \ 3.16.0-4-686-pae
linux-image-3.16.0-4-amd64 - Linux 3.16 for 64-bit PCs
linux-image-486 - Linux for older PCs (dummy package)
linux-image-586 - Linux for older PCs (meta-package)
linux-image-686-pae - Linux for modern PCs (meta-package)
linux-image-686-pae-dbg - Debugging symbols for Linux 686-pae configuration (meta-package)
linux-image-amd64 - Linux for 64-bit PCs (meta-package)
linux-image-3.2.0-4-686-pae - Linux 3.2 for modern PCs
linux-headers-3.2.0-4-686-pae - Header files for Linux 3.2.0-4-686-pae

The existing kernle is linux-3.2 and we have linux-3.16 in our repository for i686 architecture.  So, we could proceed with installation of new kernel
$sudo apt-get install linux-image-3.16.0-4-686-pae

Now, your machine will prompt you for rebooting.  Before rebooting you may consider purging removed packages(optional but recommended).


Purging removed packages:
Purge = (In Linux) Complete removal of a package including configuration files.  Many a time a package removed but its configuration files may stay with the machine.  To remove those unnecessary configuration files we purging.

$ dpkg -l | awk '/^rc/ { print $2 }'  - Lists all the removed packages
$sudo apt-get purge $(dpkg -l | awk '/^rc/ { print $2 }') - purge the removed packages.


 

Wednesday, June 25, 2014

How to install Samsung SCX-4521-NS multifunction printer in Linux?


Steps to install drivers for SAMSUNG SCX-4521-NS multifunction printer

1. Download the driver file for linux from the following url

2. extract the downloaded file then open Applications → Terminal
Assume that the downloaded file is in the directory ~/Downloads

3. Issue the following commands as in the same order
$cd ~/Downloads/uld
$./ install.sh

give proper values (mostly yes/no options) whenever prompted

4. Once the driver got installed, connect your printer with the PC/Laptop then do the following steps

5. Go to Applications → System tools → Administration → Printing this will open printer configuration wizard.  (Am Using a debian derived distro named BOSS GNU/Linux, in your destro the "Printing" may be available under different menu item, with different name)

6. Click on Add button, give password whenever prompted. The connected printer will be automatically detected and then click on Forward button. Now a new popup window will open select the option “provide ppd file

7. Now browse to the location of ppd file (which is /usr/share​/ppd/uld-samsung)

8. Now select the ppd file with the exact name as “Samsung_SCX-4650_4x21S_Series.ppd
then proceed.

9. Now, test your configuration with “print test page

Tuesday, February 25, 2014

How to solve "Package gtk+-3.0 was not found" & "fatal error: gtk/gtk.h: No such file or directory" errors in Linux

As of now some of the Linux distros don't come up with the gtk-3.0 libraries and development files by default.   Though Gnome application developers are asked to migrate to gtk3, most of the desktop applications are still in gtk2.  Due to these reasons gtk3 development files are not pre bundled with distros.  So, we have to install gtk3 development files, libraries manually to compile a gtk+-3.0 based GUI applications.

If your gtk3 program compilation ($gcc -o executable_name  program_name  `pkg-config --cflags --libs gtk+-3.0`) throws error something like this

Package gtk+-3.0 was not found
            (or)
fatal error: gtk/gtk.h: No such file or directory

which means your machine is not installed with the gtk3 development files.  
To install the package in debian based machines 

$sudo apt-get install libgtk-3-dev

To install in rpm based machines

$yum install gtk3-devel

After the successful installation your machine should return output something like following while you execute the command 
"sudo pkg-config --cflags --libs gtk+-3.0"

"-pthread -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12  -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 
"

Now, you can compile your gtk3 programs happily... :)

Thursday, February 20, 2014

How to view all feeds/articles (both read & unread) + How to change read status of a feed in feedly

How to view all feeds/articles (both read & unread) feedly

Since the closing announcement of google reader service from google, I have been engaged with feedly as my feed reader.  Though there are many other rss/atom feed readers available in the web & in the app store, I do like feedly a lot.  The main reason why I am using feedly as my rss aggregator is

1. I can import all my google reader subscriptions into feedly via OPML file seamlessly. (Ofcourse you must have downloaded the OPML file before the closing ceremony of google reader.)
2. feedly's simple yet intuitive design
3. Can be linked with your gmail account.
4. Can be configured in many devices & can sync
5. Can export the subscriptions into OPML file.


So, When I configured my feedly account  & added new subscriptions It shows only a few latest feeds of a website as unread and all others as read.  By default feedly shows only the unread article.  So, If I want How I can see all the feeds from a particular subscription?  There are 2 ways.

In Broser/web based login, Once you logged in you can see all your subscriptions. 

1. When you click on a particular subscription in the right top of your screen you can see a gear wheel/ tooth wheel kind of symbol.  Click on that and uncheck the option "unread only" under the category named filters.





2. In the Left bottom of you feedly home page one can find a link to "preferences".  Click on that and go to "Hide read posts" and select option "No".


If you have further queries refer feedly's FAQ page & feedly's Knowledge base.

How to change read status of a feed in feedly
feedly has lot of shrotcuts to manage the feeds and subscriptions. If you want to know about all the shortcuts, Once you logged in into your feedly reader in web browser press "?" which lists all the available shortcuts..

If you want to change the read/unread status of an feed/article click on that article and press "m" which toggles the status.

To go to next feed/article press "n" or "j"

To go to previous feed/article press "p" or "k"

Tuesday, August 20, 2013

Multimedia keys not working with VLC media player, How to map/bind these keys with VLC in BOSS GNU/Linux (a debian based distro)?

Nowadays many of keyboards comes with multimedia keys like play/pause, next & previous button, volume
up, down etc...  Almost all the linux media players like totem movie player, banshee so and so are fully compatible with these multimedia keys.  But, sadly most of us's favorite player VLC not supports :(.

There are two ways to make your vlc player to respond to your multimedia keys.

Method 1:
In linux, there are two sets of hotkeys (aka shortcuts)
      i)  Application specific hotkeys - Applicable/work only with the specific application
      ii)  Global hotkeys - Common to bunch of  applications say multimedia applications, internet application.
Steps:

 a) First remove the multimedia keys from global settings.

 

 Applications
           \-> System tools
                       \-> Preference
                                  \-> system settings  ------>>
         

-> keyboard
         \-> shortcuts tab
                   \-> Sound and Media
                        |
           <<---------
Now click on the multimedia keys like Play/Pause, Next, Previous then back space to disable these global hot keys.
   





   b)  Second set these multimedia hot keys in VLC media player hot key preference.

        VLC -> Tools -> Preferences ->
                                               \-> hot keys ---->

Now double click on the Play/Pause, Next, Previous global part and the it will prompt for the hot key to that action.  press the corresponding multimedia key to set.

Now restart the vlc, thats all your multimedia keys will start work with VLC media player.


Note:  As we removed the multimedia hotkeys from the global keyboard settings, after this the same keys only work with VLC but not with other multimedia applications like banshee, totem etc.

Method 2:

Install the packages named hotkeys from your repository and restart the linux box.
     $sudo apt-get install hotkeys
     $sudo init 6


Note: I am using BOSS GNU/Linux which is a debian based destro specially made for Indian Environment.  The steps specified in the first method is specific to BOSS GNU/Linux.  The keyboard setting of your distribution might be some where else.

Wednesday, March 13, 2013

How to insert a table in your blogpost without much work?

Almost all of the bloggers(blogspot users, I don't know about wordpress features) face this while they writing some blog posts.  Many time we like to include a table in the blogpost, Due to the extra coding work (we need to write table creating html code manually) we don't do it.  Table is a very simple feature to add, but i don't know why google didn't added this to the blogger... :(.  Hope they will soon make us one.

  So, lets come to the point.  It is pretty much easy to insert a table with contents.  There is a web(site) [Tableizer]url which gives u this table creation as a service.  And the things is you are allowed to modify the table's view like colour, font, font size etc.

How to:
1.  Use your office suite's spread sheet application (ms excel, libreoffice calc etc).  Yes, am not kidding just input the  contents then copy that.

2. Goto this Tableizer url and paste it at the given box.  Click -> Tableize it.  Thats all.

3.  Copy the shown visual table(or the html code) and paste it into your post.

For example I want to create a 3x3 table with input 1..9 like this.

1 2 3
4 5 6
7 8 9

Open libreoffice -> calc -> input 1,2,3 in first row, 4,5,6 in second row, 7,8,9 in third row.  Copy that 3x3 cells with the content, now follow steps 2 & 3.  The resultant table is shown below.

123
456
789

you are done... :)


How to type copyright symbol, trademark symbol etc in linux?

 As our qwerty keyboard can't accommodate all the available characters, symbols we end up with the keyboard(layout) that have the main and most widely used symbols, characters(with shift, alt key combinations).  But, in my opinion our keyboard should at least add symbols like Copyright  ©, Registered  ®, Trademark symbol ™.

Usually we do get/input these symbols from:
1. From a text editor program or from office suite(from insert symbols) like libreoffice, MS office etc.
2. From internet web pages by searching terms like "copyright symbol", "Trade mark symbol"

But, it is not possible to go every time into those application or to search with google to get/input these symbols.  So, Here is a easy way to input these symbols with your standard English keyboard layout (qwerty layout).  You have to enable some already available keyboard settings(Compose key) but not enabled by default .

So, with the help of compose key we can achieve this in our standard key board itself.

Compose key: A excerpt from wikipedia
"A compose key, available on some computer keyboards, is a special kind of modifier key designated to signal the software to interpret the following (usually two) keystrokes as a combination in order to produce a character not found directly on the keyboard. For example, striking Compose followed by ~ and then n can produce character ñ, whereas striking Compose followed by O and then C can produce the symbol ©, the copyright symbol). "

How to enable
1. In  BOSS linux(or any linux which have menu like Applications, System)
System -> preferences -> keyboard settings -> Layout settings -> options -> Compose key positions
In Ubuntu
Settings -> Keyboard -> Layout settings -> Options -> Compose key positions

2. Select your desired compose key.
   You can select any listed key(ctrl, win, capslock etc) as your compose key.  But, as we are using Linux, It is recommended to use the win(dows) key as compose key.

3.  Save the settings thats all you are done.

There are many symbols and the key combinations to produce it.  I here list few most often used symbols and its compose key combinations.  I assume win(dows) key  as the compose key.

Symbol NameSymbolcomposekey combination
Copyright©win+o then c
Trademarkwin+t then m
Registered symbol®win+o then r
Quarter¼Win+1 then 4
Half½Win+1 then 2
3 quarters¾Win+3 then 4
Eurowin+e then =
Yen¥win+y then =
Pound£win+l then -
cent¢win+c then |
degree°win+o then o


Note:  This is for the debian based linux machines(like Ubuntu, BOSS Linux etc) which employs gnome desktop environment.  If your machine is not a debian based one or it uses other desktop environment systems(like kde, xfce etc), you have to fine where the keyboard setting is available and need to enable the settings as above.