How to Find Uptime in Windows

Sometimes it’s useful to find out the uptime for a Windows computer. For example, if you are rebooting a whole bunch of Windows computers and you aren’t careful about keeping track of which ones you have just rebooted, you can check the uptime.

In Linux, it’s easy to find out how long a computer has been up and running. You just runtime the good ol’ uptime command. For example:

me@mycomputer:~$ uptime
09:17:32 up 23 days, 19:13,  3 users,  load average: 0.36, 0.54, 0.49

In Windows, it’s almost as easy but not quite as intuitive. Continue reading » How to Find Uptime in Windows




How to Create a Tar File That Excludes Hidden Files and Folders

Today I wanted to create a tar file that excludes hidden files and folders — ones that start with a dot (i.e. ‘.’).

Like a good boy, I read the fine man page (RTFM — sometimes the F is replaced with a ruder word than “fine”) but I couldn’t get it to work after several different variations of the exclude pattern. It seems that the exclude pattern that tar expects doesn’t follow any of the regular expression (a.k.a. regex) syntaxes that I’m familiar with. Someone enlighten me here if you know what it expects.

Anyway, after lots of unsuccessful googling, I finally found a relevant post. Here’s an example of the magical incantation to do this trick (it seems to work in my brief testing using Ubuntu Linux):

tar -cf test.tar foo/ --exclude '.*'

If this tip helped you, please leave me a comment or send me an email!

How to Use sudo tar in a Script Without Password Prompt

If you are rolling your own backup shell script on your Ubuntu Linux box, chances are you might want to use tar or perhaps rsync somewhere in that script. For this example, let’s say you’ve chosen to use tar.

At some point, you will probably want to use cron or some other mechanism to automate your backup. Furthermore, if you want to coordinate the backup of several computers from one central computer, you will probably end up running the backup by making an ssh connection from the central computer to each backup target computer. In that case, the user that is running the backup will probably not be root (unless you allow root logins on your ssh servers) and may therefore have limited privileges.

If that’s the case, the user will not be able to backup some files with tar unless you use sudo tar. The problem with this is that sudo will prompt you for a password. If you want to prevent this prompt so that you can totally automate the backup over ssh, you’ll need to do two things. Continue reading » How to Use sudo tar in a Script Without Password Prompt

Windows DFS Brain Damage

So we just started using Windows’ Distributed File System (or DFS for short). More specifically, we have been using the DFS Namespaces portion of DFS, which basically allows you to have one virtual share point to one or more underlying physical shares on any arbitrary physical server.

In theory, this level of indirection makes maintenance easier because on the client side you can map a drive letter to the virtual share, allowing you to change the physical share behind the scenes without any configuration changes on the client. For example, you could have a virtual share called \\myADDomain\corp\files that is configured to point to the physical share \\myFileServer\files. On the client, you can map a drive letter (e.g. Z:) to \\myADDomain\corp\files. Behind the scenes, that gets translated to \\myFileServer\files when the client uses the drive letter.

Today a user got the following error when logging into his Windows XP Pro machine: “An error occurred while reconnecting Z: to \\myADDomain\corp\files. Microsoft Windows Network: The system cannot find the file specified. The connection has not been restored.” Continue reading » Windows DFS Brain Damage

Page 13 of 24« First...10«1112131415»20...Last »