How to format USB using YaST partitioner on openSUSE so that we can use the same on both windows and Linux?
This is a short screencast / video on a cool and easy way to format or partition a USB / pendrive drive using YaST partitioner on openSUSE 12.2, GNOME 3.4.2. I have used a Kingston, DataTraveler 108 of size 8GB in the screencast. If the USB drive is partitioned in the way specified in this video then it can be used both on Windows and Linux machines. I was able to successfully use the partitioned USB on openSUSE 12.2 and a windows 7 machine.
In order to automate and queue downloads from file sharing sites like 4shared, filejungle, depositfiles, mediafire etc.. and video sharing sites like youtube, dailymotion, vimeo etc., we can use a Java based downloader called FreeRapid on GNOME 3.4.2, openSUSE 12.2.
Step1:-
We need to Install Sun JRE(Java Runtime Environment) for GNOME 3.4.2, openSUSE 12.2 . You can refer to this page to install the same.
Step 2:-
Download the latest "All platforms" version of FreeRapid from this page.
Step3:-
Extract the downloaded file using your favourite archive manager or just right click on the zip file to open Nautilus context menu and use the menu / option "Extract Here" to extract the contents.
Step4:-
Open Alacarte (GNOME 3.X menu editor) and add the relevant menu item as shown below. Ensure that you are adding the full path to "frd.sh" in "Command" textbox.
open alacarte through command launcher
Add FreeRapid to Activities menu using Alacarte
Step5:-
After adding FreeRapid to Activities, we can locate it by launching Activities (Alt+F1 or Left Win key) and then typing in search query as "freerapid" in "Activities" window.
Step 6:-
If you open any youtube video or open a file sharing site and copy the url in your browser then it prompts you to download the relevant file or video as FreeRapid can monitor your clipboard. Clipboard monitoring can be toggled on and off using F7 key.
Recently I noticed that some GTK based applications in GNOME 3.4.2, openSUSE 12.2 were misbehaving or throwing a tantrum and are refusing to start or crashing when they start. The applications which had these issues were:-
Tomboy
Browsers (SeaMonkey and Firefox)
Gnome Terminal but not xterm.
The issue occurrence was random and the only pattern i noticed was that when issue showed up in one application others would also have these weird issues. The only way to rectify these issues was to restart the machine when these anomalies disappeared. Firefox and SeaMonkey gave an error in pop up when starting up "Configuration server couldn't be contacted: D-BUS error: The GConf daemon is currently shutting down."
Screenshot of error in Firefox
I found a solution / workaround for these issues in Fedora forums . All i had to do is "kill" the GConf daemon which is the root cause of the issue. It seems that the daemon would automatically start up whenever any application which needs it is started, hence there is no need to manually start this daemon again. I opened "System Monitor" through application launcher (Alt+F2) using the command "gnome-system-monitor".
Then i opened "Processes" tab and right clicked on GConf daemon and killed it.
After doing that all applications mentioned above worked fine. I also noticed that I could kill the daemon from application launcher (Alt+F2) too using the command "killall gconfd-2"
Nautilus is the default file manager on GNOME desktop. Nautilus-Actions is an extension for Nautilus file manager which allows one to launch arbitrary applications on files. "Actions" brings in the coolness that is missing in Nautilus. Simply put, it allows you to automate some of the daily activities on your desktop like:-
Changing Ownership of files.
Converting images from png to jpg.
Creating desktop shorcuts.
Enqueue audio, video files into media players.
Invoking "Fortune".
Open file as Admin mode.
On demand Virus scanning of files.
Running a Jar. etc...
All of the above list of activities can be implemented without referring any bulky manual. Using Nautilus-Actions, we can pack lot of custom functions into the right click (or) context menu.
Install Nautilus Actions on openSUSE 12.2, GNOME 3.4.2
Step1:-
First we need to configure community repos in YaST. The procedure would be similar to what is described here.
Step 2:-
After configuring YaST we can install Nautilus-Actions using either YaST or Zypper.
Installation using Zypper
sudo zypper in nautilus-actions
Notes:-sudo switches permissions to super user; zypper is the package manager in openSUSE; in instructs zypper to install packages
Installation using YaST
It is pretty easy to install packages using YaST. All one needs to do is open YaST installer and locate relevant packages (nautilus-actions) and install them. Here is a video (YaST Installer Video Demo) demonstrating installation of packages using YaST.
Launch Nautilus-Actions Configuration Tool
After installation you can easily locate Nautilus-Actions in GNOME Shell Activities(Alt+F1)by searching for "Actions" as shown below.
Alternatively you can launch it using the command "nautilus-actions-config-tool" from Quick launcher (or) Command launcher (Alt+F2).
Using Nautilus-Actions Configuration Tool
Using the configuration tool is very easy. You can easily figure out various things by reading various Tooltips that are available in the tool. For example, one can find the functionality of each tab by hovering the mouse on top of them as shown below.
Creating "Change File Owner" Menu
Let us start off by creating a simple menu that allows us to create a context menu to change ownership of selected files to that of logged-in user. We use the "chown" command to accomplish this.Click on the create "New Action" icon or press "Ctrl+N" to create a menu item. Then you can provide an appropriate name for the menu entry.
Then we open the "Command" tab and configure the relevant commands to change the ownership of selected files. In "Path" textbox you can provide the path to the executable or you can just type in the command alone. In the "Parameters" textbox you can type in the parameters like "user" to whom the file should belong to and %F which represents coma separated list of file names. By clicking the "Legend" button you can get the various parameter options that are available for use.
If you would like to see output of command in an alert box, then you can configure the same in "Execution" tab and by selecting "Display output" option.
Checking whether "Change Owner" works
I have created a sample text file and made "root" user as it's owner. Now we see a "X" icon on the file indicating that the file is not "owned" by the logged-in user. We now use our newly created context menu and check whether we can change the owner of the file.
After supplying root password we find the command execution in an alert.
When we right click on file now and check the file properties, we find that the logged in user or "mantis" is the owner of the file. The context menu works :-)
On Demand Virus Scanning
ClamTk(Anti-Virus Scanner) can be installed using "1 Click Install" links from this page. After installing clam you can create a custom "Clam Scan menu" to scan selected files.
Image Conversion using right Click Menu
Images can be converted from one format to another using a command line tool called "ImageMagick". It can be installed using "1 Click Install" links from here. After installation we can create a custom menu to convert images from one format to another. Assuming that we need to convert "png" files to "jpg" file, we need to implement the command "mogrify -format jpg <source>.png". It can be done as shown below.
To ensure that the image conversion context menu appears only on "png" files and not on any other file format like "jpg" we need to add "MimeType" data in Nautilus-Actions. To do this, we right click and find Mimetype data in properties of files for which the conversion menu should appear as shown below.
Then we add the MimeType in the relevant tab as shown below
Convert Png To Jpeg menu appears only in "png" type files.
Convert Png To Jpeg doesn't appear on "jpeg" type files.
Enqueue Music Files in Banshee
Banshee is a media player which has cool music library management capabilities. It can be installed using "1 Click Install" links from this page. After installing banshee we should find the proper command line command for enqueuing media files to it. The command need to do this happens to be "banshee --play-enqueued %F". We need to use this information to create the custom nautilus action as shown below.
To Ensure that the Enqueue context menu appears only on mp3 files we need to use the same technique as described above to add relevant MimeTypes in Nautilus-Actions.
Read Fortune in Pop up
To have some fun, you can try setting up "fortune" in context menu and read it. To do this we can use "zenity" library which can provide alert windows for bash scripts. The command that can be used is " /bin/sh -c 'fortune|zenity --text-info' ". This command can be entered as follows and a custom right click menu can be created as shown below.
The fortune output will be shown in zenity like this
Run Jars using Right Click
The command to run jars is "java -jar <jarname>.jar". You can can configure this command and run jars using Nautilus-Actions as shown below.
Open folder as Super User
You can open any folder in Super User or Root User by creating a context menu as shown below.
Create Desktop Shortcuts
In Linux, in order to create desktop shortcut or "link" you can use the command "ln -s /<path-to-file>/<filename> ~/Desktop". The same command be incorporated into Nautilus context menu as shown below.
This is a Systemd version of earlier article How To Restart Network service in openSUSE, GNOME. The below methods have been tested and they work on openSUSE 12.2, GNOME 3.4.2. Systemd is the replacement for SysVinit based service management system.
Restart from terminal
Open command launcher (Alt+F2) and through it open terminal (gnome-terminal) and then run the below command to restart network service.
sudo systemctl restart network.service
Restart from command launcher
Open command launcher (Alt+F2) and through it open terminal ( gnome-terminal ) and then run the below command to restart network service.
gnomesu systemctl restart network.service
Note:- sudo elevates permission to super user level in a terminal whereas in GUI mode we need to use gnomesu
For more information you can run Man command for systemctl (xdg-open man:systemctl) from command launcher (Alt+F2). To know more about Man command usage you may read through Demystifying Man
It is very easy to configure and use scanner on openSUSE 12.2, GNOME 3.4.2 thanks to YaST.
Connect the scanner
I own a HP scanjet 2300c flatbed Scanner. I connect the scanner to the power adapter. Then i use the USB connector cable to connect the scanner and the computer. I ensure that the light in scanner bed is glowing.
Configure the scanner in YaST
I proceed to open GNOME Activities using left "Win" key or by pressing "Alt+F1". Then type in the search query as "YaST" and YaST should appear grouped under "Applications". On opening YaST we will be prompted to enter administrative password which we must provide.
In YaST we need to locate scanner settings by searching for scanner applet.
In the scanner configuration window it is recommended that we click on the edit button and reconfigure the scanner even though you may see a default scan driver showing up in the menu.
In the setup wizard we can type in the scanner model and search for the relevant scanner driver and apply the settings using the "Next" button at the bottom of the window. The YaST wizard will save the settings and you can exit the Scanner Configurator by pressing the "OK" button.
Scan Documents
In order to start scanning i go back to GNOME activities by pressing left "Win" key or by pressing "Alt+F1". Then i type in the search query "Simple Scan" and Scanner application will show up grouped under applications.
I am using my old stamp collection as test subject and I placed the stamp album page facing the light / glass on the scanner. Then I click on "Single Page" sub menu under "Scan" menu and viola the scanner could scan the pages. Thank you openSUSE :-)
With default installation of openSUSE 12.2 , GNOME 3.4 it is difficult to ascertain as to which application is consuming how much of your internet bandwidth. We need to install an application / package called "nethogs" to check bandwidth consumed by each application. It is essentially a Network Bandwidth Usage Monitor.
NetHogs is a small command line based 'net top' tool. It groups bandwidth by process. This tool makes it easy to identify programs that have gone wild and are suddenly taking up your bandwidth.
Install NetHogs
Method 1 (1Click)
Navigate to this openSUSE AppStore page and click on relevant 1 Click Install link to install the tool.
Method 2 (YaST)
Using YaST you can add the appropriate repos and install the relevant packages. For more details about YaST usage, check out the links provided below.
Repo for openSUSE 12.1 http://download.opensuse.org/repositories/network:/utilities/openSUSE_12.1/ Repo for openSUSE 12.2 http://download.opensuse.org/repositories/network:/utilities/openSUSE_12.2/
open command launcher(Alt+F2), open GNOME terminal (gnome-terminal) and then using zypper you can add the relevant repos and then install "nethogs" package.
Repo for openSUSE 12.1 http://download.opensuse.org/repositories/network:/utilities/openSUSE_12.1/network:utilities.repo Repo for openSUSE 12.2 http://download.opensuse.org/repositories/network:/utilities/openSUSE_12.2/network:utilities.repo
Add repo sudo zypper ar -f http://download.opensuse.org/repositories/network:/utilities/openSUSE_12.2/network:utilities.repo
Install nethogs sudo zypper in nethogs
Notes:-sudo is used to switch to super user mode; zypper is package manager; ar option adds repo; -f option sets the repository flag as auto refreshed; in option is for installation.
NetHogs Usage
open command launcher(Alt+F2), open GNOME terminal (gnome-terminal) and then launch nethogs as shown below. NetHogs will clearly show you which program is using up your bandwidth.
I have been creating a some screencasts and posting the same on my blog recently. The list of videos have been linked in a separate videos tab. But whenever I uploaded the video onto youtube, it would complain that it is not able to detect any audio stream on my videos. That triggered an interest in experimenting with adding a sound track to one of my videos. I started searching on the net and tried to get some audio clips filed under "Creative commons" license. I found a webpage (Legal Music For Videos) which lists many sites which showcase good audio content. I narrowed down the choice of tracks to two of them and finally choose the first one.
Now comes the hard part of muxing / mixing of the audio track onto videos. Two potential candidate emerged that can easily mix audio streams onto video files. Both are command line tools (mencoder , ffmpeg). I saw sample code for both of them here. I also found that in order to use mencoder(based on mplayer), i had to un-install mplayer2-as-mplayer as it conflicts with mplayer backend :-(. I did not want to do this and opted for ffmpeg instead.
The command to mix the audio into video is pretty basic
I choose one of my recent videos and tried to add the sound track. I substituted the file names as appropriate and got the below command and it did produce a output file. But when i played the output video i found that audio kept playing even after the video had ended. I realised that this was due to the audio track length being greater than that of video.
After making a few more search I found this page which talked about using the "shorten" option. I opened "man" for ffmpeg in GNOME "help browser" using command launcher (Alt+F2) and command "xdg-open man:ffmpeg".Demystifying Man explains various ways of using man command. I found that "shortest" option should be used in a manner as shown below and came up with revised code to convert the video.
-shortest (output) - Finish encoding when the shortest input stream ends.
Demo video where i have mixed audio stream and video Stream of different playlengths. Since the audio is lifted from a Gramophone record it is course at some places.
Yesterday I saw a comment in one of my articles about "Adding a new application to Universal Access Settings". Brief transcript of the conversation is as below :-
@Yogesh-I want to add my own new customize setting in this menu? is it possible ,if yes then how? @vazhavandan- what kind of customised setting do you want ? Please be more specific @super hero -i want to add new feature in universal access setting panel that will open particular application for eg.Eekboard
I admit that i am not geeky enough to hack "Universal Access menu". Here is my workaround.
I first install Eekboard(eekboard is a virtual keyboard) using the one click from this page.
Then i set about installing a extension known as QuickLaunch. For more details about some cool extensions one can take a look at this article.
Then i restart GNOME Shell using command launcher (Alt+F2) and then typing in r followed by return or enter key. Now the extension will appear in top panel / taskbar.
I click on "Create new launcher..' menu in the extension and it opens up"gnome-desktop-item-edit" application where i can create shortcut for any application.
Notes
By default all new shortcuts or launchers are placed in below folder:- /home/<profileName>/.local/share/gnome-shell/quicklaunch
(OR) ~/.local/share/gnome-shell/quicklaunch
All the GNOME Shell Extensions are installed into below folder:- /home/<profileName>/.local/share/gnome-shell/extensions
(OR) ~/.local/share/gnome-shell/extensions
Creating new menu item for Eekboard
Now i can launch the application using the new menu
Update to Article:-
The user pointed out that he / she did not want to use quicklaunch and pointed out to files under frolder /usr/share/gnome-shell/js/ui/status/
@super hero - Thank You for your reply. i don't want to use Quick Launch. I want to add new option on Universal Access setting Panel ,which will open installed application. i came to know about accessibility.js file (/usr/share/gnome-shell/js/ui/ status/),which has all UI details, but i am not getting how it launches that particular application.
I found the file in question accessibility.js and I opened that file and added the below lines and it worked. I never dreamt GNOME would be some simple to change :-) this.menu.addSettingsAction(_("Universal Access Settings"), 'gnome-universal-access-panel.desktop');
//Add the damn new virtual keyboard
this.menu.addSettingsAction(_("Eekboard"), 'eekboard.desktop');
Zypper is the default command line package manager on openSUSE. The following video demonstrates using zypper through gnome-terminal for :-
Installation of various packages like audacious and audacious-plugins using "in" option
Removal of packages using "rm" option . It also demonstrates use of -u param to automatically remove dependencies which become unneeded after removal of requested packages.
I had earlier written about forcing programs to appear in open with list. There is one more method of :-
Adding file associations / context menu / right click entries.
Setting order of programs for opening in context menu.
Setting default program for a file type.
on GNOME 3.4.2 / openSUSE 12.2, all in a single shot.
I am taking a Flash video as a sample and i find the file associations as shown below and I set about modifying it.
Step 1
Find the file mimeapps.list on your machine. It will be under the folder path as shown below.
~/.local/share/applications/mimeapps.list
Step 2
Check the file type or mime type of the file by right clicking and checking properties. Since I am taking a Flash video as a sample, I find that mime type is (video/x-flv).
Step 3
Open it in your favourite text editor. I am using gedit to edit the file. Open command launcher (Or) quick launch window (Alt+F2) and type in following commands followed by return or enter key to edit the file.
After opening the file we will find some existing entries in the file. Don't remove any existing entries. Just append any new entries at the end. After deciding on the default application for a file we make an entry under "Default Applications". Then we put this default application first under "Added Associations" and then add subsequent entries as shown below. Save and exit the file.