Sunday, January 1, 2012

Package Management


Debian based systems (including Ubuntu) uses apt-* commands for managing packages from the command line. Let us review how to use apt-* commands to view, install, remove, or upgrade packages.
APT is acronym for Advanced Package Tool. It supports installing packages over internet (ftp or http). You can also upgrade all packages in single operations, which makes it even more attractive.
Dpkg is Debian packaging tool which can be use to install, query, uninstall packages.

You can also try GUI based or high level interface to the Debian GNU/Linux package system. Such as:
1) aptitude: It is a text-based interface to the Debian GNU/Linux package system.
2) synaptic: GUI front end for APT
Rpm based Linux package names generally end in .rpm similarly Debian package names end in .deb, for example: apache_2.2.14_i386.deb
Install software using apt
$ apt-get install {package-name}
$ apt-get install php
Remove software using apt
$ apt-get remove {package-name}
$ apt-get remove php
Remove/erase package and configuration file
$ apt-get –purge remove {package-name}
$ apt-get –purge remove php
Updating the list of packages in your sources.list
$ apt-get update
Update software using apt
$ apt-get -u upgrade
$ apt-get upgrade php
To change the list of apt mirrors
$ apt-setup
Search for package
$ apt-cache search package
show all installed and removed packages
$ dpkg -l
show install status of package
$ dpkg -l apache
Verify if package sudo is install or not
$ dpkg -l | grep -i ‘apache’
List packages related to the apache:
$ dpkg -l ‘*apache*

List files owned by the installed package

# dpkg -L apache
What package owns the file
$ dpkg -S {/path/to/file}
$ dpkg -S /bin/netstat
show status of package
$ dpkg -s {package-name}
$ dpkg -s php
show details of package
$ dpkg -p php
list relevant packages
$ apt-cache search “network security”
Find out all denyhosts packages
$ apt-cache search denyhosts
install package from a deb file
$ dpkg -i {filename}.deb
purge package
$ dpkg -P php
re-run the configure for a package
$ dpkg-reconfigure php
get the source
$ apt-get source php
config build-deps for source and install as needed
$ apt-get build-dep
install package from specific release
$ apt-get -t {release} install php
prevent name from running at bootup
$ update-rc.d -f {name} remove
upgrade the distribution
$ apt-get –u dist-upgrade
How to know what packages may be upgraded
apt-show-versions is a program that shows what packages in the system may be updated and several useful information.

Saturday, December 31, 2011

Something about 'chkconfig'


chkconfig provides a simple command-line tool for maintaining the /etc/rc.d directory hierarchy by relieving system administrators of the task of directly manipulating the numerous symbolic links in those directories. Normally chkconfig will be found on Redhat Linux, Fedora and CentOS.
Chkconfig has five distinct functions which is adding new services for management, removing services from management, listing the current startup information for services, changing the startup information for services, and checking the startup state of a particular service.

Below are those examples explains how to use the chkconfig command:
1. View Current Status of Startup Services
The –list option displays all the services with the current startup configuration status.
# chkconfig --list (this will list down all services)
# chkconfig --list | grep network (this will list a service, in above example which is network service only)
2. Add a new Service to the Startup
Use –add option to add a specific service to the list of services that will be started during system reboot.

The following example shows how to add a new service.
# chkconfig --add iptables
# chkconfig --list | grep iptables (to view the new added service)
iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off (output)
3. Remove a Service From Startup List
The following example shows that ip6tables services is configured for startup.
To remove it from the startup list, use the –del option as shown below.
# chkconfig --del ip6tables
# chkconfig --list | grep ip6tables (to check removed service)
4. Turn-on or Turn-off a Service
The following example will turn off ip6tables service
# chkconfig ip6tables off
# chkconfig –level 35 ip6tables off (turn off ip6tables for both level 3 and 5)
       
        chkconfig -t|--terse [names]
       chkconfig -s|--set [name state]
       chkconfig -e|--edit [names]
       chkconfig -c|--check name [state]
       chkconfig -l|--list [--deps] [names]
       chkconfig -A|--allservices
       chkconfig -a|--add [names]
       chkconfig -d|--del [names]

Sunday, December 18, 2011

Go programming language


Do we really need another programming language? There is certainly no shortage of choices already. Between imperative languages, functional languages, object-oriented languages, dynamic languages, compiled languages, interpreted languages, and scripting languages, no developer could ever learn all of the options available today.
And yet, new languages emerge with surprising frequency. Some are designed by students or hobbyists as personal projects. Others are the products of large IT vendors. Even small and midsize companies are getting in on the action, creating languages to serve the needs of their industries. Why do people keep reinventing the wheel?
The answer is that, as powerful and versatile as the current crop of languages may be, no single syntax is ideally suited for every purpose. What's more, programming itself is constantly evolving. The rise of multicore CPUs, cloud computing, mobility, and distributed architectures have created new challenges for developers. Adding support for the latest features, paradigms, and patterns to existing languages can be difficult. Sometimes the best answer is to start from scratch.

Google has announced the launch of a new -open source- programming language which is built on C programming language and other more languages like Python.

This new language combines the speed of development from Python and the performance and security in C and C++. It has been mentioned that Go is a powerful programming language and it is suitable for systems with multiple processors due to its quick implementation of the instructions and its compatibility with PCs and servers at the same time as well as its simplicity. The official site mentioned that Go concurrency mechanisms "make it easy to write programs that get the most out of multicore and networked machines, while its novel type system enables flexible and modular program construction."

Learn Android.... free resources... on net

Android popularity has been increased and as a result, there are now many great resources for learning android developing available for free. I list some of them....

1-    Android Bootcamp Training Course ( 5 days), now free online:http://marakana.com/techtv/android_bootcamp_screencast_series.html
2-    Developing Android Applications ( from Oreilly) 3 workshops :http://training.oreilly.com/androidapps/
3-    Learn Android from Xtensivearts , 11 Episodes:http://www.xtensivearts.com/topics/tutorials/