Tuesday, July 15, 2014

Steps to Remastersys Ubuntu 12.04 LTS

1. Check there is enough space in /home folder. Because the customized OS will be stored under /home folder by default.
2. sudo /etc/apt/sources.list
Add this line at the bottom of the file
deb http://www.remastersys.com/ubuntu precise main
3. sudo apt-get update
4. sudo apt-get install remastersys*
5. sudo remastersys dist iso mycustomubuntu.iso
6. Goto the location /home/remastersys/remastersys
7. md5sum /home/remastersys/remastersys/yourfilename.iso
8. Check the file that is located /home/remastersys/remastersys/youfilename.iso.md5
Both the output should be the same.
9. sudo remastersys clean

Wednesday, July 2, 2014

Jun for fun - courtesy NixCraft

Wednesday, June 25, 2014

Steps to install Openshot Video editor in Ubuntu 14.04

1. Add openshot PPA
sudo add-apt-repository ppa:openshot.developers/ppa

2. Update list
sudo apt-get update

3. Install openshot
sudo apt-get install openshot openshot-doc

Transmission installation steps in Ubuntu 14.04

Add transmission into the repository:
sudo add-apt-repository ppa:transmissionbt/ppa

Steps for Transmission web interface: (install, if require)
sudo apt-get update
sudo apt-get install transmission-cli transmission-common transmission-daemon

Steps for Transmission GUI:
sudo apt-get update
sudo apt-get install transmission-gtk transmission-cli transmission-common transmission-daemon

GUI installation in Ubuntu 14.04 Server LTS

Installing light weight GUI in Ubuntu 14.04 Server LTS

#sudo apt-get install xorg gnome-core gnome-system-tools gnome-app-install

Activate apt-get with proxy server in Ubuntu 12.04 LTS

Setting up the proxy server temporarily

#export http_proxy=http://yourproxyaddress:proxyport

BASH rc method

This method adds a two lines to your .bashrc file in your $HOME directory. This method is useful if you would like apt-get and other applications for instance wget, to use a http-proxy.

gedit ~/.bashrc
Add these lines to the bottom of your ~/.bashrc file (substitute your details for yourproxyaddress and proxyport)

export http_proxy
Save the file. Close your terminal window and then open another terminal window or source the ~/.bashrc file:

source ~/.bashrc
Test your proxy with sudo apt-get update and whatever networking tool you desire. You can use firestarter or conky to see active connections.

If you make a mistake and go back to edit the file again, you can close the terminal and reopen it or you can source ~/.bashrc as shown above.

source ~/.bashrc

Squid log parsing script in Ubuntu 12.04

Squid log parsing script in Python

Step1: copy the following script and paste into any editor (gedit, vim, vi or nano)

#!/usr/bin/env python

import sys, os
from datetime import datetime

    if not os.path.isfile(sys.argv[1]):
        sys.stderr.write("[Error]: %s is not a file\n" % sys.argv[1])
except IndexError:
    sys.stderr.write("Usage: parse_squid_log.py access.log\n")

with open(sys.argv[1]) as log:
    for line in log:
        line = line.split(' ')
        line[0] = str(datetime.fromtimestamp(float(line[0])))
        print ' '.join(line).strip()

Step2: Change the permission as like this (sudo chmod +x scriptname.py)
Step3: ./scriptname.py /var/log/squid3/access.log

The output will be in a readable format.

Squid3 default configuration in Ubuntu 12.04 Server LTS

Just copy and paste the following red code and restart the specified installed squid3 service in Ubuntu12.04 Server LTS

In the localnet, you can mention your own network(s).
Note: This is not blocking any website specifically.

acl manager proto cache_object
acl localhost src
acl to_localhost dst
acl localnet src
acl SSL_ports port 443
acl Safe_ports port 80 #http
acl Safe_ports port 21 #ftp
acl Safe_ports port 443 #https
acl Safe_ports port 70 #gopher
acl Safe_ports port 210 #waim
acl Safe_ports port 1025-65535 #unregistered ports
acl Safe_ports port 280 #http-mgmt
acl Safe_ports port 488 #gss-http
acl Safe_ports port 591 #filemaker
acl Safe_ports port 777 #multiling http


http_access allow manager localhost
http_access allow localnet
http_access deny manager
http_access deny !Safe_ports
http_access deny to_localhost

icp_access deny all
htcp_access deny all

# block all other access
http_access deny all

http_port 3128 transparent
hierarchy_stoplist cgi-bin ?
access_log /var/log/squid3/access.log squid

#Suggested default:
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid3

Saturday, June 21, 2014

While loop to run command multiple times - a simple shell script

while true; do ls ; done

Friday, June 20, 2014

Simple steps to install wine in OpenSuse 13.1

The first two commands are required, if works good. Otherwise, type the third command only.

1. sudo zypper addrepo http://download.opensuse.org/repositories/openSUSE:13.1/standard/openSUSE:13.1.repo
2. sudo zypper refresh
3. sudo zypper install wine

A very simple command to install kdenlive (Video editor) in OpenSuse13.1

sudo zypper in kdenlive

One simple command is to install audacity in OpenSuse 13.1

sudo zypper in audacity

Simple steps to install VLC player in OpenSuse 13.1 in command mode

sudo zypper ar http://download.videolan.org/pub/vlc/SuSE/13.1/ VLC

sudo zypper mr -r VLC

sudo zypper in vlc

Google chrome installation steps in Open Suse 13.1

64bit version
zypper ar http://dl.google.com/linux/chrome/rpm/stable/x86_64 Google-Chrome
32bit version
zypper ar http://dl.google.com/linux/chrome/rpm/stable/i386 Google-Chrome
Now type:
zypper ref
And install Google Chrome:

zypper in google-chrome-stable

Friday, June 13, 2014

RHEL7 released on June 10, 2014.

Features of RHEL7
Expanded Windows interoperability capabilities, including integration with Microsoft Active Directory domains.
Significant file system enhancements, including making XFS as the default file system. This allows scaling to support file systems up to 500 TBs.
Improved subsystem management through OpenLMI. This is a Red Hat-sponsored open source project. It's designed to provide a common infrastructure for multiple Linux systems management.
Real-time VM migration from RHEL 6 hosts to RHEL 7 hosts without downtime or VM modification.
Access to Docker container support with RHEL 7 RC, due to an expansion of the RHEL 7 High-Touch Beta program.

Thursday, June 12, 2014

Install Broadcom b43 and b43-legacy wireless driver in Ubuntu 14.04 LTS

To Install b43 driver
Run the following command in the terminal and type the password for the user when prompted.
sudo apt-get install b43-fwcutter firmware-b43-installer

To Install b43-legacy driver
If you have b43-legacy wireless card then you need to install the legacy driver using the below command.
sudo apt-get install firmware-b43legacy-installer
That’s it. Now Activate your driver using Additional driver and Restart your System.

Wednesday, June 11, 2014

Airtel 3G Data card works good in Acer Aspire Laptop

Step1: Insert the Airtel 3G Data card and copy the linux folder to some directory.
Step2: chmod a+x *.*
           chmod a+x *
Step3: Follow the instructions

Wednesday, June 4, 2014

Google chrome in RHEL6.5

Step1: Download the following script from internet and change the permission as follows

# wget http://chrome.richardlloyd.org.uk/install_chrome.sh
# chmod u+x install_chrome.sh
# ./install_chrome.sh

Step2: Applications -> Internet -> Google Chrome

Tuesday, June 3, 2014

AvideMux 2.6.8 works well in RHEL6.5

Simple steps to install AvideMux in RHEL6.5
Step1: vim /etc/yum.repos.d/somename.repo 
copy and paste the following content in it

name=LinuxTECH.NET el6 main repo

name=LinuxTECH.NET el6 testing repo

name=LinuxTECH.NET el6 backports repo
Step2: yum --enablerepo=linuxtech-testing install avidemux-gtk (GTK GUI version)

Audacity works good in RHEL 6.5

Step1: Add the yum repository entries in the following file
vim /etc/yum.repos.d/linuxtech.repo


Step2: yum install audacity

Step3: Press y for confirming the repository

Access menu
Applications -> Sound & Video -> Audacity

Friday, May 23, 2014

Transmission bit torrent client installation in RHEL6.5

Step1: Download the transmission torrent client from the following link
Step2: tar -xzvf transmission.tar.gz
           cd transmission
           rpm -ivh *

Thats it see the app in Applications -> Internet -> Transmission BitTorrent Client.

NTFS can be read and written in RHEL6.5

Step1: Go to the following link and download all of them
Step2: Extract both the directories (Fuse-2.8.4 & ntfs-3g-1.1120)
Step3: Follow the instructions as per the procedure file.
           Run yum install gcc* -y
Step4: mkdir -p /mnt/ntfs
           mount -t ntfs-3g /dev/sdb1 /mnt/ntfs/ 
           cd /mnt/ntfs
           touch somefile
Step5: Make the following entry in /etc/fstab, if you want to mount the ntfs partition permanently.

/dev/sda2               /mnt/ntfs               ntfs-3g defaults        0 0

Libre Office functions good in RHEL6.5

Download the latest libre office from this site http://www.libreoffice.org/download/libreoffice-fresh/
tar xvjf libreoffice
go to the specified folder and give the following command
yum install *.rpm

Webcam functions good with VLC Player in RHEL6.5

Webcam functions good with VLC Player in RHEL6.5 in Acer Aspire Laptop.

Installation of VLC player in RHEL6.5

Step1: Download both the files from the following link
Step2: chmod +x vlc6-installation.sh
Step3: ./vlc6-installation.sh
Sit back and relax for sometime.
Step4: useradd username, passwd username
Step5: login to the user that you created now or use another user other than root.
Step6: Applications -> Sound & Video -> VLC Media Player

Simple Samba Server Configuration in Ubuntu Server 12.04 LTS

Samba server is mainly used for file sharing in cross platform environment. You can find the simple following steps to make Samba file server configuration in Ubuntu Server 12.04 LTS.
Step 1: Install the samba package from online repository
            sudo apt-get install samba
Step 2: Edit the configuration file /etc/samba/smb.conf
            workgroup = EXAMPLE
            This EXAMPLE can be your domain name or some desirable name
Step 3: Make or add the following changes in the bottom of the file. Use bottom of the file for improving your readability. However, you can add these lines in any portion of the configuration file (for advanced users- generally not recommended for normal users).
    comment = Ubuntu File Server Share
    path = /srv/samba/share
    browsable = yes
    guest ok = yes
    read only = no
    create mask = 0755
    valid users = employee
Step 4: Make a directory
            mkdir -p /srv/samba/share
Step 5: Restart the following services
            sudo restart smbd
            sudo restart nmbd
Step 6: Create users only to access samba share

            useradd -s /sbin/nologin employee
            smbpasswd -a employee
            smbpasswd -e employee

To access samba via command line
smbclient // -U employee

Thursday, May 22, 2014

Red Hat yum server via CentOS

Red Hat yum server can be set by using centos repository

name=centos repos

Chamilo works good in Ubuntu 12.04 LTS

Chamilo works good with Ubuntu 12.04 LTS server edition which is used for online E-learning collaboration software.

The following commands are used for changing the ip of the server, if required

vi /www/html/chamilo/main/inc/conf/configuration.php
sudo service apache2 restart

Firefox 29.0.1 works good in RHEL6.5

Step1: Download latest firefox 29.0.1 from http://www.mozilla.org/en-US/firefox/new/
Step2: tar xvjf firefox.tar.bz2
Step3: goto the specified directory and give ./firefox

Monday, April 14, 2014

Enabling hibernation in Ubuntu server 12.04

In Ubuntu 12.04 and newer, hibernation has been disabled by default in policykit.

Type the following command:

sudo nano /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

Fill it with this:
[Re-enable hibernate by default]
Save by pressing Ctrl-O then enter and then exit nano by pressing Ctrl-X.

Tuesday, February 18, 2014

Some important links for interview Linux questions

When user create a file or directory under Linux or UNIX, she create it with a default set of permissions. In most case the system defaults may be open or relaxed for file sharing purpose. For example, if a text file has 666 permissions, it grants read and write permission to everyone. Similarly a directory with 777 permissions, grants read, write, and execute permission to everyone.

Setting crontab every second
*/* * * * * script.sh
Boot sequence for X11/GUI mode/Runlevel 5 in Linux SysV Init
init Runlevel File Locations

When a Linux system running SysV Init begins to boot with its kernel, it first runs the /sbin/init program, which does some system checks, such as verifying the integrity of the file systems, and starts vital programs needed for the operating system to function properly. It then inspects the /etc/inittab file to determine Linux's overall mode of operation or runlevel.
Suid & Sgid
suid the particular command will run with the owner's permission not with the user's permission. No effect on directories.
sgid the particular directory will run with the group's permission. No effect on files.

HPC High Performance Computing
Combine the power of an industry-leading, high-performance computing infrastructure with highly efficient systems and solutions to solve scientific, engineering and data analysis problems—regardless of scale—from mainstream to the grand challenges of our society. HP high performance computing solutions empower innovation at any scale, building on HP’s innovative purpose-built HPC systems and technologies.

dmidecode command in Linux

dmidecode command is used to view the bios and serial number, system model number etc. This command is very similar to start->run->msinfo32 in Windows.

Monday, February 17, 2014

Firefox27 works good in RHEL6.0

Simple steps to install firefox 27 in RHEL6.0

1. Goto the firefox website and download the latest firefox
2. goto the particular directory (say /root/Desktop/firefox).
3. #chmod +x *.*
4. ./firefox