Linux Scroll

Just another WordPress.com site

Monthly Archives: May 2011

ps

ps – Process Status

To see every process on the system using standard syntax:

$ ps -e

$ ps -ef
$ ps -eF
$ ps -ely
-e = Select all processes. Same as -A.
-f = Full-format listing.
-F = Extra full format.
-l = long format. The -y option is often useful with this.
-y= Do not show flags; show rss in place of addr. This option can only be used with -l.

Grep process PID:

$ ps -ef | grep %username | grep -i %process_name | grep -v grep | awk '{print $2}'

$ ps U %username | grep -i %process_name | grep -v grep | awk '{print $1}'

To print a process tree:

$ ps -ejH

-j = jobs format
-H = show process hierarchy (forest)

Displaying all processes owned by a specific user:

$ ps ux

OR
$ ps U username
-u userlist Select by effective user ID (EUID) or name.
U = processes for specified users

To get info about threads:

$ ps -eLf

$ ps axms
-L = list format codes
-x = processes w/o controlling ttys
-m = threads
-s = processes in the sessions given

To get security info:

$ ps -eo euser,ruser,suser,fuser,f,comm,label

$ ps axZ
$ ps -eM

M,Z = security data

To see every process running as root (real & effective ID) in user format:

$ ps -U root -u root u

Different format:

$ ps -o "%u : %U : %p : %a"

RUSER : USER : PID : COMMAND

Print only the process IDs of syslogd:

$ ps -C syslogd -o pid=

Advertisements

Alias

Create alias for today’s date:

$ vi .bashrc
Add:
alias today='date +"%A, %B %-d, %Y"'
$ today

Setup Android sdk and adb

Setup SDK
Download Android SDK from http://developer.android.com/sdk/index.html
Linux (i386)
android-sdk_r11-linux_x86.tgz

Extract Android SDK to /data.

$ tar –xvzf android –sdk_r11-linux_x86 -C /data/android-sdk

Setup Android SDK to user environment

$ cd
$ vi .bashrc

Add:
export PATH=${PATH}:/data/android-sdk/tools
export PATH=${PATH}:/data/android-sdk/platform-tools

To get platform-tools, you need to follow:
http://developer.android.com/sdk/installing.html
Download Eclipse
Step 3. Installing the ADT Plugin for Eclipse
Step 4. Adding Platforms and Other Components

Fedora install flash player

Install flash player in Fedora:

$ rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm

$ rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
$ yum check-update

32-bit:

$ yum install flash-plugin nspluginwrapper alsa-plugins-pulseaudio libcurl

64-bit:

# yum install flash-plugin nspluginwrapper.x86_64 nspluginwrapper.i686 \

alsa-plugins-pluseaudio.i686 libcurl.i686

Enable linux machine to connect Android phone

If you connect your android phone to linux machine by default, you will get:

$ adb devices
List of devices attached
???????????? no permissions

Turn on “USB Debugging” on your device.
On the device, go to the home screen, press MENU, select Applications > Development, then enable USB debugging.

Create android rule:

$ vi /etc/udev/rules.d/51-android.rules

Add your phone usb vendor ID:

# HTC
SUBSYSTEM=="usb",SYSFS{idVendor}=="0bb4",MODE="0666"
# Samsung
SUBSYSTEM=="usb",SYSFS{idVendor}=="04e8",MODE="0666"

List of Android usb vendor ID:
http://developer.android.com/guide/developing/device.html

Verify adroid phone connected:

$ adb devices
List of devices attached
S58305ce1a513 device

Android set default install location to SD card

Connect your android phone to computer.
List device:

$ adb devices

Set default install location to SD card:

$ adb shell pm setInstallLocation 2

Manual search keyword

Search for the apropos keyword

$ man -k keyword 

Copy CD/DVD to ISO in linux

For CD:

$ dd if=/dev/cdrom of=/path/cd.iso

For DVD:

$ dd if=/dev/dvd of=/path/dvd.iso

Configure GroupWise High Availability (GWHA) in 5 easy steps!

written by Peter van der Walt for http://www.netcb.com

Introduction
Enabling the GWHA component on Linux enables your GroupWise system to automatically restart agents when they stop running for whatever reason. This greatly reduces manual administration and system downtime.

I have been configuring this on all my GroupWise installations on Linux and have only had great experiences with this.

I have found the Novell documentation to be a bit vague, so it took me a day or two to figure out how to actually deploy GWHA – I thus decided to create a article showing how easily it can be deployed, requiring only 5 simple steps!

Steps
Install GroupWise Monitor on one of the GroupWise servers
Install and Configure GW Monitor on one server
Edit the /etc/init.d/grpwise-ma script and uncomment the MA-OPTIONS line.
In the screenshot below, you can see a Sample:

Leave the Username as ‘gwha’, change the password to whatever you want to use, and change the Poll time to how many seconds you want to wait before checking the agents are still running.

On all the GroupWise servers to be monitored:
— check /etc/opt/novell/groupwise/gwha.conf
— run ‘useradd gwha’ to create a local user for GWA to run as
— run ‘passwd gwha’ to set the user’s password to the one used in step 2.
— Yast -> Xinetd -> gwha -> Toggle Status On – to ensure that the GWHA is enabled.

Test that the GWHA daemon is listening (netstat -nl | grep 8400)
Test by killing the agent’s processes and confirm that GWHA restarts the agents

Do a ‘ps -eaf | grep mta’ for example, and kill the MTA’s process using a ‘kill -9 ‘

Do a ‘rcgrpwise status’ to see if the MTA’s status goes “dead” followed by “running” after the GroupWise monitor’s poll time passed, it detected the agent as dead and restarted it.

Conclusion
As simple as that! In 5 easy steps you have configured GroupWise High Availability!

If any of the gwpoa, gwmta, gwinter or gwia processes should stop running – the GroupWise monitor will detect the agent status as Dead and issue the start command through the GWHA daemon – in seconds without any operator intervention!

Show kernel modules are currently loaded

The information displayed from /proc/modules:

$ lsmod

Get more information for driver:

$ modinfo {driver-name}