SysAdmin Blog, TechTips and Reviews

An (ex) System Administrator's Blog



Archives Posts

Hire a SysAd

January 11th, 2016 by elizar

fiverrYou can now actually hire a System Administrator on Fiverr as well! Wow, everything you want can be found in Fiverr!.

I was checking out that $5 website of service when I found that there’s this little category called Support IT or IT Support and found this Gig :)

I sent a message to the gig owner and asked if he can draft me a script to extract a variable name from a file with multiple lines of text.

Waiting for his response.

If if will and if it makes sense, i will order the gig! :)
I will be applying and using that script at work.. for Real! :)

Filed under Commands having No Comments »

Archives Posts

How To Switch to Lower or Upper Case in Vi or Vim

January 23rd, 2014 by elizar

for uppercase: gggUG
for lowercase: ggguG

PS: the first 2 g’s are for moving to the beginning of the document.
PS2: works in vim, don’t know about plain vi

Can also do this using the search function in command mode

<esc> :%s/.*/\L&/

and in uppercase :

<esc> :%s/.*/\U&/

Filed under Commands having No Comments »

Archives Posts

Mounting Remote Filesystem To Local Solaris UNIX Box – NFS

March 27th, 2012 by elizar

Quick post on NFS and sharing filesystem from one server to another.

Key files and commands for this activity:

  • /etc/dfs/dfstab
  • share (command)
  • shareall

The only problem I got in following the below instruction is Permission denied on the shared directory/filesystem from the remote Solaris server.

Temporary fix chmod to 777.. check for security later :)

To be able to share a remote filesystem you have to share the remote filesystem.

To share the remote filesystem you need to modify
the /etc/dfs/dfstab file with

share -F nfs -o rw /var/tmp/oracle

also modify the /etc/dfs/sharetab with

/var/tmp/oracle nfs rw

then issue
shareall

make sure nfs daemon are running of the server
you could check by isseing

ps -ef | grep nfs

if it is not running you could start nfsd by issuing /etc/init.d/nfs.server start

svcadm enable nfs

on the client side, that is the side with no disk space
you need to mount the remote filesystem you could do this by issuing

mount (remote server):/usr/local /mount_point

Note:
/var/tmp/oracle will be the filesytem you intend to share eg / /usr/local, /var, /export/home

so if you intend to share /usr/local your /etc/dfs/dfstab will look like

share -F nfs -o rw /usr/local

and /etc/dfs/sharetab will look like

/usr/local nfs rw

Filed under Commands, Solaris 10 having No Comments »

Archives Posts

How Do you Find and Replace Expressions in VI Editor

February 29th, 2012 by elizar

One and for all, let’s do this again.. how do you do the find and replace function of the Vi editor? I keep on coming back to Google for the syntax but at least I know that there is an ‘s’ in the beginning of the command and a ‘g’ at the end (for Global search). :)

Anyway, a little background before i copy paste the information here. I first taught myself how to use Vi during my ‘first’ job as a systems engineer in NEC TNCSi. Actually, my UNix foundation was all from NEC. Not that they train me how to be a unix admin, but I learned and taught myself how to do it. I read books that were lying around there and build samba servers, qmail and email servers and stuff until I got the ropes, the ins and outs of the UNix environment (Actually, I was using Linux – Redhat).

How Do You Find and Replace Text in Vi?

To perform a global search and replace in vi, use the search and replace command in command mode:

:%s/search_string/replacement_string/g

The % is a shortcut that tells vi to search all lines of the file for search_string and change it to replacement_string. The global ( g ) flag at the end of the command tells vi to continue searching for other occurrences of search_string . To confirm each replacement, add the confirm ( c ) flag after the global flag.

For this latest usage, i need to change the shell for all the users who are using /bin/ksh to a safeword sid shell.

remember to use the ‘slash’ character if you are filtering actually backslash.. You do not want to misinterpret the ‘/’ character by vi.

so, that’s

:%s/\/bin\/ksh/\/bin\/sid/g

Filed under Commands, Linux, Solaris, Unix having No Comments »

Archives Posts

KSH Script Basics | Special Shell Variables

April 23rd, 2010 by elizar

Just deleted tons of stale, unsused user accounts. Here are some KSH shell basics and special shell variable. I need to Google them up myself to get reminded that ‘$?’ is the output variable for script execution. That is, it’s 0 for successful execution and 1 if there is any error.

Read the rest of this entry »

Archives Posts

getfacl and setfacl – Unix Access Control (acl) Tool

March 17th, 2010 by elizar

Today’s topic is all about Access List… For Unix and Unix-like system, the usual command to set the file permission is the ‘chmod’ command. However there are instances that we need more flexibility in giving access and control for files and folders. Get it? Access and Control? In this situation, there is a file utility built in Unix called ‘getfacl‘ and ‘setfacl‘.


getfacl
is a file utility for viewing the access control list information associated with a file or directory.

For a memory aid, you can think of ‘getfacl’ as “Get File ACL“.. ACL being Access Control List.

Access control lists are extended attributes added to most major file systems in the 2.6 kernel to improve ability to control the access of files. They allow permissions to be set for individual groups and users and not just the owning user, owning group, and all other users.

setfacl is a command that allows you to set the Access Control List information for a file or directory.

Access control lists are extended attributes added to most major file systems in the 2.6 kernel to improve ability to control the access of files. They allow permissions to be set for individual groups and users and not just the owning user, owning group, and all other users.

You can read man pages for both getfacl and setfacl for more information.

getfacl and setfacl example….

Here’s an example of using the basic funtion of getfacl and setfacl

# getfacl

#setfacl

setfacl -m default:user::rwx,default:group::r-x,default:other:r-x,default:mask:rwx /u06/OneSource/datapump_dbdump

setfacl -m default:user:rcodapp1:r-x,default:group:r-x,default:other:—,default:mas:rwx /u06/OneSouce/datapump_dbdump

Archives Posts

Veritas Volume Manager VxVM Basics Commands Cheats

December 31st, 2009 by elizar

Veritas Volume Manager VxVM Basics Commands Cheats.. The authority site for this topic, the VXVM on VXFS, if you do a Google search for any tutorial or command cheat sheet is Cuddletech.

I want to post… say, borrowing, the content of that page to this post for my own personal reference… Love your own page right? And since I am more likely to open SysadminPH that cuddletech, I thought we not copy the Veritas tutorial page here for my ease of access?

Read the rest of this entry »

Archives Posts

SVM: Determine Free Space on Soft Partition

December 3rd, 2009 by elizar

SVM: Determine Free Space on Soft Partition , we use the metastat -c command…

[root@localhost] /work/users> metastat -c d103
d103 p 32GB d100
d100 m 68GB d101 d102
d101 s 68GB c1t2d0s0
d102 s 68GB c1t3d0s0

[root@localhost] /work/users> metastat -p d103
d103 -p d100 -o 32 -b 58720256 -o 127926432 -b 8388608
d100 -m d101 d102 1
d101 1 1 c1t2d0s0
d102 1 1 c1t3d0s0

So from the first metastat -c d103.. that’s a mirrored 68G partition, d100 and a 32G soft partition d103.. We still have around 35G of space.

update: — someone comment please.. this information is incomplete!

Filed under Commands, Solaris, Tips having No Comments »

Archives Posts

Setting Search $PATH csh

July 1st, 2009 by elizar

Another quikie copy/paste kind of thingy…

You may set your search path automatically each time you log in, by placing the appropriate “set path” command in your “.login” file.

(To learn more about the .login file, type “help dotlogin”.) Here is a sample of a command line that you might put in your .login file to set a non-standard search path:

set path = ( $path /usr/ucb /bin /usr/bin /usr/new .)

Archives Posts

Top equivalent for AIX – Topas, Only Better

June 24th, 2009 by elizar

Top equivalent for AIX – Topas, Only Better… That’s what I searched when I got a ticket from one of the AIX boxes here complaining about CPU being 99% used up.

Of course, you can use vmstat with interval, but for those sysadmin folks who are use to using Top, its still more comfortable using (and seeing) the top output.

Topas is the equivalent of Top for AIX.. it’s better than Top as a matter of fact according to some AIX gurus (and Solaris)

If you persists in using top, You’ll have to build it yourself from the sources at http://www.unixtop.org/ plus probably this fix: 

        http://sourceforge.net/tracker/index.php?func=detail&aid=934590&group_id=72892&atid=536044

Good luck!

 

« Previous Entries

I was here...