Friday, July 02, 2010

Use Redirect Symbol to Zero File

I have mentioned this topic in an earlier post - zero'ing logfiles with cat /dev/null > logfile. But there is another easy way to zero a logfile in Bourne or Korn shell. It probably works in Bash and Zsh, too. I have to check. Here is an example below.

Note: I used the gts to represent the "greater than" or redirect symbol because blogger complained about using that particular character. Update: themadengineer reminded me on the use of "greater than" html syntax. Thanks.

Bourne Shell at the command prompt
# > mylogfile

or

Korn Shell at the command prompt
# > mylogfile

Monday, June 28, 2010

Run the Windows Explorer GUI

Here are a few easy ways to invoke the Windows Explorer GUI, which displays certain parts of the directory/folder tree depending on given syntax. I also threw in a few other miscellaneous items.


1. Select Run
Then type "."
This action will invoke the C:\Documents and Settings\mysysad


2. Select Run
Then type ".."
This action will invoke a window that displays C:\Documents and Settings


3. Select Run
Then type "..."
This action will invoke a window that displays My Computer


Other misc Run exercises


Select Run
Type "explorer" - same as Type "My Documents"
Type "explorer c:"
Type "explorer desktop"
Type "explorer ."
Type "explorer .."


Select Run
Type "control panel"

Select Run
Type "recent"


Select Run
Type "calc"


Select Run
Type "notepad"


Select Run
Type "wordpad"


Select Run
Type "ping MySysAdDOTCOM"


Select Run
Type "c:" or "d:" or "a:"


Select Run
Type "freecell"
Type "sol"
Type "mshearts"
Type "spider"
Type "winmine"


Select Run
Type "mspaint"


Select Run
Type "nslookup"


Select Run
Type "cmd"

Thursday, May 06, 2010

Retrieve Information on LDAP User

Here are a couple easy methods to get information from ldap for a particular user. Friend and I were talking about it yesterday because we had a typo in someone's login directory string (missing a character). He showed me a fancy one-liner but all I needed was a username, login directory, and its corresponding UID.

# ldaplist -l password username

# getent passwd username

# logins -x | grep username

The getent command is also handy to retrieve host and group information. It consults what databases are listed in the /etc/nsswitch.conf file.

# getent hosts hostname
# getent group 100

Tuesday, April 27, 2010

$HOME/.TTauthority not writable, auth entry not added

After being absent from the work site for an extended period, I had a little problem with the dt session. I was being blocked a dt session (automatically logged me out--tried 3x). I observed Tooltalk/dt session errors on the screen.

But I also observed others logging into the same box without incident. Intuitively, I suspected something was wrong with my environment, so I logged in via a remote terminal. Once in the box, I reviewed the /var/adm/messages file and noticed /usr/dt/bin/ttsession errors were associated with my username. The messages file also contained this telling message - $HOME/.TTauthority not writable, auth entry not added.

Hmmm…ownership was not mine. I changed the ownership to yours truly and everything worked like a champ.

Wednesday, March 03, 2010

Microsoft Security Advisory --- F1 Key on Web

A friend of mine from Japan emailed me this interesting article and thought I would share it.

Microsoft has issued a security advisory warning users NOT to press the F1 key when prompted by a website. This vulnerability could allow a hacker to hijack a computer. This vulnerability affects all versions of Internet Explorer on computers running Windows 2000 and Windows XP operating systems. More information can be found at


DO NOT press the F1 key if prompted by a website. Doing so could allow a hacker to hijack your computer!

Saturday, February 27, 2010

Import and Enable the NFS Service

Last week we had a little issue with mounting directories from a new Solaris 10 server. It was noted the nfs service was not running on it. We had to import and then enable the service. After that, we were able to mount the required directories from the server.


# svcs -a | grep nfs
# cd /var/svc/manifest/network
# svccfg -v import nfs/server.xml
# svcadm enable nfs/server

or

# svccfg -v import /var/svc/manifest/network/nfs/server.xml
# svcadm enable nfs/server

If you want to disable and delete a service, see below.

# svcadm disable network/nfs/server
# svccfg delete network/nfs/server

Monday, November 23, 2009

Issues With an Orphaned .attribute^ File

We had intriguing problem related to a Unix-based directory. This directory was mapped to Windows via Citrix.

On the Windows side, the initial thought was that the folder was simply "hidden" via the attributes, which would be normal. However, the attributes for the folder didn't show the hidden option selected.

Recently, we performed an account migration activity on the Unix side. The culprit turn out to be an orphaned .attribute^ file on the Unix side. Apparently, this file's username and group was deleted prior to migration, and its state unexpectedly caused the directory's contents to be invisible to Windows-based viewers.

At any rate, we finally noticed the file with the ls -al command. The .attribute^ file was removed from the Unix side and viewing was back to normal on the Windows side.

Friday, October 23, 2009

ftpconfig - Setup Anonymous FTP

To setup an anonymous FTP account, you might consider using the ftpconfig script. It seems to be a lot easier to setup an anon FTP account with Solaris 10 than it was for Solaris 8. The anon users log in and then they are given restricted access to a mini-root filesystem.

Here is the syntax.

# ftpconfig someftpdir
or
# ftpconfig -d someftpdir

If you have problems, you may have to check files in the /etc/ftpd directory. Hint: check the ftpaccess file

Friday, September 18, 2009

No Space Left on Device!

About two weeks ago, my colleague and I had an issue with the /var partition on a seldom used Sun Blade 2500 workstation. Frankly speaking, I thought a simple fsck would suffice while in single user mode. Not quite. Anyway, we executed fsck on the partition and it "fixed" whatever errors reported. And while in single user mode, we wrote test files to the partition without incident. However, once we booted to init 3 run level, we still could not write to the /var partition, not even as root. That was a bit strange because df -k reported only 20% of the partition was used. hmmm...inode problem?? Then we looked through the logs and noticed a message about not having enough space on the device – in short, we ran out of inodes. Almost immediately, we suspected a problem with mail. We checked the mqueue directory and it contained almost a 1,000,000 small extraneous/useless messages from cron. We deleted most of them (after a few hours) and it resolved the issue. And yes, we got a handle on the cron that was generating those messages.

Friday, July 10, 2009

Troubleshooting Domain Issues with My SysAd Blog - Again

Late last night (KST), I was reviewing my free MyBlogLog stats and noticed 8 visitors had stopped by the blog. Usually, by that time, mysysad would have had several hundred visits. I surfed over to the domain and verified it was down (this blog is hosted on the blogger.com platform and it is pointing to a custom domain). However, the blog was working with the old address, http://esofthub.blogspot.com

I pinged the old IP address - no answer. Then I pinged ghs.google.com, and it responded with a different IP address. I used that new address to update my A-Records with my domain registrar -- yahoo.

After 20-30 minutes of propagation, the mysysad.com domain was back online.

By the way, I just pinged the old address twice...no response. Update: 7 hours later - pinged again - no answer

Here is another post I wrote a few months ago about a similar issue...