Thursday, August 22, 2013

Private Browsing in Firefox and Chrome

I wanted to start my Firefox and Chrome browsers in private/incognito mode by default and here is what is working for me.

In Linux distributions, applications are usually packaged with *.desktop files which act as the shortcuts for launching the corresponding applications. For example Firefox browser package has   /usr/share/applications/firefox.desktop shortcut file and the google chrome package has /opt/google/chrome/google-chrome.desktop short cut file. These shortcut files list the actual program to be launched with Exec= setting.

My /usr/share/applications/firefox.desktop  by default has:

Exec=firefox %u



and I changed it to


Exec=firefox -private %u


My /opt/google/chrome/google-chrome.desktop file by default has:

Exec=/opt/google/chrome/google-chrome %U

and I changed it to

Exec=/opt/google/chrome/google-chrome --incognito %U


After making the above changes, firefox and Chrome browsers directly start in Private and Incognito modes respectively.

The *.desktop files have a standard format with groups like Desktop Entry, New Window Entry etc. Seems like only the entries of Desktop Entry group are taken into consideration while launching applications in gnome. So, update the Exec value as mentioned above in Desktop Entry group and tha will do.

This is working in Fedora 18, and should work in other distributions as well. 

Access VM's Virtual Consoles in Qemu

To access Virtual Terminals on a Linux host, the users can go about hitting Ctrl+Alt+F1 ... Ctrl+Alt+F7 key combinations. But while working on a Virtual Machine on qemu, users cannot directly hit the above key combinations to get to the Virtual Terminals.


The users will have to hit Ctrl+Alt+2 first which will get to qemu's Monitor console. Once at the Monitor Console, the user can enter the following command to get to VT2

(qemu) sendkey ctrl-alt-f2


Another nice feature of the qemu monitor console is the screen dump feature, which can be used to capture the screenshot of the Virtual Machine. The users will have to run the following command:

(qemu) screendump  /home/username/test.ppm







I gathered this information from other public articles and re-posting it for my future reference.

Friday, June 10, 2011

Download SSL certificates for use with command line tools

In order to download the certificate from a remote server and use it with all the command line tool, first run the following command to download the self-signed certificate from the remote server:

openssl sl_client remote_server:443 > new.cert

The above command will download the certificate and capture the contents in the new.cert file. Now this new certificate has to be added a certificate bundle that is maintained by the local system. In Fedora the certificate bundle is maintained in : /etc/pki/tls/certs/ca-bundle.crt file. To add the new certificate to the list of accepted certificates run the following command:

cat new.cert >> /etc/pki/tls/certs/ca-bundle.crt

Be sure to only append to the target file and not overwrite (that is be sure to use >> and NOT > ).

Of course, you will only be accepting the self-signed certificate from a remote server only if you trust the server. Please don't do this for every server you come across.

Wednesday, July 28, 2010

PAGE_SIZE undefined

I ran into a couple of build failure on x86_64 architecture because the PAGE_SIZE variable in not defined. This 32-bit version of the same package builds fine, it is only the 64-bit ones that fail.


One straight forward fix to this problem would be to use sysconf(_SC_PAGESIZE) instead of PAGE_SIZE variable. This will query system to get the right page size.

Also remember to make sure unistd.h file is included when using the above mentioned sysconf call.


Praveen

Wednesday, June 2, 2010

Flash on 64-bit Fedora

To install flash on a 64-bit Fedora systems, follow one of the following methods:

1) Use the pre-release version of the Adobe Flash.

Go here and download the plugin towards the end of the page.
This would most likely be a tar.gz file. Extract the file with "tar zxvf downloaded_filename". This archive would have a single file by the name "libflashpalyer.so".
Check if the file is actually a 64-bit plugin. run "file libflashplayer.so" the output would look like:

libflashplayer.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped


In order to install the plugin either copy the file to /usr/lib64/mozilla/plugins directory if you have root access. If not, copy the file to ~/.mozilla/plugins directory.

After copying the plugin restart firefox and you should have your youtube vidoes running fine :).



2) Use nspluginwrapper to be able to run 32-bit flash on 64-bit systems.

Note: You should have root access to use this method.

Go here and download the flash rpm version. Install the package with rpm ivh flash-plugin-10.0.45.2-release.i386.rpm. This package will install the flash plugin as /usr/lib/flash-plugin/libflashplayer.so along with a couple of other files.

Now install ndspluginwrapper with :
yum -y install nspluginwrapper.i686. This command will pull down close 90 packages as dependencies, let them all be installed.

The nspluginwrapper.i686 package will allow plugins compiled for i386 to run on other architectures (eg x86_64). It will install a proxy plugin as /usr/lib/mozilla/plugins-wrapped/npwrapper.so and during its post installation steps, it runs, /usr/bin/mozilla-plugin-config -i -f command, which will search for all i386 plugins and install them into /usr/lib64/mozilla/plugins-wrapped/. You will notice nswrapper_32_64.libflashplayer.so file in this directory which is linked/wrapped from 32-bit to 64-bit by the wrapper.

You will be able to play the flash videos now, but there will be no sound. To fix the sound, run yum -y install alsa-plugins-pulseaudio.i686 and restart firefox. This should have flash up and running.



To check if the flash plugin is installed fine, go to Tools->Add-ons->Plugins. You should have Shockwave Flash listed among the plugins.

I verified the above steps on a fresh install of Fedora 13 x86_64 alone.

Praveen

Saturday, May 29, 2010

Firmware file "b43/ucode15.fw" not found

I recently installed Fedora 13 (x86_64) on a Dell Vostro 1000 laptop and ran into some problems with my wireless connection.

The wireless card I had in my laptop is (lspci | grep 802):
05:00.0 Network controller: Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01).

The driver module that is loaded for this device is "b43". In the /var/log/messages, I found out the following messages related to this module::

May 29 09:48:28 laptop kernel: b43-phy1: Broadcom 4312 WLAN found (core revision 15)
May 29 09:48:28 laptop kernel: Registered led device: b43-phy1::tx
May 29 09:48:28 laptop kernel: Registered led device: b43-phy1::rx
May 29 09:48:28 laptop kernel: Registered led device: b43-phy1::radio
May 29 09:48:28 laptop kernel: Broadcom 43xx driver loaded [ Features: PMLS, Firmware-ID: FW13 ]
May 29 09:48:28 laptop NetworkManager[1193]:
(wlan0): driver supports SSID scans (scan_capa 0x01).
May 29 09:48:28 laptop NetworkManager[1193]:
(wlan0): new 802.11 WiFi device (driver: 'b43' ifindex: 4)
May 29 09:48:28 laptop NetworkManager[1193]:
(wlan0): exported as /org/freedesktop/NetworkManager/Devices/2
May 29 09:48:28 laptop NetworkManager[1193]:
(wlan0): now managed
May 29 09:48:28 laptop NetworkManager[1193]:
(wlan0): device state change: 1 -> 2 (reason 2)
May 29 09:48:28 laptop NetworkManager[1193]:
(wlan0): bringing up device.
May 29 09:48:28 laptop kernel: b43 ssb0:0: firmware: requesting b43/ucode15.fw
May 29 09:48:28 laptop kernel: b43 ssb0:0: firmware: requesting b43-open/ucode15.fw
May 29 09:48:28 laptop kernel: b43-phy1 ERROR: Firmware file "b43/ucode15.fw" not found
May 29 09:48:28 laptop kernel: b43-phy1 ERROR: Firmware file "b43-open/ucode15.fw" not found
May 29 09:48:28 laptop kernel: b43-phy1 ERROR: You must go to http://wireless.kernel.org/en/users/Drivers/b43#devicefirmware and download the correct firmware for this driver version. Please carefully read all instructions on this website.
May 29 09:48:28 laptop NetworkManager[1193]:
(wlan0): deactivating device (reason: 2).
May 29 09:48:28 laptop NetworkManager[1193]:
found WiFi radio killswitch rfkill1 (at /sys/devices/pci0000:00/0000:00:06.0/0000:05:00.0/ssb0:0/ieee80211/phy1/rfkill1) (driver )
May 29 09:48:28 laptop kernel: b43 ssb0:0: firmware: requesting b43/ucode15.fw
May 29 09:48:28 laptop kernel: b43 ssb0:0: firmware: requesting b43-open/ucode15.fw
May 29 09:48:28 laptop kernel: b43-phy1 ERROR: Firmware file "b43/ucode15.fw" not found
May 29 09:48:28 laptop kernel: b43-phy1 ERROR: Firmware file "b43-open/ucode15.fw" not found
May 29 09:48:28 laptop kernel: b43-phy1 ERROR: You must go to http://wireless.kernel.org/en/users/Drivers/b43#devicefirmware and download the correct firmware for this driver version. Please carefully read all instructions on this website.
May 29 09:48:28 laptop NetworkManager[1193]:
(wlan0): supplicant interface state: starting -> ready
May 29 09:48:28 laptop NetworkManager[1193]:
(wlan0): device state change: 2 -> 3 (reason 42)



This seems to be a well known problem. As the message suggested, I went to http://wireless.kernel.org/en/users/Drivers/b43 and followed the section "You are using the b43 driver from linux-2.6.25 or newer" since Fedora 13 had (uname -r) 2.6.33.3-85.fc13.x86_64 kernel in it.

Since the "b43-fwcutter" is already installed, I just had to run:
export FIRMWARE_INSTALL_DIR="/lib/firmware"
wget http://mirror2.openwrt.org/sources/broadcom-wl-4.150.10.5.tar.bz2
tar xjf broadcom-wl-4.150.10.5.tar.bz2
cd broadcom-wl-4.150.10.5/driver

sudo b43-fwcutter -w "$FIRMWARE_INSTALL_DIR" wl_apsta_mimo.o


Doing so, the files "/lib/firmware/b43/ucode15.fw", "/lib/firmware/b43/lp0initvals15.fw", "/lib/firmware/b43/lp0bsinitvals15.fw" appeared on my computer. As the name suggests the "b43-fwcutter" cuts these firmware files from the drivers distributed by Broadcom and places them in /lib/firmware/b43.


After the required firmware is installed, just reload the b43 drivers (modprobe b43) or just restart the laptop and you should have the wireless card working :).