SysAdmin Blog, TechTips and Reviews

An (ex) System Administrator's Blog



Archives Posts

Useful commands to extract packages

May 18th, 2012 by elizar

Useful commands to extract packages:

To extract a *.tar file: tar xvf package.tar
To extract a *.cpio.Z file: zcat package.cpio.Z | cpio -idmV
To extract a *.gz file:  gunzip package.gz
To extract *.tar.gz file: guznip package.tar.gz; tar xvf package.tar
To extract *.dstream.Z file: uncompress package.dstream.Z; pkgtrans package.dstream . all
To extract *.zip file: unzip package.zip

yeah sure, citi’g gonna give me a memo for this

Filed under Uncategorized having 4 Comments »

Archives Posts

java script mouse click change image – saving for future use

February 13th, 2012 by elizar

I want this to be added on my Make money online blog later

Filed under Uncategorized having No Comments »

Archives Posts

Disable / Turn Off Linux Password expiration / Aging

December 15th, 2011 by elizar

Yep, another personal reference and to think that I should know these stuff by heard. Well, most of the servers I am handling now are solaris and for particular example, it’s for Linux..

I guess there will be some similarities but for this post, we’ll take Redhat linux as an example:

The command is chage (looks like a misspelled ‘change’ right? It’s actually “Change” “Age”)

/etc/shadow stores actual password in encrypted format for user’s account with additional properties related to user password.

The password expiration information for a user is contained in the last 6 fields. Password expiration for a select user can be disabled by editing the /etc/shadow file

However I recommend using chage command. The chage command changes the number of days between password changes and the date of the last password change. This information is used by the system to determine when a user must change his/her password.

To list current aging type chage command as follows:

# chage -l rg49945
Minimum: 0
Maximum: 99999
Warning: 7
Inactive: -1
Last Change: Jun 07, 2011
Password Expires: Never
Password Inactive: Never
Account Expires: Never
#
# chage -l ct92623
Minimum: 0
Maximum: 99999
Warning: 7
Inactive: -1
Last Change: Jun 07, 2011
Password Expires: Never
Password Inactive: Never
Account Expires: Never
#
# passwd rg49945
Changing password for user rg49945.
New password:
Re-enter new password:
Password changed.
passwd: all authentication tokens updated successfully.
#
# passwd ct92623
Changing password for user ct92623.
New password:
Re-enter new password:
Password changed.
passwd: all authentication tokens updated successfully.

Filed under Uncategorized having No Comments »

Archives Posts

ufsdump – How To Backup Solaris/Linux Root Filesystem

October 11th, 2011 by elizar

Alright, here’s how – usfsdump – How To Backup Solaris/Linux Root Filesystem. use ufsdump

Say for example you have this:

$ df -k /
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t0d0s0 673951 415497 197799 68% /
$ df -k /CMS
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t8d0s0 35009161 32305691 2353379 94% /CMS
$

yeah, the /CMS file system is almost full, but I think it can still accomodate a 674MB root filesystem from the slice /dev/dsk/c0t0d0s0, right?

Anyway, not sure if the 2GM limit is applicable to Solaris 8,9 or 10 but since this example is less than 1GB, we are ok to proceed.

myserver# cd /CMS
myserver# ufsdump -f dumpfile /dev/dsk/c0t0d0s0
DUMP: Date of this level 0 dump: Tue Jul 20 16:41:50 2004
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/rdsk/c0t0d0s0 (myserver:/) to dumpfile.
DUMP: Mapping (Pass I) [regular files]
DUMP: Mapping (Pass II) [directories]
DUMP: Writing 32 Kilobyte records
DUMP: Estimated 366 blocks (183KB).
DUMP: Dumping (Pass III) [directories]
DUMP: Dumping (Pass IV) [regular files]
DUMP: 318 blocks (159KB) on 1 volume at 963 KB/sec
DUMP: DUMP IS DONE
krypton# ls -l
total 340
-rw——- 1 root other 163840 Jul 20 16:41 dumpfile
-rw-r–r– 1 haefnr2 instrume 11 Jul 20 16:38 test1
-rw-r–r– 1 haefnr2 instrume 21 Jul 20 16:38 test2
krypton# file dumpfile
dumpfile: ufsdump archive file

ufsrestore should do the trick in recovering the system.. hopefully

Filed under Uncategorized having No Comments »

Archives Posts

How To Restore Root (and /usr/) rfile system Solaris- restoresymtable –

January 28th, 2011 by elizar

Sun Solaris – Restoring root file system (/) – Solaris 9, Solaris 10 provides steps we need to follow to restore the root file system (/ system) in SPARC and x86 (intel) machines.
1) Log in as root user. It is a security practice to login as normal user and perform an su to take root user (super user) role.
2) Appearance of # prompt is an indication that the user is root
3) Use who -a command to get information about current user
4) When / (root filesystem) is lost because of disk failure. In this case we boot from CD or from the network.
5) Add a new system disk to the system on which we want to restore the root (/) file system
6) Create a file system using the command :
newfs /dev/rdsk/partitionname
7) Check the new file system with teh fsck command :
fsck /dev/rdsk/partitionname
8) Mount the filesystem on a temporary mount point :
mount /dev/dsk/devicename /mnt
9) Change to the mount directory :
cd /mnt
10) Write protect the tape so that we can’t accidentally overwrite it. This is an optional but important step
11) Restore the root file system (/) by loading the first volume of the appropriate dump level tape into the tape drive. The appropriate dump level is the lowest dump level of all the tapes that need to be restored. Use the following command :
ufsrestore -rf /dev/rmt/n
12) Remove the tape and repeat the step 11 if there is more than one tape for the same level
13) Repeat teh step 11 and 12 with next ddump levels. Always begin with the lowest dump level and use highest ump level tape
14) Verify that file system has been restored :
la
15) Delete the restoresymtable file which is created and used by the ufsrestore utility :
rm restoresymtable
16) Change to the root directory (/) and unmount the newly restored file system
cd /
umount /mnt
17) Check the newly restored file system for consistency :
fsck /dev/rdsk/devicename
18) Create the boot blocks to restore the root file system :
installboot /usr/platform/sun4u/lib/fs/ufs/bootblk /dev/rdsk/devicename — SPARC system
installboot /usr/platform/`uname -i`/lib/fs/ufs/pboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/devicename — x86 system
19) Remove teh last backup tape, and insert a new tape onto which we can write. Make a dump level 0 backup of the newly restored system by issuing the following command :
ufsdump 0ucf /dev/rmt/n /dev/rdsk/deviceName
This step is needed because ufsrestore repositions the files and changes the inode allocations – the old backup will not truly represent the newly restored file system
20) Reboot the system :
#reboot (or)
# init 6
System gets rebooted and newly restored file systems are ready to be used.

Filed under Uncategorized having No Comments »

Archives Posts

Solutions for Solaris SVM Needs Maintenance and Last Erred status

September 24th, 2010 by elizar

This post is because while patching a Solaris 10 server with patch level Generic_142900-02 to Generic_142900-13.. There’s a need maintenance error on one of the sub mirror:

When a slice in a mirror or RAID5 metadevice device experiences errors,
DiskSuite puts the slice in the “Maintenance” state. No further reads or
writes are performed to a slice in the “Maintenance” state. Subsequent
errors on other slices in the same metadevice are handled differently,
depending on the type of the metadevice.

A mirror may be able to tolerate many slices in the “Maintenance” state and still be read from and written to. A RAID5 metadevice, by definition, can only tolerate a single slice in the “Maintenance” state. When either a mirror or RAID5 metadevice has a slice in the “Last Erred” state, I/O is still attempted to the slice marked “Last Erred”. This is because a “Last Erred” slice contains the last good copy of data from DiskSuite’s point of view.

Read the rest of this entry »

Filed under Uncategorized having No Comments »

Archives Posts

Cannot find required executable /usr/bin/7za

March 24th, 2010 by elizar

The complete error actually is:

Cannot find required executable /usr/bin/7za
pkgadd: ERROR: class action script din not complete successfully

That was the error message displaced when I tried installing two Sun packages as requested by a user, SUNWeu8os and SUNWeulof.

Packages can be found in tge Solaris 10 disk release 5/08. When i tried installing the package I got the error above.

There are two ways you can get that binary and one of them is by using the installation disk of Solaris 10 5/08.

Another one is by installing patch 137321-01 for sparc and 137322-01 for x86

Filed under Uncategorized having No Comments »

Archives Posts

Limesurvey PHPSurveyor

February 24th, 2010 by elizar

LimeSurvey (formerly PHPSurveyor) is a Webapplication that interacts with MySQL, MSSQL, orPostgres to develop surveys, publish surveys, andcollect responses to surveys.

Once a survey has been created, data can be inserted into the survey either by a “pretty” public screen which presents each question one at a time, or by a quick and nasty data entry screen. It includes the capacity to generate individualized “tokens”, so that invitation can be issued to participants. It also has the capacity to set conditions on whether questions will display (branching), numerous question types, and a basic statistics function. Changes: A Malay translation was added, several minor bugs were fixed, and translations were updated.

Filed under Uncategorized having No Comments »

Archives Posts

ZFS Quotas and Reservations

October 29th, 2009 by elizar

Notes on ZFS quotas, reservations and others.. like adding up disk for the pool and creating pool altogether.

First, create a pool using ‘zpool‘. Then use ‘zfs‘ to make the filesystems.

Creating Pool with zpool

Create a pool called pool1. The -m is optional. If given, it specifies a mount point for zfs filesystems created from the specified pool. The mount point should be empty or nonexistant. If the -m argument is omitted, mount point is “/”.

Read the rest of this entry »

Filed under Uncategorized having No Comments »

Archives Posts

ld.so.1: cc: fatal: libpicl.so.1: open failed: No such file or directory

September 17th, 2009 by elizar

ld.so.1: cc: fatal: libpicl.so.1: open failed: No such file or directory – that’s the latest problem we encountered in installing Ruby on Rails… (well, not actually on Ruby but in some dependencies)…

Last time we did the GlassFish webstack installation (just to get RoR working) because the Ruby in Coolstack was an old version Ruby 1.8.6 something.

But as far as Ruby on Rails installation is concern, the Optimized Open Source Software Stack (Cool Stack) is working properly.. As well as the Glassfish installation.. The problem we’re getting is for some Gems that we’re trying to install (oracle gems and hobo and others)…

For this one, we’re trying to install the Oracle gem thing.. and it requires to compile something that needs CC.. we ended up installing Sun Studio 12.. (but I still believe gcc is a perfect alternative for cc).

Anyway, searching for “ld.so.1: cc: fatal: libpicl.so.1: open failed: No such file or directory” will give you unrelated websites (well, until this one gets indexed that is)..

As of this writing it only has 4 results:

What I did is i downloaded a Sun patch that contains the file and placed in my server same location:

Take this patch for example:
http://sunsolve.sun.com/search/document.do?assetkey=1-21-108528-29-1

libpicl.so.1 installs in /usr/lib/abi/abi_libpicl.so.1 , /usr/lib/abi/sparcv9/abi_libpicl.so.1, /usr/lib/libpicl.so.1

and others

Filed under Uncategorized having No Comments »

« Previous Entries

I was here...