Thursday, November 17, 2022

Linux Tips and Tricks

 

Helpful Tips and Tricks for Linuxbies

Disclaimer : I came upon these tips and tricks on the Internet searching for solutions to the problems i came across over the course of almost three years of using Linux. Some of these have been copied from the Internet for my sole use. I compiled this document for my own convenience and I dont take responsibility for any harm done to your computer or settings by using any of the tricks below.. So, use at your own risk.

Add files to Totem playing list from Nautilus

just use nautilus-actions-config and use the following settings:

Label: Tooltip: Add to totem playlist

Icon: /usr/share/pixmaps/totem.xpm

Action: totem

Parameters: –enqueue %M

Appears if file matches filenames: *.mp3 ; *.ogg ; *.mpc ; *.aac ; *.wav ;

*.ac3 ; *.avi ; *.ogm ; *.mpg ; *.mpeg ; *.wmv ; *.rm ; *.ram ; *.vob ; *.asf

Appears if selection contains: only files

Appears for multiple: true

Package search from terminal(command line)

apt-cache search packagename

eg. If you want to serach for a package named similar to sysinfo then type 'apt-cache search sysinfo' into terminal.

Use Audacious Skins

Download some skins of Winamp, extract it and copy it to "/usr/share/audacious/skins/" (not "~/.audacious/Skins" which is popular on the Internet). Remember that you should use "sudo".

sudo nautilus /usr/share/audacious/skins/

Then I change it to the active skin in the "preference" of Audacious

Autostart in KDE

KDE for all its eye candy and general slickness really sucks on some basic points. One of these is with auto-starting programs upon login. Suggestions to get this working almost always involve having the use the command-line or following a prolonged series of steps for a task which should ideally involve no more than a few clicks. Usually, most people suggest the following as a solution even to newbies:

Open up Konqueror. Navigate to your home folder.

Click on View. Select Show Hidden Files.

Look for a folder named .kde and open it.

Look for a folder named Autostart and open it.

Right click inside Konqueror. Select Create New and Text File.

Give the text file the name of the program you would like to autostart.

Open the file using Kate or the text editor of your choice.

Type #!/bin/bash on the first line.

Type the command to launch your program along with any necessary switches.

Save the file.

Right click on the file, select Properties and the Permissions tab.

Finally, check the is executable box and click OK to complete the process.

Are you fucking kidding me? I know that user-friendly Linux is still something of an oxymoron. However, this is really pushing it. Convinced that there had to be a better solution, I decided to google some more and eventually found that the recommended procedure is actually the following:

Open up Konqueror. Navigate to your home folder.

Click on View. Select Show Hidden Files.

Look for a folder named .kde and open it.

Look for a folder named Autostart and open it.

Click on the K Menu icon and navigate to the program that you would like to auto-start.

Drag the icon for said program into the Konqueror window and select Copy Here when prompted.

And that's it! No text editors. No jargon. No code. If you bookmark the Autostart folder, then it becomes an even easier process very similar to that in Windoze. That said, the whole idea of placing the Autostart folder inside a hidden folder smacks of idiocy.

Switch between GDM and KDM

When you have Gnome and KDE both installed on the Ubuntu, you may need to switch between the window managers gdm and kdm. Here's how you do it from terminal.

sudo dpkg-reconfigure gdm or sudo dpkg-reconfigure kdm

Activate Hidden Icons in Ubuntu(Gnome)

Give Me My Trash Can!

The developers who designed Ubuntu’s desktop decided to keep the desktop largely clean of icons. This included relegating the Trash icon to its own applet at the bottom-right side of the screen. Many people find using the applet a little difficult and miss the desktop trash can icon, which has been present on Windows and Mac OS desktops for more than 20 years.

The good news is that it’s easy to get the trash can back. Click Applications -> Accessories -> Terminal, and at the command prompt type gconf-editor. In the program window that appears, click the down arrows next to Apps, then Nautilus (you’ll have to scroll down the list a little), and then click Desktop. On the right side of the program window, put a check in the trash_icon_visible entry. The Trash icon should then instantly appear on your desktop! To delete the old Trash icon at the bottom right, simply right-click it and select Remove from Panel.

You can also put a check in the computer_icon_visible, home_icon_visible, and documents_icon_visible entries if you wish to see Computer, Home, and Documents desktop icons. By putting a check alongside network_icon_visible, you can add a My Network Places–style icon to the desktop too.

Be careful when using the Configuration Editor program. It lets you configure just about every aspect of the GNOME desktop and doesn’t warn you when you’re about to do something devastating, so the potential for accidental damage is high.

Enqueue in Audacious in KDE

Open a mp3 file's properties->edit file type->select audacious->click edit->paste the following : -

audacious --enqueue "${FILE}"

EOL compatibility issue fixed

Introduction

Windows and Linux handle text files differently in terms of line breaks. Windows uses (invisible) \r \n characters (carriage return and newline) to represent where the line ends and a new line starts, however, Linux (and all Unices) use \n character for the same purpose. This is the point which makes Linux-created text files look garbled in Microsoft Windows.

There are of course several ways to convert Linux text files to Windows. Intermediate/advanced users may find using sed or awk a perfect tool to convert the files, but in this article I will go with easier solutions.

Kate

KDE's text editor, Kate, has built-in functions to save the text file in Windows format. To do this, open your text file in Kate, go to Tools → End of Line → Windows/DOS. Kate will automatically change all the line breaks and you will be able to save your file in a Windows-proof format.

If you are carrying text files between Linux and Windows computers frequently, then doing the above may not be your perfect solution. In this case, I recommend telling Kate to save the line breaks as Windows/DOS compliant for every file. Go to Settings → Configure Kate and on the left pane under the “Editor Component” part select “Open/Save” option. In the right pane, select “DOS/Windows” as the “End of Line” and un-tick the “Automatic end of line detection.” Click “Apply” and then “OK” to exit.

If you are using Gnome or any other window manager, you can use Kate without any problems.

Yes, everyone wants graphics, or better, the ability to customize things to suit different situations. I have always suggested programmers regarding interfaces and programs in genre to let the user be comfortable to set and change almost every aspect of program GUI, at least icons, fonts, backgrounds and often ii found some programs being too customizable, on the contrary.

Let's take a look at GRUB 2, also called grub-pc by updates that the Debian distro suggests. GRUB 2 is the successor of the GRUB bootloader, commonly shipped within the majority Linux distributions. Basically i will cover only some graphical aspects that GRUB 2 seems to be strong with: customization of fonts, background, console modes directly set by GRUB 2 itself, no more limitation to the resolution of 640x480 pixels at startup, can be used bigger background pictures also at the resolution of 1650x1050 pixels.

Our favorite kernel parameter vga=791 for example, is now deprecated (if using GRUB 2), and it's a little tricky to set correctly the console mode. The configuration file for GRUB 2 is now called grub.cfg in place of the old menu.lst whose we were addicted, but resides in the same directory /boot/grub. Things are very distribution specific i think, but remain the fact that configuration changes rely on the grub.cfg file that we have to alter in some way. Debian is putting the defaults into /etc/default/grub where you can find and set common used parameter easy to understand.

"For example i use Debian within VirtualBox at a resolution of 1280x800 for the console and also for the Xorg server. If you want you to start with this resolution also for GRUB 2 (remember in the past was very limited this feature, and if you are using VirtualBox or other virtualization programs the annoying result was in resizing the window and than enlarging upon the system goes into graphical mode, for example, with the splash screen: usplash, splashy and others), very nice, no more discrepancies between modes: the line to change into the /etc/default/grub file is GRUB_GFXMODE=1280x800 and then issuing update-grub. The resulting action is to write the line set gfxmode=1280x800 into the grub.cfg file."

We are half a way to our objective, to change also the resolution of our console. We need two conditions, the terminal must be set to insmod vbe line MUST be present in your configuration file (this ensure correct console mode settings, if you note this instruction is almost identical to load a kernel module) and the option gfxpayload=keep MUST be set. This will keep our 1280x800 resolution also for the console, YEAH! no more resizing on VirtualBox! and this is not the end. Someone reported that adding gfxpayload=my_resolution will be able to set a different resolution for the console instead of having the same of the GRUB 2 menu, sincerely i have not tested it. Why i have not tested it? The strong point is that to change grub.cfg requires a little more effort than editing it with a text editor, because all your changes will be discarded when you run the command update-grub.

/boot/grub/grub.cfg excerpt :

setgfxmode=1280x800
setgfxpayload=keep
insmod gfxterm
insmod vbe

update-grub reads the configuration stored in the /etc/default/grub file and the scripts that resides into the /etc/grub.d directory at least on Debian (i suppose is the same for other distributions). To set the option gfxpayload=keep i had to modify one of this file cause i discovered that this line MUST be the next after the gfxmode one, like you can note above.

You have to find the file or script responsible to change the content of your grub.cfg configuration file and append the appropriate line, after the gfxmode sentence, gfxpayload=keep to keep the same resolution of the GRUB 2 menu for the console (wider resolutions result in smaller console fonts). In my case i had to edit the script 00_header stored into the /etc/grub.d directory.

There are other scripts into this directory, responsible to set other parameters, like theme (background picture an font color), distribution and custom OS. To change the background image of your GRUB 2 menu is almost the same process, find the script or configuration file that change the attribute of the background_image instance of the grub.cfg, and change the line pointing to the image (usually a .png or .tga file) with the one you like, i have tested it with a resolution of 1650x1050 pixels modifying the script 05_debian_theme, in my case, stored into /etc/grub.d directory as well.

Install Moodbar for Amarok on Ubuntu

First,install the compiler by this command:

sudo apt-get install build-essential

And install the libraries and required programs

sudo apt-get install fftw3-dev libgstreamer0.10-dev gstreamer0.10-plugins-base gstreamer-tools gstreamer0.10-plugins-ugly gstreamer0.10-plugins-good

Download and extract moodbar :

wget http://pwsp.net/~qbob/moodbar-0.1.2.tar.gz

tar -xzvf moodbar-0.1.2.tar.gz

Now,go into the directory and compile:

cd moodbar-0.1.2

./configure --prefix=`pkg-config --variable=prefix gstreamer-0.10`

make

sudo make install

Launch Amarok and go to “Settings -> Configure Amarok” and from “General“, select “Use moods“. There are three different colour moods to choose from.

View personal and system fonts

As root, open nautilus/dolphin window and type "fonts:///" in the location bar.

Fix for Openoffice spellcheck problem

If spellcheck doesn't work out of the box, check the language set in the Font tab of your text style. Select English there and spellcheck will be activated.

Another way i found: Go to regional and language in system settings and choose the language US english/ UK english from there. It should be fine after that.

Rebuild Icon Cache(Ubuntu)

Sometimes the icons go bad like some broken icons or no icons at all. To fix all icons, type this in the terminal:

sudo gtk-update-icon-cache --force --ignore-theme-index /usr/share/icons/hicolor

Remove menu delay in Ubuntu(Gnome)

Type

echo "gtk-menu-popup-delay = 0" >> ~/.gtkrc-2.0

in a terminal

And it simply removes the little delay when navigating menus.

Force Resolution

Its been an issue with Kubuntu 10.04 that the resolution doesn't stick after rebooting system. The workaround for this is to set the resolution every time you login by adding this program entry into autostart.

xrandr --output VGA1 --mode 1280x1024 (where VGA1 is the name of your display, type xrandr in terminal to find out)

Kill Desktop Manager (Desktop Environment)

It may happen that sometimes a desktop manager like lxde or kde doesn't load properly and you're stuck somehwere in between login and full desktop loaded states. This command can be of real help there and then :

sudo kstop kdm or sudo kstop gdm

You need to type this in shell. Press Ctrl+Alt+F1 to go to shell. It will work even if login doesn't work. After the desktop manager is stopped, type startx and then press Ctrl+Alt+F7 to go back to the login screen where you can choose another desktop manager like Gnome and login like normal.

Restore Gnome Desktop

There is a way to reset your Desktop settings back to their defaults in Gnome.

If you don’t have access to your graphical (GUI) desktop to delete these folders in Nautilus or you’re stuck at the login screen, drop to a terminal by hitting CTRL + ALT + F1, login to your account, and run this command:

rm -rf .gnome .gnome2 .gconf .gconfd .metacity

Get back to your GUI desktop by hitting CTRL + ALT + F7.

Login and VOILĂ€! Just like the first time you ever logged into your Gnome desktop.

Fix Filesystem errors

Sometimes linux wont boot properly if the filesystem(ext3/ext4/etc.) has become corrupt.

For fixing filesystem errors use a linux live cd and type in the terminal

fsck /dev/sda1 (assuming sda1 has your linux partition)

Fix and Repair Partition Table linux and windows

 How to Repair Partition Table


Many of us love to play around with our boxes and customize it to our liking. I love to give my box the best possible look with the best software underlying it. But even in the finest environment and with utmost care, sometimes computers behave in ways we don't want them to. I love Linux and always keep on trying the newest distributions. One of the most common problems that one can face while playing with Linux distributions is a partition table error. Partition table is basically meta-data stored on the first sector of a hard-disk that contains information about the disks partitions such as type, capacity and whether its primary or logical, etc.

Partition table can be corrupted due to many reasons like a boot-sector virus, an unsuccessful operating-system installation and even by certain softwares. I've encountered the situation many times when an installation is incomplete or unsuccessful and I get a bad partition table. And I tell you a bad partition table can really cause you a lot of headache!


Possible Effects of a Bad Partition Table :


  1. Linux fails to detect any partitions.

  2. Linux fails to install properly. The installation goes up to where it'll say that installation is complete but when you reboot, you don't see any OS entry in the boot-loader.

  3. You are unable to boot the computer.

  4. You are unable to do certain operations with your partitions such as shrinking or resizing.


Here's how the problem starts:


Suppose you have Microsoft windows on your computer, and you're trying to install a new Linux say Ubuntu. But Ubuntu fails to install (I know....mostly Ubuntu doesn't fail, but its just an assumption) and it leaves your computer in a very undesired state where your partition table is corrupted, the windows boot-loader has been overwritten and the Ubuntu won't boot .

Now Ubuntu will not even reinstall because it can't detect the partitions on the hard-disk. When you boot up the live CD and run the installer, it says that for installation to take place, the partition table needs to be initialized, deleting all data on the hard-disk. Most of us won't like to do that unless we have a hard-disk backup image. So the last resort for you is to somehow repair the partition table!


Here's how to fix it:


1. Going back to where you started :


Reinstalling windows is one of the ways to fix it because Windows can read the disk partitions even when the partition table is corrupt(yes, somehow it does, provided your MBR is otherwise intact). But you don't want this as a possible makeover because it will wipe out your existing installation of Windows. Moreover, although Windows will install, you may not be able to install Linux over it until the partition-table is fixed. So you'll be back in the position where you started – installing Linux over Windows.


2. Partition Table Doctor comes to the Rescue :


Now that you've Windows installed, you can run many partition-table recovery softwares among which, PTD is the best. PTD can really fix partition tables. You need the full version to save any changes you do with PTD. Choose the option that says 'Rebuild Partition Table'(if I remember it correctly). It'll take only a few minutes to detect the existing partitions and only a few seconds to rebuild the partition-table.


3. GParted Comes to the Rescue


Sometimes fixing the partition table using PTD doesn't help(as was the case with me), in that case Gparted can be of great help. Gparted is a free software and it comes bundled with several Linux live CD's including Ubuntu. You can also run Gparted from a live CD. All you have to do with Gparted to fix the broken partition-table is to do some changes like edit or shrink a partition, create a new one out of existing space or so. Then save the changes to the disk. Reboot and now you shall be set free!


Happy Linuxing Guys.

Update..

Active@ Partition recovery is also an easy way to repair your partition table. You just need to download Active@ partition recovery and run the quick scan or super scan depending on how bad your partition's health is (which is depending on how many times you have overwritten data on the same sectors of the hard-disk), and choose the partition to repair. It takes just a few seconds to restore the partition information.

It will even tell you if any of your current partitions would be overwritten when restoring an old one! If such is the case with your PC, don't lose hope, you can still recover the contents of the partition by making a raw data image of the partition. It takes a while (a few hours actually) to write the partition image using this method but it restores all your data and doesn't even change your current partitioning setup.

Sunday, November 13, 2022

Magento - Brief Overview

 


We are in the age of Information Technology and e-commerce boom has taken place recently in India. Until the early 2000’s people in India were still buying stuff directly from stores, the primary reason being the unfamiliarity of online sellers. Now, with so many active online sellers in India, people are keen to spend their money into buying from online stores. There is proven transaction security and much ease in the overall process of purchasing. Apart from this, there are many other alluring reasons to shop online like there is wider choice, competitive prices, and delivery at your doorstep.

Most of all, online shopping is the ‘in’ thing these days. It’s considered modern and cool to shop from the convenience of your home.


Magento has played a big role in the e-commerce boom all over the world and India is no exception. Magento is an e-commerce web-application development platform, released in March 2008. Magento community version is free to use and customize. In just a few years, Magento has changed the scene of the e-commerce market very rapidly by bringing other ecommerce-platforms to its feet!

Figure1: Graph plotting Magento’s share in the e-commerce market today.
Figure1: Graph plotting Magento’s share in the e-commerce market today. | Source

Magento Features

Let us look at why Magento has grown so much in the market despite of other big names like OpenCart and osCommerce. We will look at the features Magento provides over other shopping carts and why it is so beneficial to build your e-commerce store with Magento.

Inbuilt Features:

  1. Catalog Management –
    1. Batch Import/Export of Products: Magento allows import and export of catalog from other stores. So if you had a store in, say for example, osCommerce and you want to switch to Magento for obvious reasons, you don’t need to worry about re-entering all the product information. You can directly port the products from osCommerce to Magento using the inbuilt CSV import.
    2. Digital Products Support – Apart from the regular tangible stuff, magento has provision for digital stuff like e-books and other downloadable items.
    3. Magento allows you to easily generate coupons/discounts/special prices without the knowledge of computer programming
    4. Catalog Browsing –
      1. Layered navigation for filtering of products in categories.
      2. Product Comparisons
      3. Product Reviews
      4. Checkout and Payment –
        1. One page checkout
        2. Guest checkout
        3. Multiple payment options supported with integrated Paypal and Paypal Express.
        4. Excellent Customer Service Features –
          1. Customer dashboard with features like previous orders, wishlist, reordering, order tracking etc.
          2. Guest order status
          3. International Support -
            1. Multiple languages are supported
            2. Multiple currencies are supported

Customizability

Many a times the above features are unable to cater to the very unique and complex seller needs. That’s where Magento’s custom modules/extensions come into the play. Magento is fully customizable but it is not that easy to customize. It is always better to go to an expert with your customization needs to build a custom and complete e-commerce solution for you.

Community support

As Magento is growing in popularity, the number of people in community is also growing. There are a lot happening simultaneously in the Magento Community online. A lot of questions are being asked in the forums, new features being requested, bugs being reported and fixed and hence new releases of Magento Community are releasing one after another.

It is the truly the era of Magento e-commerce and both an online seller or someone aspiring to become one can take the benefit. Here are some of the businesses who have used and benefited from the Magento Platform:

Figure2: Some businesses who use Magento

Thursday, December 29, 2016

Nuclear Supremacy Tug-of-war, Destructive Tendencies of Countries & other Problems of the World



Problems :
  1. Countries are concerned more about nuclear capabilities and missile ranges than eradicating poverty and bringing happiness to the lives of the common man.
  2. Articles are being published that so and so country is this much capable to bring a holocaust to so and so countries. Such news breeds negativity and rivalry among countries, who ideally should be working together towards betterment and to resolve conflicts. War is not a solution, not now! We all know a third war will bring humanity down to its knees and may cause imbalance in nature to the extent of an irreversible state.
  3. Countries flaunting military supremacy. This will not be needed when all the countries in the world are friendly. There are better things to focus on like renewable energy sources, health services, science and technological advances, humanitarian causes, better law and order than to flourish war-like conditions.
  4. Defense is not there for just defense anymore, power-hungry countries are using armies as a mean of proving their superiority and power over regions/countries through irrational means such as taking the help of terrorist organisations.
  5. Power-hungry and ill-motivated leaders.
  6. No resolve in decade-old grudges and conflicts among countries.
  7. Increasing craziness, demotivation and inability to fix the chaos leads to a loss in the sense of well-being of the common man. We tend to think of this chaos as the new normal.
Bringing order to the world :

  1. People should really start believing in the you win-I win reality. This is much easily said than done. However, what people believe is really the cause of all human decisions. The decision to believe in the win-win policy alone can have an astounding effect on humanity. So making this happen could change the world forever, and for good. 
  2. Countries should focus more on humanitarian causes and policies. This involves making sure that Nobody should face adversities because of a bad system or policy that people have chosen to follow. 
  3. World authorities should work to bring order to the world as a whole by resolving differences and conflicts among people and by making humanity the prime responsibility and a prime law for all.










Friday, September 25, 2015

Hassle in even disconnecting an already poor service - MTNL broadband - My story


A lot of MTNL users have stopped using MTNL in the last few years, as their service is becoming poorer by the day. I thought otherwise earlier, because luckily, for me, MTNL connection was working without a glitch for the last 6-7 years.

But recently, I had to experience the overall poor service of MTNL Delhi (Mahanagar Telephone Nigam Limited) when I moved to a new house. I'll tell you what made me decide disconnecting a 6-year old MTNL broadband connection.

MTNL's service has been very good at my older place(a different pin code but same exchange). A solid line with good speeds for unlimited connections at a fair price. I was a happy customer once.

Initially, I had some difficulties in getting them to shift the connection to the new home. The MTNL guys who came to install the connection at my new place were not able to make it working at all. As soon as I got past those problems and my Internet started working, I had new problems. Broadband will only work sometimes and with lesser speed than what I was paying for. I kept calling MTNL technical support and customer care again and again but every time I lodged a complaint, the very next day I could see, on their on-line complaint tracking tool, that it has been resolved. Although it would not. I even called the Area manager, but how can the area manager solve the problem when he keeps sending the same guys over and over again to solve the same problem which they were not able to fix firstly.

This continued for a month.

As broadband is a daily need, eventually I got fed up, had to give up my MTNL connection, land-line along-with.

It was not an easy affair to get the connection disconnected either. Firstly there is no option to do this on-line, which should have been the easiest for the customer and the ISP, both. You still need to fill-up a regular paper form and get it signed with various departments of MTNL, just to, should I say, get rid of the MTNL services! They even ask for a ID proof for the disconnection of MTNL services. Why need an ID proof when I am an already verified customer using MTNL services for so long?

For people who are fed up of MTNL's poor service and decide to disconnect -
Please make sure when you mark a reason for disconnection, simply choose shifting/moving to another city, for your own ease. In case you select 'Not satisfied from services' on the form, they will not submit the request for disconnection unless you get it signed from yet another department/section.

So what I understood from my experience with MTNL is that either they have good infrastructure laid out at some places and not at others. Or, specifically for our new area, the guys are not trained properly to troubleshoot/fix problems and the higher officials just do not care.

Later, I got myself installed the local cablewala's Hathway broadband.

Thursday, November 20, 2014

Bodh - The cognition of knowledge


 


The ability to differentiate between right and wrong is a human being's biggest ability. It gives man the ability to imagine,search, and reach anything. 

Small bits make bigger parts and parts combined make the whole. Man can  start doing things in small bits and pieces and expect a bigger and worthier end provided he is doing the righteous. Meaning righteous behavior can lead man to the good things in life and progress him to a way to find his purpose and the truth about life.

Right mindset is needed to understand anything. And that is why right  mindset is needed to achieve anything.

Different people think differently and that is why they perceive  differently. Perception affects understanding. Demented understanding of  things already known to the mind may be the basic hurdle for it to  understand something else just as some readers may think this article is crap and  some may find it enlightening.


Mind always tends to think: "what is the immediate gain for me"? and that  corrupts the mind. Believe me, thinker's mind is corrupted right at that very moment. One should set a higher goal for himself than just material success and that is possible with noble thinking.


Some say that there is no light in the world and it is all dark. The truth is imminent but can be seen with open eyes and open mind only, it is not for the blindfolded but for the wise.

Monday, May 07, 2012

Serious people, seriously missing

People aren't serious at all. They don't take life seriously. People think of freewill as a joke and make wrong use of it. It is not appreciable at all. They do evil deeds just because they can and when they are free to do so. They do not have any respect for life but they only fear someone who may hurt their ego or harm them. If nobody is there  to forcefully stop them of doing what they foolishly and knowingly do, they would keep doing so.

Linux Tips and Tricks

  Helpful Tips and Tricks for Linuxbies Disclaimer :  I came upon these tips and tricks on the Internet searching for solutions to the probl...