Step4wd

Just one more blog on internet

Installing LibreOffice 5 in Ubuntu

Installing LibreOffice 5 in Ubuntu

August 24,2015 by MAhmadZ

The latest version of LibreOffice is here but unfortunately its not going to be available in Ubuntu 14.04 and 12.04 by default. But the good news is that we can upgrade existing version by typing these commands:

sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update && sudo apt-get -y dist-upgrade

That should be enough! :-)

Disable Guest Account in Ubuntu

August 24,2015 by MAhmadZ

Ubuntu has a special account, named Guest, which allows access (login) to the system without asking for any password. Although there are limitation applied to this account but maybe its not always desirable to have it. These steps will help in disabling it (tested under 12.04):

Open the file /etc/lightdm/lightdm.conf and add the following line to it at the end:

allow-guest=false

Once thats done, restart the relevant service:

sudo restart lightdm

This should work!

Installing Ubuntu Updates on Multiple Systems

Installing Ubuntu Updates on Multiple Systems

February 27,2013 by MAhmadZ

Today I was installing Ubuntu in my Olives School lab. There are 20 systems in total. After installing it in the first PC, I ran the Update and there were 443 of them which amounted for 337MB approx. As it can be imagined it took some time to get the first PC updated. This was clearly not what I was going to do with the rest and I had to come up with a solution.

When Ubuntu downloads these updates, it places them in /var/cache/apt/archives/ folder. In fact even after installing updates, they are not removed from the system. So a solution was simple:

  1. Copy all the downloaded packages to a USB
  2. On the next PC, run the command:

    sudo cp [path-to-usb]/* /var/cache/apt/archives
  3. Once all the files have been pasted, run the Update Manager tool and it will tell you that updates have been downloaded but not yet installed.
  4. Click on Install :-)

Tool to Manage Ubuntu Services

Tool to Manage Ubuntu Services

July 21,2010 by MAhmadZ

In an earlier post, I mentioned about the Runlevels in Ubuntu and how its different from the rest of the Linux family. Each Runlevel can be configured to start with certain services. A tool to manage the Services in Ubuntu is sysv-rc-config

This tool can be installed using the command:

sudo apt-get install sysv-rc-conf

Once installed, it can be used as:

sudo sysv-rc-conf

This tool will display all the services and the runlevels. You can easily choose which services to load and which not to. The screenshot shows how it will appear. To exit the tool, press q key.

Install Internet Explorer (IE) on Linux

Install Internet Explorer (IE) on Linux

May 19,2010 by MAhmadZ

Although I am not a fan of Internet Explorer but sometimes it cannot be ignored especially when few websites have limited their access to IE browsers only or some old websites with poor markup which only renders on IE.

Internet Explorer (IE 5, 5.5, 6 and 7) can be installed and run on any Linux distribution. The package can be found and downloaded from these links:

  1. http://www.liewcf.com/install-internet-explorer-6-on-linux-2242/
  2. http://www.tatanka.com.br/ies4linux/download.html
  3. http://www.tatanka.com.br/ies4linux/page/Installation
  4. http://webexpose.org/2007/01/07/internet-explorer-7-on-linux/

When installing IEs4Linux, the Linux X-Window may crash, giving you the following error message:

The program ‘ies4linux-gtk.py’ received an X Window System error.
This probably reflects a bug in the program.
The error was ‘RenderBadPicture (invalid Picture parameter)’.
(Details: serial 5546 error_code 158 request_code 148 minor_code 7)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the –sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)

The workaround this is to use the non-GUI, command based installation. To install use the command:

./ies4linux --no-gui

For further help:

./ies4linux --help

I hope the day comes when all of this is not required and we have a true cross-browser web.

Join FLV files in Ubuntu

May 19,2010 by MAhmadZ

When we download video from Youtube or any other website, 90% chances are you are watching them using Flash Video Player whose format is FLV. Some of the videos uploaded in Youtube are sliced into multiple parts especially when Youtube only allowed you to upload a video of maximum 10 minute duration.

There is a simple but useful way of joining these files into a single under Ubuntu.

First you will need to install the package:

sudo apt-get install avidemux

Next, keeping the audio/video encoding unchanged, just join them (change the filenames accordingly):

mencoder -forceidx -of lavf -oac copy -ovc copy -o output.flv clip1.flv clip2.flv clip3.flv

Google Chrome error – Your preferences can not be Read

Google Chrome error – Your preferences can not be Read

May 30,2010 by MAhmadZ

Sometimes Google Chrome under Linux or Ubuntu gives the following error:

Your preferences can not be read. Some features may be unavailable and changes to preferences won’t be saved.

This is because the owner of the following files have been changed for some unknown reason: Under /home/[user]/.config/google-chrome/ the file Locale State and under /home/[user]/.config/google-chrome/Default the file Preferences.

Note: This tip works for Linux, for Windows the steps have not been personally tested.

If you are using Windows XP:

C:\Documents and Settings\[Username]\Local Settings\Application Data\Google\Chrome\User Data\Default

If you are using Windows 7:

C:\Users\[Username]\AppData\Local\Google\Chrome\User Data\Default

If you are using Linux:

/home/[Username]/.config/google-chrome/Default

Where user is the supposed name of the user.

To fix the problem, run the following commands (replacing user with the actual username):

sudo chown user:user /home/user/.config/google-chrome/Locale\ State
sudo chown user:user /home/user/.config/google-chrome/Default/Preferences

To fix the permissions in Windows, visit this link: How do I change folder and file Permissions?. Simply deleting the Google folder in the paths specified will also help.

InshAllah the problem will be solved!

Install Apache, PHP and MySQL on Ubuntu

April 29,2012 by MAhmadZ

Installing these packages on Ubuntu is very simple. Just execute the following commands and you will be done with everything.

Install Apache

sudo apt-get install apache2

Install PHP

sudo apt-get install php5 libapache2-mod-php5

Install MySQL (with Apache & PHP support)

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

Restart Apache

sudo /etc/init.d/apache2 restart

Install MySQL Query Browser

sudo apt-get install mysql-query-browser

Update for MySQL

MySQL has officially declared EOL (End of Life) for Query Browser. You can check it on http://dev.mysql.com/doc/query-browser/en/

MySQL Workbench is its replacement and its now available in Ubuntu 12.04 repositories:

sudo apt-get install mysql-workbench

All features are supported by Workbench. Additionally you can check my answer on askubuntu.com

Mount BIN CUE Images in Ubuntu

March 15,2010 by MAhmadZ

Mounting ISO files in Linux is quite straight forward and simple e.g. using the mounter function in Ubuntu straight from the context menu or by using a command line like this:

mount -o loop image.iso /mnt

Anyway mounting BIN/CUE image files is not that straight forward as they’ll need conversion to ISO before mounting, however the process is quite simple, but it need a small application called bchunk. The bchunk package contains a UNIX/C rewrite of the BinChunker program. It converts a CD image in a .bin/.cue format (sometimes .raw/.cue) into a set of .iso and .cdr/.wav tracks. The .bin/.cue format is used by some non-UNIX CD-writing software, but is not supported on most other CD-writing programs.

To install the package:

sudo aptitude install bchunk

In order to convert a bin/cue image set:

bchunk image.bin image.cue image.iso

Then to mount the iso image using this command:

mount -o loop image.iso /mnt

Now you can view the contents in the folder /mnt.

Change Default GRUB2 Options in Ubuntu 9.10

March 08,2010 by MAhmadZ

With Ubuntu 9.10, GRUB 2 is installed by default as the boot loader (although it is still in beta version). The files and commands have been changed.

GRUB 2 settings can be viewed using the command:

sudo gedit /boot/grub/grub.cfg

(You can replace gedit with vim or whichever editor you prefer). This grub.cfg contains the menu entries but it is NOT recommended to change anything in this file. Infact, this file is compiled.

To alter the default menu item, timeout etc, open the grub file using the command:

sudo gedit /etc/default/grub

Make the required changes, for instance in my case I made you changes:

GRUB_DEFAULT=4
GRUB_GFXMODE=1280x800

After making the changes, save the file and compile the output using the command:

sudo update-grub

Reboot and see the results!

Runlevels in Ubuntu

January 18,2010 by MAhmadZ

Runlevel is the mode in which the operating system like Linux is running. Conventionally, seven runlevels from 0 to 6 existed. Where 0 meant shutdown and 6 meant Reboot.

In previous versions, Ubuntu used to the /etc/inittab file to manage runlevels, just like most of the Linux distributions. This file was based on traditional init daemon, which is used to perform system startup tasks. This was replaced in Ubuntu 6.10 (Release date: 26th-Oct-2006) with Upstart, an event based daemon. Now there are several files under the /etc/events.d/ directory.

The runlevels that Ubuntu handles by default are:

  • Runlevel 0 – Halt
  • Runlevel 1 – Multiuser text mode
  • Runlevel 2 – Graphical multiuser mode
  • Runlevel 6 – Reboot

For more details visit Ubuntu’s Upstart section.

Enable IP Forwarding in Linux

January 18,2010 by MAhmadZ

What is IP Forwarding?

Normally, a system can not communicate with another system belonging to a different network address. IP forwarding is the mechanism of forwarding an IP packet from one network (example: 192.168.1.0) to another network (example: 192.168.2.0).

How to enable IP Forwarding in Linux?

By default, IP forwarding is disabled in linux. The current setting can be verfied using the command:

cat /proc/sys/net/ipv4/ip_forward

This will give the output: 0

Another way to test is to run:

sysctl net.ipv4.ip_forward

This will give the output:

net.ipv4.ip_forward = 0

Where 0 means disabled and 1 means enabled.

Enabling IP Forwarding for the Current Running Kernel

Running either of commands will perform the task:

sysctl -w net.ipv4.ip_forward = 1

or

echo 1 > /proc/sys/net/ipv4/ip_forward

But this is only for the current running kernel session. After reboot the old values will be restored.

Permanently Enabling IP Forwarding

Open the required in VIM or any other text editor:

vim /etc/sysctl.conf

Locate the line and modify it as under:

net.ipv4.ip_forward = 1

But these changes will not take effect unless the system is restarted or the command is run:

sysctl -p /etc/sysctll.conf

For Redhat systems, restarting the network service will automatically reload the changes to sysctl.conf:

service network restart

On Ubuntu, this is also possible by restarting the procps service:

/etc/init.d/procps.sh restart

For Debian distributions open the /etc/network/options and make the following changes and restart the network service or reboot:

ip_forward = yes

For Redhat distribution open /etc/sysconfig/network and do the same:

FORWARD_IPV4 = true

The changes can be viewed using the commands mentioned above.