Merit Can Be Bought, Passion Can't

"Life is too important to be taken seriously"

Sunday, February 19, 2012

"service" is replaced with "systemctl" in fedora 16

sysvinit Commandsystemd CommandNotes
service frobozz start systemctl start frobozz.service Used to start a service (not reboot persistent)
service frobozz stop systemctl stop frobozz.service Used to stop a service (not reboot persistent)
service frobozz restart systemctl restart frobozz.service Used to stop and then start a service
service frobozz reload systemctl reload frobozz.service When supported, reloads the config file without interrupting pending operations.
service frobozz condrestart systemctl condrestart frobozz.service Restarts if the service is already running.
service frobozz status systemctl status frobozz.service Tells whether a service is currently running.
ls /etc/rc.d/init.d/ ls /lib/systemd/system/*.service /etc/systemd/system/*.service
systemctl list-units --all
Used to list the services that can be started or stopped
Used to list all the services and other units
chkconfig frobozz on systemctl enable frobozz.service Turn the service on, for start at next boot, or other trigger.
chkconfig frobozz off systemctl disable frobozz.service Turn the service off for the next reboot, or any other trigger.
chkconfig frobozz systemctl is-enabled frobozz.service Used to check whether a service is configured to start or not in the current environment.
chkconfig frobozz --list ls /etc/systemd/system/*.wants/frobozz.service Used to list what levels this service is configured on or off
chkconfig frobozz --add systemctl daemon-reload Used when you create a new service file or modify any configuration

Friday, February 10, 2012

How to compile libhdfs

gcc sample.c -I${HADOOP_HOME}/src/c++/libhdfs -L${HADOOP_HOME}/c++/Linux-amd64-64/lib -lhdfs -o sample

at your .bashrc


export LD_LIBRARY_PATH=/usr/lib/jvm/java-6-sun/jre/lib/amd64/server:/usr/lib/jvm/java-6-sun/jre/lib/amd64/server/libjvm.so:/usr/local/hadoop/c++/Linux-amd64-64/lib

export CLASSPATH=/usr/local/hadoop/lib:/usr/local/hadoop

Thursday, February 09, 2012

Shared Library

To run a program linked with the shared version of the library the operating system must be able to locate the corresponding .so file at runtime. If the library cannot be found, the following error will occur:

     $ ./a.out      ./a.out: error while loading shared libraries:      libgsl.so.0: cannot open shared object file: No such      file or directory 

To avoid this error, either modify the system dynamic linker configuration1 or define the shell variable LD_LIBRARY_PATH to include the directory where the library is installed.

For example, in the Bourne shell (/bin/sh or /bin/bash), the library search path can be set with the following commands:

     $ LD_LIBRARY_PATH=/usr/local/lib      $ export LD_LIBRARY_PATH      $ ./example 

In the C-shell (/bin/csh or /bin/tcsh) the equivalent command is,

     % setenv LD_LIBRARY_PATH /usr/local/lib 

The standard prompt for the C-shell in the example above is the percent character ‘%’, and should not be typed as part of the command.

To save retyping these commands each session they can be placed in an individual or system-wide login file.

To compile a statically linked version of the program, use the -static flag in gcc,

     $ gcc -static example.o -lgsl -lgslcblas -lm 

Tuesday, February 07, 2012

Dell system won't boot after ubuntu maverick server installation

The system thrown you out to initramfs, saying there is something wrong with root delay. What you need to do is to go to recovery mode, and edit grub.cfg (/boot/grub/grub.cfg). ADD rootdelay=90.

### BEGIN /etc/grub.d/10_linux ### menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {     recordfail     insmod ext2     set root='(hd0,1)'     search --no-floppy --fs-uuid --set c00fadde-f7e8-45e7-a4da-0235c605f756     linux   /boot/vmlinuz-2.6.32-21-generic root=UUID=c00fadde-f7e8-45e7-a4da-0235c605f756 ro rootdelay=90
initrd /boot/initrd.img-2.6.32-21-generic }

Sunday, February 05, 2012

Set Up NTP Server and Client

Setting Up NTP Server

Since servers in the data center is not able to synchronize with any external time server, we have to set up our standalone time server.

192.168.37.183 as Time Server

a. Make sure ntpd server is installed.

sudo apt-get install ntp

b. Since we are not going to synchronize with any external server. Edit /etc/ntp.conf:

# You do need to talk to an NTP server or two (or three).

server 127.127.1.0

fudge 127.127.1.0 stratum 10

c. Permit access for other servers in 192.168.37.0 network to synchronize

restrict 192.168.37.0 mask 255.255.255.0 nomodify notrap

broadcast 192.168.37.255

d. Star the ntp:

sudo service ntp start

At Client

a. Get ntpd server installed.

b. Synchronize to 192.168.37.183

#You do need to talk to an NTP server or two (or three).

server 192.168.37.183 iburst

c. Start the ntp:

sudo service ntp start

d. Command to check the ntp activity:

tail –f /var/log/syslog

ntpq –c lpeer

ntpd –q 192.168.37.183

Wednesday, February 01, 2012

ParaView in Ubuntu

Before launching paraview, do this:
tux@remote:~$ export LIBGL_ALWAYS_INDIRECT=y

Tuesday, January 31, 2012

JAVA PATH

export JAVA_HOME=/usr/lib/jvm/java-6-sun
export PATH=$PATH:/home/ARM/bin:/usr/lib/jvm/java-6-sun/bin

How to know your ubuntu release

cat /etc/lsb-release
uname -r

How To Install Sun Java 6 JDK on Ubuntu

- sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
- sudo apt-get update
- sudo apt-get install sun-java6-jdk
- sudo update-java-alternatives -s java-6-sun

Blog Archive

Little Linus

Loading...