SysAdmin Blog, TechTips and Reviews

An (ex) System Administrator's Blog



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 »

How to Reset a WordPress Password

January 2nd, 2016 by elizar

There are a number of ways to reset a WordPress admin password if you happen to forget it.

For this post, let me share you a way to reset it using the CPANEL and updating the record in the wp_users table in your wordpress database.

You will be using myPHpadmin of course.

Read the rest of this entry »

Filed under Wordpress having No Comments »

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 »

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 »

How To Detach Mirror in Solaris – Script

April 13th, 2012 by elizar

How to detach mirror disks in Solaris? Assuming we us SVM, we normally do this like this, manually:

metastat -c d0 (verify disk components)
eeprom bood-device (further verify the boot disk)
synch;
metadetach rootdev detachdevice

or put it a script for repetitive use and to avoice typo mistakes:


cat detach_mirror.ksh
#!/bin/ksh

rootdev=`df -k /|tail -1|awk '{print $1}'|cut -d"/" -f5`
bootdisk=`eeprom boot-device|cut -d"=" -f2|awk '{print $1}'`

if [[ $bootdisk = "disk" || $bootdisk = "disk0" ]]; then
detachdev=`metastat -p $rootdev|tail -2|grep -v "t0d0"|awk '{print $1}'`
elif [[ $bootdisk = "disk1" ]]; then
detachdev=`metastat -p $rootdev|tail -2|grep -v "t1d0"|awk '{print $1}'`
elif [[ $bootdisk = "disk2" ]]; then
detachdev=`metastat -p $rootdev|tail -2|grep -v "t2d0"|awk '{print $1}'`
else
echo "Unknown disk to detach"
exit
fi

echo "boot-disk is $bootdisk"
echo "root device is $rootdev"
echo "\nmetastat -p $rootdev"
metastat -p $rootdev

echo "\ncommands:"
echo "sync; metadetach $rootdev $detachdev"
echo "sleep 10"

detachdiskname=`metastat -p $detachdev|awk '{print $NF}'`
echo "mkdir /a"
echo "mount /dev/dsk/$detachdiskname /a"
echo "cp -p /a/etc/vfstab /a/etc/vfstab.md"

#echo awk '$1=="/dev/md/dsk/'$rootdev'" {print "/dev/dsk/'$detachdiskname'\t/dev/rdsk/'$detachdiskname'\t"$3"\t"$4"\t"$5"\t"$6"\t"$7; next} {print}' /etc/vfstab
echo "awk '\$1==\"/dev/md/dsk/$rootdev\" {print \"/dev/dsk/$detachdiskname\\\t/dev/rdsk/$detachdiskname\\\t\"\$3\"\\\t\"\$4\"\\\t\"\$5\"\\\t\"\$6\"\\\t\"\$7; next} {print}' /etc/vfstab" \> /a/etc/vfstab
echo "egrep -v \"rootdev.*md|MDD root info\" /etc/system > /a/etc/system"

echo "\ncd /"
echo "umount /a"
echo "rmdir /a"

Filed under Script, Solaris having No Comments »

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 »

NGINX 1.1.16 – Next Powerful Web Server since Apache?

March 5th, 2012 by elizar

When we say open source web server, I immediately associate myself with the Apache Project. Honestly, I dont even think of anything else but apache.. Heck, when you say Web Server, its almost synonymous to Apache if you’ve been eating and breathing Unix.

Today I found out about NGINX which is apparently a good web server in it self and currently in its 1.1.16 version and still being developed.

Igor Sysoev, the developer of NGINX has released version 1.1.16 of his web server software. The project aims to provide a stable, high performance alternative to more traditional competitors such as Apache HTTP Server or Microsoft’s IIS (Internet Information Services).

The new development version comes with features such as a “from” parameter for the “disable_symlinks” directive, an increased limit for simultaneous subrequests and the ability to return 307 redirection messages. Bugs fixed include segmentation faults and build problems.

More details on this release can be found in the change log. The software is available to download for Windows and Linux (RHEL, CentOS, Ubuntu, Debian), and source code is made available under a 2-clause BSD licence.

Filed under Apache, Tools having 1 Comment »

Open Source Video Audio Decoder Encoder Transcoder – HandBreak 0.9

March 2nd, 2012 by elizar

Currently I am using a commercial software for doing all my video (audio) requirements for editing and publishing video and audio content on my websites and all over the internet. What I am using is Camtasia version 7. There is also a free one called Camstudio but it feels limiting in my personal opinion.

For this one, another open source video and audio transcoder that you and myself may want to try out. It is called “HandBreak“.

Check out the milestone/change log for HandBreak.

The HandBrake developers have released version 0.9.6 of the open source, cross-platform video transcoder software. The new version brings many improvements to the video and audio libraries used for both decoding and encoding.

Aside from those library updates and bug fixes, HandBrake 0.9.6 adds support for Blu-ray audio decoding and video encoding to MPEG-2. Other changes on Windows include a redesigned preview window and the dropping of QuickTime support, while on Linux there is a new advanced audio options section with gain, audio track names, compression and sample rate. The option to set a target size for HandBrake output has been removed and, according to the developers “isn’t coming back – Don’t bother complaining on the forums”.

On Mac OS X, DVD decryption with VLC 2.0 no longer works, as HandBrake can no longer rely on VLC for circumventing the CSS copy protection. The developers say that libdvdcss is the preferred method for decrypting DVDs and users should install a separate package to enable it.

A detailed change log can be found on the HandBrake site. The software is available for download on Windows, Mac OS X and Linux (Ubuntu and Fedora) and is licensed under the GPLv2.

Filed under Open Source having No Comments »

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 »

Gnome 3.4 Beta 1 – What’s Up?

February 27th, 2012 by elizar

I could not remember the first time I ever used the first ever desktop environment in the Linux OS.

Back in the pre- Fedora dys when Redhat was still freely available, two well known desktop available to linus was the K Desktop and Gnome.

I am in love with Gnome then and I beilive ot is still the one i prefer today, even though I an no longer active in the Linux community.. Solaris grab all my attention.

Now, Gnome 3.4 Beta 1 is almost out…

The GNOME 3.4 Beta 1 release is ready for testing and it brings updates to main components, such as GNOME Contacts, GNOME Control Center, GNOME Desktop, GNOME Disk Utility, GNOME Panel, GNOME Screensaver, GNOME Session, GNOME Settings Daemon, GNOME Shell, GNOME System Monitor, GNOME Themes Standard, Mousetweaks, and GNOME User Docs.
Moreover, the following apps were updated: NetworkManager (including network-manager-applet), Baobab, Empathy, Evince, Yelp, Nautilus, and Eye of GNOME.

The GNOME 3.4 Beta 1 release is ready for testing and it brings updates to main components, such as GNOME Contacts, GNOME Control Center, GNOME Desktop, GNOME Disk Utility, GNOME Panel, GNOME Screensaver, GNOME Session, GNOME Settings Daemon, GNOME Shell, GNOME System Monitor, GNOME Themes Standard, Mousetweaks, and GNOME User Docs.

Moreover, the following apps were updated: NetworkManager (including network-manager-applet), Baobab, Empathy, Evince, Yelp, Nautilus, and Eye of GNOME.

Last but not least, here are the core libraries that were updated in GNOME 3.4 Beta 1: at-spi2-atk, at-spi2-core, clutter, clutter-gst, cogl, folks, glib, glibmm, gmime, gstreamer, gtk+, gtksourceview, libcroco, libgee, libgnomekbd, libsoup, mutter, and pygobject.

The GNOME 3.4 development cycle will continue with a second Beta release on March 7th and the GNOME 3.4 Release Candidate version on March 21st.

The final release of GNOME 3.4 will be available on March 28th, 2012, followed by the first point release on April 18th, GNOME 3.4.1.

Filed under Linux having No Comments »

« Previous Entries

I was here...