How To – Sovle Tar: Removing Leading ‘/’ from member names

Background Knowledge


When working with “tar” one may come across the message of “tar: Removing leading ‘/’ from member names” while using tar. I wondered why this was happening and how I could stop it. I will first start off by explaining why this is happening and then some possible solutions that one may consider taking.

Why “tar: Removing leading ‘/’ from member names”?

Continue reading

How To – Clear/Disable/Edit Auto-Complete Email Suggestions in Outlook 2010

Background Knowledge


Every time one types an email address or name in the message window fields of “To”, “Cc” and “Bcc” of Microsoft Outlook 2003/2007/2010, a list will appear offering suggestions of users and email addresses that one can choose from to save on typing. This feature is known as “Auto-Complete” and Outlook automatically builds the list of suggestions according to the a given users activity and saves it into a file with a “NK2″ extension.

The “Auto-Complete” suggestions can be cleared, edited, or disabled by using one of the follow solutions below.

Solution – Clear Auto-Complete Suggestions


  1. Open Outlook.
  2. Click on the menu “File” -> “Options”.
  3. Click on “Mail” at the top left side of the “Outlook Options” dialog.
  4. Then scroll down to where you see a heading of “Send messages”.
  5. Click on “Empty Auto-Complete List”.
  6. Click on the “OK” button.

Solution – Edit Auto-Complete Suggestions


Please follow the instructions and information provided at the author’s web site when using NirSoft’s NK2Edit.

NirSoft NK2Edit

Solution – Disable Auto-Complete Suggestions


  1. Open Outlook.
  2. Click on the menu “File” -> “Options”.
  3. Click on “Mail” at the top left side of the “Outlook Options” dialog.
  4. Then scroll down to where you see a heading of “Send messages”.
  5. Uncheck “Use Auto-Complete List to suggest names when typing in the To, Cc and Bcc lines”.
  6. Click on the “OK” button.

How To – Resolve “The specified file is not a registry script”

Background Knowledge


I will explain how to resolve the following error message when trying to merge/import a Windows registry file.

“Cannot import C:\foobar.reg. The specified file is not a registry script. You can only import binary registry files from within the registry editor.”

Solution


  1. Open the registry file in a text editor.
  2. Change the encoding to “ANSI”.
  3. Save the file.

Note: If you are not aware how to change the encoding, the simplest solution is to open the registry file within Microsoft Windows’ Notepad and then save it.

Source: “The specified file is not a registry script” – How encoding can ruin your morning

Rhythmbox Startup Script

Background Knowledge


I will explain how to create a script that will run Rhythmbox Music Player at startup, enqueue a playlist and then begin playing.

Note: I have only verified this method to work on Ubuntu v10.04.

Solution


  1. Using your favorite text editor copy and paste the following code below.
  2. You may need to replace “–play” with “–play-pause” depending your environment.
  3. Replace the following “/home/foo/playlist.pls” to where the playlist is saved (previously created).
  4. Save the script to a safe location such as a user directory (e.g. /home/foo/.rhythmbox-startup.sh).
  5. Using the “Terminal” under “Applications -> “Accessories” type the following without double quotes, “sudo chmod +x /home/foo/.rhythmbox-startup.sh” to grant the file execute permissions.
  6. Close the “Terminal”.
  7. Go to the menu “System” -> “Preferences” -> “Startup Applications” and then click on “Add”.
  8. Enter the following into the corresponding dialog fields without double quotes, Name: “Rhythmbox”, Command: “/home/foo/.rhythmbox-startup.sh” and Comment: “Runs Rhythmbox with a playlist”.
  9. Click “Add” and then “Close” buttons.
1
2
3
4
5
6
#!/bin/bash
sleep 10 &&
rhythmbox-client --hide &&
sleep 5 &&
rhythmbox-client --enqueue /home/foo/playlist.pls &&
rhythmbox-client --play

Source: Rhythmbox Startup Script for Ubuntu
Source: Rhythmbox – Community Ubuntu Documentation

How To – Convert MSSQL Timestamp/Datetime to Unix Timestamp

Background Knowledge


I will explain how to convert a DATETIME (data type) value in Microsoft SQL Server to Unix timestamp and how to convert Unix timestamp to DATETIME. A Unix timestamp is a integer value of seconds since January 1, 1970 at midnight. For further explanation of Unix timestamps refer to Wikiepedia, UnixTimestamp.com or http://unixtimesta.mp/.

Note: This solution only work on dates prior to 2038-01-19 at 3:14:08 AM, where the delta in seconds exceeds the limit of the INT data type (integer is used as the result of DATEDIFF). See source for further details as I have not verified a solution to this problem.

Solutions


Convert Datetime Value to Unix Timestamp (today)

1
SELECT DATEDIFF(s, '19700101', GETDATE());

Result: 1305630800

Convert Datetime Value to Unix Timestamp from two Values

1
SELECT DATEDIFF(s, StartTime, EndTime) AS Duration FROM Programs

Result: 3600

Convert Unix Timestamp Value to Datetime Value

1
SELECT DATEADD(s, 123456789, '19700101');

Result: 1973-11-29 21:33:09.000

Source: How do I convert a SQL Server DATETIME value to a Unix timestamp?
Source: DATEADD (Transact-SQL)
Source: DATEADD
Source: DATEDIFF (Transact-SQL)
Source: DATEDIFF