24 September 2009

Remove fortune messages in the GNOME Terminal?

While periodically amusing, the fortune cookie texts that appear at the top of your terminal prompt can be annoying. Have no fear as these little gems are easily removed.
  1. From the desktop, launch a new terminal session by selecting: Applications > Accessories > Terminal. A new terminal window will display.
  2. At the prompt (the blinking cursor), type: gksu gedit /etc/bash.bashrc then press Enter
  3. At the prompt, enter the gksu (Administrator) password. This is likely the same password you use when logging in. The gedit application will launch with the bash.bashrc file ready for editing.
  4. Locate the line that reads:/usr/games/fortune
  5. Comment this line out by preceding it with a "#" (the hash symbol). The new line should read: #/usr/games/fortune
  6. Save your changes then close the gedit editor.
  7. Close and re-launch the terminal. You should now be greeted with the plain old vanilla terminal.

29 May 2008

How do I clear (onclick) and restore (onblur) the default value for a text field?

Below is one example of how to clear the default text of a text field. In this example, the default text is: “Search Keywords”. If the user types text into the field, their entry will remain, allowing them the opportunity to click your “Search” button (or do whatever else is planned). However, if the user simply clicks into the field then clicks elsewhere (onblur), the default text will be returned.
<asp:TextBox ID="TextBox1" runat="server" class="searchfield" Text="Search Keywords"
onfocus="if(this.value=='Search Keywords')(this.value='');" onblur="if(this.value=='')(this.value='Search Keywords');" />
Essentially, the JavaScript reads like this: When the onclick event occurs, if the text in the text box is equal to: “Search Keywords”, set the text in the text box to nothing. When the onblur event occurs, if the text in the text box is nothing, set it to: “Search Keywords”.

For additional information on JavaScript events, please visit: http://www.irt.org/articles/js058/.

14 May 2008

How do I determine which version of Ubuntu I am using?

  1. From the desktop, select: Applications > Accessories > Terminal. A command-line terminal window will open.
  2. At the terminal prompt, type: lsb_release -a then press Enter.
  3. Information about your installation will be displayed.

Rhythmbox stopped playing my MP3s. How do I fix it?

  1. Select: System > Preferences > Sound.
  2. Set all Sound Playback dropdowns to: ALSA - Advanced Linux Sound Architecture.
  3. Click: Close.
  4. Exit Rhythmbox by selecting: File > Quit.
  5. Launch Rhythmbox.

21 February 2008

How do I set the default value or binding to a date in the future?

In this article, we will be using SQL Server's Default Value or Binding property to set the default column value to a date in the future. This can be useful if you have a value that you want to expire on a specific date from it's creation.
  1. From SQL Server Management Studio, right-click on the target table and select Modify.
  2. Select the desired column in Object Explorer then move down to the Column Properties section.
  3. In the Default Value or Binding field, enter: (dateadd(year, 30, getdate())) This sets the value to 30 years from the date that the record is entered (unless a value is actually specified during entry).
  4. Save your changes.
  5. You may of course, use different timespans by simply modifying dateadd. For more information, try Google.

08 January 2008

How do I install the AdventureWorks sample database with SQL Server 2005 Express?

File Download:

  1. Navigate to: http://www.codeplex.com/MSFTDBProdSamples.
  2. From the: Releases tab, click: SQL Server 2005 (hyperlink).
  3. Scroll down and click: AdventureWorksLT.msi.
  4. Save the file to your desktop or other known location.
  5. Once the download is complete, click: Run (or navigate to the location where you saved the file and double-click: AdventureWorksLT.msi) to start the install.
  6. Follow the prompts (using the default selections) to complete the install.

DB Permissions Configuration:

  1. From the keyboard, press: Windows Key + E to launch Windows Explorer.
  2. In Windows Explorer, navigate to: C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data.
  3. Right-click: AdventureWorksLT_Data.mdf then select: Properties.
  4. Click: Security > Edit > Add.
  5. Type your login name into the: Enter the object names... textbox then click: Check Names. Your entry will automatically resolve to: MACHINENAME\Login.
  6. Click: OK.
  7. Select your login name from the: Groups or usernames list.
  8. In the: Permissions for LoginName box, click: Full control then click: OK > OK. You should now be back at the Windows Explorer window.
  9. Right-click: AdventureWorksLT_Log.ldf then repeat this process to change the user permissions for that file as well.

SQL Server Management Studio Configuration:

  1. Launch Microsoft SQL Server Management Studio Express and connect to your local server. Ensure that the default connection settings are used.
  2. From Object Explorer, right-click: Databases then click: Attach. The: Attach Databases dialog will appear.
  3. Click: Add.
  4. Click: AdventureWorksLT_Data.mdf then click: OK.
  5. Click: OK. You should now be at the main window for: Microsoft SQL Server Management Studio Express.
  6. In Object Explorer, expand: Databases > AdventureWorksLT > Tables.
  7. Right-click: dbo.BuildVersion then select: Script Table as > SELECT to > New Query Editor Window.
  8. Press: F5. The query will return the build version, confirming a successful installation.

Possible Problems:

Error: The database 'AdventureWorks' cannot be opened because it is version 631. This server supports version 612 and earlier. A downgrade path is not supported. Could not open new database...

Error: Error 27506. Error executing SQL script sqlscript.sql. Line 17. The database 'AdventureWorksLT' cannot be opened because it is version 631. This server supports version 612 and earlier. A downgrade path is not supported (948)...

These errors are generated when you attempt to install AdventureWorks for SQL Server 2008 on SQL Server 2005. The CodePlex website contains two versions of the database: One for SQL Server 2005 and one for SQL Server 2008. Repeat the: File Download: portion of this tutorial and be sure to click the SQL Server 2005 hyperlink.

Error: Error 1722.There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel...

This error is also generated after attempting to install AdventureWorks for SQL Server 2008 on SQL Server 2005, though this error code may be specific to a Windows XP installation. Either way, repeat the: File Download: portion of this tutorial and be sure to click the SQL Server 2005 hyperlink.

Error: CREATE File encountered operating system error 5(access denied) while attempting to open/create the file.... MS SQL error 5123...

This error (or similar) is related to file permissions for: AdventureWorksLT_Data.mdf and/or AdventureWorksLT_Log.ldf. In either case, repeat the: DB Permissions Configuration: portion of this tutorial.

How do I minimize iTunes to the Task Bar?

To send iTunes to the Windows Task Bar when minimized:

  1. From the desktop, right-click on an empty portion of the Task Bar then select Properties.
  2. Select the Toolbars tab then enable the iTunes toolbar.
  3. Click: OK. With this option enabled, iTunes will minimize to the Task Bar (near the notification area).