Monday, March 23, 2015

How to install software or upgrade from an old unsupported release?

Please check the following link for installing software or upgrading from an unsupported release (Eg: Ubuntu 9.04)

Create Wifi Hotspot in Ubuntu Laptop For Android Phones

Type these following commands to make you Ubuntu 14.04 (derived) flavor for activating Wifi hot spot in your laptop or desktop (it should have wifi card in it)

#sudo add-apt-repository ppa:nilarimogard/webupd8

#sudo apt-get update

#sudo apt-get install ap-hotspot

First uninstall the buggy hostapd in Ubuntu 14.04 via:

#sudo apt-get remove hostapd

For 64-bit system:

#cd /tmp && wget http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_amd64.deb && sudo dpkg -i hostapd*.deb && sudo apt-mark hold hostapd

For 32-bit system:

#cd /tmp && wget http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_i386.deb && sudo dpkg -i hostapd*.deb && sudo apt-mark hold hostapd

Once installed, execute below command to configure your wifi hotspot:

#sudo ap-hotspot configure

Finally start the wireless hotspot via:

#sudo ap-hotspot start

To stop the wireless hotspot, execute this command in Ubuntu terminal:

#sudo ap-hotspot stop

Courtesy:
http://ubuntuhandbook.org/index.php/2014/02/wifi-hotspot-ubuntu-laptop-android/

Please report issues at: https://github.com/hotice/AP-Hotspot/

Friday, March 20, 2015

Find the inactive users for a particular period of time

#lastlog -t 10000 > temp1; lastlog -t 10 > temp2; diff temp1 temp2;
for i in `sudo lastlog | grep -v 'pts' | awk -F ' ' '{print $1}'`; do sudo more /etc/passwd |grep /bin/bash |awk -F: '{print $1}' |grep $i; done

How to unlock the password of an user

#passwd -u username
eg: #passwd -u pnaprasanna

Wednesday, March 18, 2015

Disk usage check simple command

#du –h /mnt
#du -kh /mnt

How can I find the number of files and inodes on a file system?

$ find / -type f | wc –l
$ df --inodes / /home
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/sda1            3981312  641704 3339608   17% /
/dev/sda8            30588928  332207 30256721    2% /home
$ sudo find / -xdev -print | wc -l
642070
$ sudo find /home -print | wc -l
332158
$ sudo find /home -type f -print | wc -l
284204

Slackware package manager - how to install applications

Slackware is the oldest Linux still being maintained, it is light, simple, and stable.
It is not too easy to maintain, specially because most Linux users now a day (me included) are accustomed to package manager tools that take care of dependency resolution. In Slackware the user is the one who should resolve this, and install any package or library needed.
Slackware is a free and open source operating system. It was one of the earliest operating systems to be built on top of the Linux kernel and is the oldest currently being maintained. Slackware was created by Patrick Volkerding of Slackware Linux, Inc. in 1993. The current stable version is 13.1, released on May 24, 2010.
Slackware’s package management system can install, upgrade, and remove packages from local sources, but makes no attempt to track or manage dependencies, relying on the user to ensure that the system has all the supporting system libraries and programs required by the new package. If any of these are missing, there may be no indication until one attempts to use the newly installed software.
The “normal” way to install and maintain software on Slackware is using:
·         installpkg: To install new software, you should previously install the dependencies.
·         upgradepkg: To upgrade an installed package to a new version
·         removepkg: To remove an installed package you do not want.
Another good practice is to download sources and configure, compile and install by yourself, you will be warned about missing dependencies, at the compiling time.
There other tools that really help the new-to-slackware user. These are the ones that are helping me.
·         slackpkg
·         slapt-get
slackpkg
You may have it already installed on your Slackware, but if not you can go to slackpkg project home page, to see how to install and use it.
What I really like about this tool, is its ability to find the package you need to install
For example, if you need the glibc library, you can search for the packages that contains it:
sudo slackpkg file-search glibc
You will something like this:
Looking for glibc in package list. Please wait... DONE
The list below shows the packages that contains "glibc" file.
[ installed ] - glibc-solibs-2.11.1-i486-3
[ installed ] - glibc-zoneinfo-2.11.1-noarch-3
[ installed ] - man-pages-3.24-noarch-1
[ installed ] - glibc-2.11.1-i486-3
[ installed ] - glibc-i18n-2.11.1-i486-3
[ installed ] - glibc-profile-2.11.1-i486-3
[uninstalled] - mutt-1.4.2.3-i486-1
You can search specific packages using "slackpkg search package".
This is very handy, specially if you are compiling your own software from sources.
slapt-get
slapt-get is a command line utility that functions in a similar way to APT. While slapt-get does provide a framework for dependency resolution, it does not provide dependency resolution for packages included within the Slackware distribution. However, several community package sources and Slackware based distributions take advantage of this functionality
This is also a very good package manager, and works more or less likeslackpkg, you may want to read slapt-get FAQ, to better understand it.
There are some other options and package managers for Slackware, none of them as “easy” as apt-get, yum, pacman or even emerge. But that is exactly what makes slackware a good Linux distribution for some applications.

I think is a great option for servers, where you want to have full control of what is running on your server, and do not delegate that task to a package manager.