Archive for December 2009

How to configure Tivo Series II Remote to work with a new Proscan 40LD45QC LCD TV?

Ok, so I bought a new Proscan 40LD45QC LCD TV and even though it had a list of codes in the manual, they didn’t seem to work.

So I searched online and all I found were a bunch of a couple of complaints that it cannot be done.

So I set out to try and quickly found this post:
http://support.tivo.com/app/answers/detail/a_id/292/kw/Code%20search/r_id/100041

This says:

  1. Cover the end of the TiVo remote control with your hand.
  2. Hold down the TiVo and TV POWER buttons simultaneously until the red light on the remote control remains on.
  3. Remove your hand from the end of the TiVo remote control.
  4. Enter code 0999.

    After you enter the code, the red light will flash three times and then remain on.

  5. Press CHANNEL UP once every two seconds. This will test hundreds of codes, one by one.
  6. IMPORTANT: Do not go any faster than this or you may skip over a code that works.

  7. If you press CHANNEL UP and your TV turns off, press ENTER to select the code. Press the TV POWER button to test the code. If your TV turns on, you have successfully programmed the remote.
    • If you cycle through all the codes, the red LED will go off, indicating that you have tried all the codes. If this happens, or if you selected a code but the TV does not respond to the test, try again, to make sure you did not skip over your code by going too fast.
    • If you cannot find a code that works, your current remote may not be preprogrammed with the code for your TV. If you have a TiVo HD XL or Series3 HD DVR, you have a learning remote that can easily be “taught” to control your TV. For instructions, go to Using the Learning Feature of the TiVoGlo or Series3 Remote.

      If your DVR did not include a learning remote, you can purchase a TiVoGlo Premium learning remote at the TiVo Store.

I gave it a try and the first time I pushed the Channel up button, it turned my Proscan LCD TV off, but the TV Input button acted as a mute button. So I tried again.

The second time I tried this, my TV turned off again on the first Channel up press, but I continued pressing the Channel up button until somewhere between the seventh to ninth time. I selected this one and sure enough it mostly worked:

TV Power button Works
Volume Up button Works
Volume Down button Works
Mute button Works
Mute button *Opens the TV Input screen

* Ok. There are two problems left.

  1. The Input button loads the input screen, but unfortunately it then needs the Up and Down arrows from the original remote to select an Input so I cannot change input.
  2. The sound button only moves one step. I can hold down the sound buttons and the sound continues to move up or down. But holding down the sound button on the Tivo remote doesn’t continue to change the sound.

Why does Firefox prompt for Domain (AD) Authentication? or How to get Firefox to automatically login to web sites with Domain Credentials (Sharepoint for example)?

Why does Firefox prompt for Domain (AD) Authentication? or How to get Firefox to automatically login to web sites with Domain Credentials (Sharepoint for example)?

Hey all,

I am sure you have been annoyed by the fact that when you use Firefox, the sites that require Domain credentials can popup and ask you to login. Sites like Sharepoint can ask you to log in over and over and over and over again. And then just when you are about as annoyed as you can be with typing your Domain user name and password, it prompts you some more.

For those of you who know, I work for LANDesk and we have server software and our Web Console uses NTLM authentication or Active Directory Domain credentials. You can log into the LDMS Web Console using Firefox using this method.

Well, this is really easy to make this “authentication prompt” go away. A quick search in your favorite search engine will resolve this (on a Windows box at least).

I found this site rather quickly:
http://www.1stbyte.com/2008/03/15/automatic-windows-authentication-with-firefox-networkautomatic-ntlm-authtrusted-uris/

Step 1 – Gather the lists of Sites that require domain authentication

  1. Determine all the sites you go to at work that require domain or active directory credentials and put them in a text file.

    http://CompanyName-Sharepoint
    http://CompanyName-HelpDesk
    http://InternalServer1
    http://InternalServer2
    http://InternalServer3
    http://LDMSCore

  2. Now format them like this:

    CompanyName-Sharepoint, CompanyName-HelpDesk, InternalServer1, InternalServer2, InternalServer3, LDMSCore

    Don’t worry if you don’t get them all, you can add new sites at any time.

    Note: Save this text file as you may want to do this again for someone else or you may want to do it again yourself computer gets rebuilt/upgraded.

Step 2 – Configure Firefox to Automatically Authenticate to these sites

  1. Open Firefox.
  2. Enter the following for the URL:
    about:config

  3. When warned to be careful, click the “I’ll be careful, I promise” button.
  4. In the Filter field, enter this value: network.automatic-ntlm-auth.trusted-uris
    Note: If the value is not there, you can add it as a new string.

  5. Right click on the value and choose Modify.
  6. Enter your servers as we formatted them above:

    CompanyName-Sharepoint, CompanyName-HelpDesk, InternalServer1, InternalServer2, InternalServer3, LDMSCore

  7. Click Ok.
  8. You shouldn’t have to close and re-open firefox but some poeple like to do this anyway.

You should now be able to browse your sites without having to enter credentials.

Where can I get Windows 7 or where can I buy a Windows 7 license key (32 bit or 64 bit)?

You may be asking the question:

Where can I get Windows 7 or where can I buy a Windows 7 license key (32 bit or 64 bit)?

Don’t steal it or pirate someone else’s key. One of the main reasons I am into open source such as FreeBSD is not because I don’t like Microsoft, but because I like to obey the law and open source lets me obey the law. I do used Windows all the time. I like many Microsoft products, including Windows 7. Yes, it is a better desktop than anything open source has to offer yet. Yes, you should pay for it. And Yes, someday the likes of Ubuntu and PC-BSD will remove the need to pay for an Operating System. Operating Systems will become ubiquitous. We aren’t there yet, so bite the bullet and pay for a nice shiny legal DVD with a nice legal key.

Amazon has your Windows 7 DVD and Legal License Keys here:
Windows 7 – Single License Key

Windows 7 – Multiple License Key

Windows 7 – Upgrade License Key

Stay Legal!

Please don’t post illegal locations or sketchy sites as those comments will be ignored/deleted.

How to download FreeBSD source using svn?

If you want to compile a custom FreeBSD kernel or rebuild world or be a developer for FreeBSD, you may want to download the source.

Download FreeBSD Source as follows.

Step 1 – Install Subversion

Install subversion from ports or as a package.

From ports

# cd /usr/ports/devel/subversion
# make install

From packages

# pkg_add -r subversion

Note: Don’t forget to run ‘rehash’ if after install your current shell cannot find svn.

Step 2 – Check Out FreeBSD Source

To download FreeBSD source, use subversion. You may want to use Release, Stable, or Current. Release doesn’t have any updates, so if you want patches since release, you are likely wanting to do Release Engineering.

Release

svn checkout http://svn.freebsd.org/base/release/9.0.0/ /usr/src

Release Engineering

svn checkout http://svn.freebsd.org/base/releng/9.0/ /usr/src

Stable

# svn checkout http://svn.freebsd.org/base/stable/9 /usr/src

Currrent

# svn checkout http://svn.freebsd.org/base/head /usr/src

You now have FreeBSD source and you should be able to compile the kernel or the FreeBSD world.

How to install and configure a FreeBSD 8 Desktop with Xorg and KDE?

FreeBSD X

I realize that PC-BSD exists, but sometimes, you need only FreeBSD without PBIs and you want it to do it all yourself because that is why you came to FreeBSD in the first place; to be an expert user and be able to set everything up yourself.

Requirements for Success
To consider the desktop a success, the user should be able to do the following after installation:

  1. Have a graphical login screen.
  2. Auto-mount CD/DVD and USB drives.
  3. Connect a USB drive and read and write to it.
  4. Browse the web with Firefox.
  5. Create a document with Open Office.
  6. Play an mp3.
  7. Play a DVD

Step 1 – Download the DVD and burn it

  1. To download the DVD, go here: http://www.freebsd.org/where.html
  2. Click on your platform type. You are probably going to want i386 for a 32 bit computer or amd64 for a 64 bit computer.
  3. Select the DVD and download it.
  4. Extract it as it is compressed into a zip file. Use gunzip on FreeBSD or 7zip on Windows.
  5. Use your favorite burning software to burn the ISO to disk.

Step 2 – Install FreeBSD and include Xorg and KDE4 as additional install packages.

  1. Insert the installation media and boot off it. Wait for it to boot.
  2. First select your Country.
  3. At Sysinstall’s Main Menu, choose Standard.
  4. Read the next screen and hit OK.
  5. Press A to select Use entire disk.
  6. Press Q to Finish.
  7. For the Boot Manager choose Standard and hit OK.
  8. Read the next screen and hit OK.
  9. Press A to select Auto Defaults.
  10. Press Q to Finish.
  11. For Distributions select Custom. (Don’t worry, the Custom is not that hard) and select the following distributions:
    Required – You must have the base system and a kernel. 

    • base
    • kernels | GENERIC

    Optional – You don’t have to select these but I am selecting them.

    • dict
    • doc | en (or you language).
    • games
    • man
    • src | All (Optional, if you plan on having the source so you can work on it an contribute some work back to FreeBSD.)
    • ports
  12. To get back to the Choose Distributions screen, either select Exit or OK.
  13. Hit OK to continue.
  14. At the Choose Installation Media screen choose CD/DVD.
  15. Read the next screen and choose Yes.
  16. Wait for the installations to complete.
  17. Read the Success screen and hit OK.
  18. Choose Yes to configuring an Ethernet network device.
  19. Select you network card type and hit OK. It is usually the top entry. Mine is em0.
  20. (Optional) You may want to say Yes to configure IPv6 these days. All my machines at home support IPv6 now since they are FreeBSD and Windows 7.
    It will try to detect a server, but probably won’t find one, that is just fine.
  21. Choose Yes to try DHCP. Assuming you have a DHCP server (any corporate network or home with an internet connection and router has one).
    The network configuration screen will open with your IP Address.
  22. Enter a computer name in the Host field.
  23. Choose No when prompted if you want the machine to function as a network gateway.
  24. Choose No when prompted if you want the machine to configure inetd.
  25. When prompted to enable SSH, choose Yes if you are going to connect via SSH remotely. Choose No otherwise. I am choosing Yes because I always find a reason to SSH in.
  26. Choose No to have anonymous FTP access to this machine.
  27. Choose No to for configuring this as an NFS server.
  28. Choose No to for configuring this as an NFS client (unless it is going to be and if it is going to be, you would no).
  29. Choose No to customizing the system console settings.
  30. Choose Yes to set the machines time zone now.
  31. Choose No when asked if the CMOS clock is set to UTC (unless you know for sure 100% that it is).
  32. Choose your Region.
  33. Choose your Country.
  34. Choose your Time Zone.
  35. If prompted if your Time Zone looks reasonable, choose Yes.
  36. When prompted if you have a PS/2, serial, or bus Mouse you need to understand that a mouse if almost always only PS2 or USB anymore. If USB choose No, otherwise choose Yes.
    If you choose Yes, then enable your mouse, test it and then exit that screen.
  37. Choose Yes when prompted about the FreeBSD Package collection and if you want to browse it now as this is where we are going to install Xorg and KDE.
  38. On the Package Selection screen, scroll down X11 and hit OK.
  39. On the X11 screen, scroll down and select KDE4. Notice that a lot of other packages are auto-selected as dependencies. This is normal.
  40. Continue scrolling down and select xorg-7.
  41. Now click Ok.
  42. You may want other packages such as bash. Choose them now.
  43. Choose Install and you will see the Package Targets screen. It will only list the packages your selected, not all the dependencies, but don’t worry, all the dependencies will install.
  44. Choose Ok.
  45. Wait for the installation of the packages to complete.
  46. When prompted for adding initial user accounts, choose Yes.
  47. On the User and Group Management Screen choose User and hit OK.
  48. Enter a user name under the Login ID field.
  49. Leave UID and GROUP as is.
  50. Enter a password and confirm the password.
  51. Enter your full name.
  52. In the Member Groups add these groups (without a space, only separated by a comma): wheel,operator
  53. Leave home directory as is.
  54. Leave the login shell as is. (Unless you installed bash and want to use it, then you can change it to /usr/local/bin/bash).
  55. Hit OK.
  56. Back at the User and group management screen choose Exit and hit OK. Feel free to add as many users as you need first, but don’t worry you can add more later.
  57. Read the next screen and hit OK, it is just an informational screen about the fact that you must set a root password.
  58. Enter the root password and hit enter and then enter it again and hit enter to confirm the password.
  59. When prompted to visit the configuration menu for a chance to set any last options, choose No.
  60. You are back at the Sysinstall Main Menu. Select Exit Install.
  61. When asked if you are sure you wish to exit, choose Yes.
  62. Read the next screen, and hit OK.
  63. Whilst rebooting, remove your DVD from the drive so you don’t boot off it (assuming it is first in your boot order otherwise you may not need to do this).

FreeBSD 8 is now installed with all the software needed to make a nice FreeBSD 8 Desktop, Xorg-7 and KDE4. However, there are a few more steps to get Xorg-7 and KDE4 configured.

Step 3 – Patch your new system
Update and patch your system. I already have steps to do this here:
What are the first commands I run after installing FreeBSD
Important: While the ports tree is already installed, don’t skip this step. Updating the ports tree is how you get the latest versions.

Step 4 – Configure Xorg Dependencies

  1. Login to the newly installed system with the username and password you created. Make sure you use the account that you added to the wheel and operators group.
  2. Once logged in, su to root by simply typing this command:
    $ su

  3. After typing su, you will be prompted for a password. Enter the root password.
  4. You now logged in as root. Your prompt should have changed from a $ to a NAME#. For example, I named my system FBSD8 so my prompt looks as follows:
    FBSD#

  5. Add dbus to /etc/rc.conf. Either use easy editor, or use the following shell command to add it without using and editor.
    FBSD# echo ‘dbus_enable=”YES”‘ >> /etc/rc.conf
  6. Enable dbus with this command.
    FBSD# /usr/local/etc/rc.d/dbus start

  7. Add hald to /etc/rc.conf. Either use easy editor, or use the following shell command to add it without using and editor.
    FBSD# echo ‘hald_enable=”YES”‘ >> /etc/rc.conf

  8. Enable hald with this command.
    FBSD# /usr/local/etc/rc.d/hald start

  9. Reboot by running this command:
    FBSD# reboot

    Note: It is also common to reboot using this command: (It doesn’t matter which command you use to reboot.)

    FBSD# init 6

  10. Once rebooted, log back in and su to root again.

Step 5 – Configure Xorg
Note 1: 1 and 2 are optional and you may skip them if you want. An xorg.conf file is not longer required. Usually most configurations work without it.
Note 2: If you are using VMWare, you may want to jump to this article and come back: How to install VMWare-tools on FreeBSD 8?

  1. Have Xorg automatically create an xorg.conf file using this command:
    FBSD# Xorg -configure /root/xorg.conf.new -retro

  2. Copy the xorg.conf.new to /etc/X11/xorg.conf
    FBSD# cp /root/xorg.conf.new /etc/X11/xorg.conf

  3. Type exit to logout as root. You should go back to the $ prompt.
  4. Create a file called .xinitrc in the users home directory. This file will contain one line.
    $ echo exec /usr/local/kde4/bin/startkde4 > ~/.xinitrc

  5. Run startx to launch Xorg-7 and KDE4.
    $ startx

    Note: If something goes wrong here, your xorg.conf may not have been generated correctly. Reboot (you may have to hit the power button or SSH in to reboot as you may not have console access anymore).

Xorg-7 and KDE4 should now be working.

Step 6 – Enable KDM (Optional) on FreeBSD
Instead of having to login in at a command prompt and run startx, you may prefer a GUI login screen. This can be done very easily with KDM. There is an old way and a new way. Just in case the new way isn’t available to you for some reason, I will leave both methods. Do NOT use both of them.

The new way.

  1. Add the following lines to /etc/rc.conf. Either use easy editor, or use the following shell command to add it without using and editor.
    FBSD#
    FBSD#
    echo ‘local_startup=”${local_startup} /usr/local/kde4/etc/rc.d”‘ >> /etc/rc.conf
    echo ‘kdm4_enable=”YES”‘ >> /etc/rc.conf

  2. Start kdm

The old way.

  1. If you are still in KDE, logout. Click the blue K icon at the bottom left of your screen and you can select Leave | Logout to exit KDE.
  2. Use su to login as root as you have done before.
  3. Open the following file with your favorite editor: /etc/ttys. I use Easy Editor or ee.
    FBSD# ee /etc/ttys

  4. Find the following line: (In ee, Page Down three times almost takes me right to this line.)
    ttyv8 “/usr/local/bin/xdm -nodaemon” xterm off secure
  5. Replace that line with this line:
    ttyv8 “/usr/X11R6/kde4/bin/kdm” xterm on secure
  6. Reboot to have the virtual consoles restart. (or make sure Xorg and KDE are not running and run: kill -HUP 1)

KDM should now be working and your system should reboot to a graphic login screen, which is handled by kdm.

Step 7 – Enable CD/DVD/USB mounting
FreeBSD is more secure by default, so something as simple as accessing a CD or DVD or USB drive is not actually allowed by default. You have enable this.

These steps assume that your user is a member of the operator group. Remember above during the installation, I mentioned to make your user a member of both the wheel and operator groups.

  1. Access a shell and su to root.
    Note: The easiest shell to access now that you are in KDE is Konsole. To access Konsole, click the K and go to Applications | System | Terminal. Also you can add the shell icon to your panel by right-clicking on the icon and choosing Add to Panel.
  2. Enable vfs.usermount.
    FBSD# sysctl -w vfs.usermount=1

  3. Configure vfs.usermount to be enabled on boot.
    FBSD# echo vfs.usermount=1 >> /etc/sysctl.conf

  4. Open the following file with an editor: /etc/devfs.conf
    FBSD# ee /etc/devfs.conf
  5. Add the following lines:
    # Commonly used by many ports
    link    acd0    cdrom
    link    acd0    dvd 

    # Allow all users to access CD’s
    perm /dev/acd0 0666
    perm /dev/acd1 0666
    perm /dev/cd0 0666
    perm /dev/cd1 0666

    # Allow all USB Devices to be mounted
    perm /dev/da0 0666
    perm /dev/da1 0666
    perm /dev/da2 0666
    perm /dev/da3 0666
    perm /dev/da4 0666

    # Misc other devices
    perm /dev/pass0 0666
    perm /dev/xpt0 0666
    perm /dev/agpart 0666
    perm /dev/uscanner0 0666

    Note: Yes, I copied these from a PC-BSD install’s version of this file.

    Note: Change to 0660 to only allow users in the operator group to mount drives.

  6. Also you need a devfs.rules file.  Lets create one.
    FBSD# ee /etc/devfs.rules
  7. Add the following lines.
    [Removable_Media]
    add path ‘ad*’ mode 666 group operator
    add path ‘acd*’ mode 666 group operator
    add path ‘cd*’ mode 666 group operator
    add path ‘pass*’ mode 666 group operator
    add path ‘xpt*’ mode 666 group operator
    add path ‘ugen*’ mode 666 group operator
    add path ‘usb*’ mode 666 group operator
    add path ‘lpt*’ mode 666 group cups
    add path ‘ulpt*’ mode 666 group cups
    add path ‘unlpt*’ mode 666 group cups
    add path ‘fd*’ mode 666 group operator

    Note: Again, I copied these from PC-BSD.

  8. Tell /etc/rc.conf about the rules section in /etc/devfs.rules
    FBSD# echo ‘devfs_system_ruleset=”Removable_Media”‘ >> /etc/rc.conf
  9. Edit the following file: /usr/local/etc/PolicyKit/PolicyKit.conf
    FBSD# ee /usr/local/etc/PolicyKit/PolicyKit.conf

  10. Change the xml’s config section from this…
    <config version="0.1">
        <match user="root">
            <return result="yes"/>
        </match>
        <define_admin_auth group="wheel"/>
    </config>
    

    …to this:

    <config version="0.1">
            <define_admin_auth group="operator"/>
            <match action="org.freedesktop.hal.storage.mount-removable">
                    <return result="yes"/>
            </match>
            <match action="org.freedesktop.hal.storage.mount-fixed">
                    <return result="yes"/>
            </match>
            <match action="org.freedesktop.hal.storage.eject">
                    <return result="yes"/>
            </match>
    </config>
    

    Note: Yes, again, I copied this straight from PC-BSD’s PolicyKit.conf.

  11. Edit the following file with ee: ee /etc/fstab
    FBSD# ee /etc/fstab

  12. Comment out or remove the line for your /cdrom. I usually just comment it out by adding a # sign as shown:
    #/dev/acd0 /cdrom cd9660 ro,noauto 0 0
  13. Restart the computer.

You should now be able to mount CD, DVD, and USB drives. You also should be able to both read and write to them, burn disks, write and format USB drives, etc…

Step 8 – Enable your sound card
I already have an article on this here and it is so very simple.
How to enable sound in FreeBSD 8?

Step 9 – Install Software

We are going to install the following software:

  • Firefox
  • Open Office
  • K3b

Binary Packages

  1. To browse the precompiled package lists, open a web browser to here:
    ftp://ftp.freebsd.org/pub/FreeBSD/ports//packages-8.0-release/Latest/ 

    My architecture is amd64 so the URL I use is this:
    ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.0-release/Latest/

    Hint: Some time in the future you may be on a different version or architecture. If you run this command, it will fail and the output may show you where to go.

    FBSD# pkg_add -r DoesNotExist

Firefox

  1. Access a shell and su to root as software should be installed as root.
  2. FreeBSD has a binary package for Firefox, so to install it you only have to run one command:
    FBSD# pkg_add -r firefox35

  3. Firefox 3.5 installation notes recommend adding a line to /boot/loader.conf, so use ee and add this line:
    sem_load=”YES”

Firefox is now installed.

Open Office
Note: Here I describe installing using ports, but there may be a package available. Read this post: http://forums.freebsd.org/showthread.php?t=8639

  1. Access a shell and su to root as software should be installed as root.
  2. To install Open Office, run the following commands:
    Note: There is not package as of this moment, so we have to compile from ports and this takes longer. You can check for a package if you want as there may be one sometime after I write this document.) 

    FBSD#
    FBSD#
    cd /usr/ports/editors/openoffice.org
    make install

  3. Wait…and wait…and wait…and wait…
  4. Ok, when it fails because you have to manually download some items for java, read and follow the instructions:
    IMPORTANT: To build the JDK 1.6.0 port, you should have at least
    2.5Gb of free disk space in the build area! 

    Due to licensing restrictions, certain files must be fetched manually.

    Please download the Update 3 Source from http://www.java.net/download/jdk6/6u3/promoted/b05/jdk-6u3-fcs-src-b05-jrl-24_sep_2007.jar and the Source Binaries from http://www.java.net/download/jdk6/6u3/promoted/b05/jdk-6u3-fcs-bin-b05-jrl-24_sep_2007.jar and the Mozilla Headers from http://www.java.net/download/jdk6/6u3/promoted/b05/jdk-6u3-fcs-mozilla_headers-b05-unix-24_sep_2007.jar.

    Please open http://java.sun.com/javase/downloads/index.jsp in a web browser and follow the “Download” link for “JDK US DST Timezone Update Tool – 1_3_21” to obtain the time zone update file, tzupdater-1_3_21-2009p.zip.

    Please download the patchset, bsd-jdk16-patches-4.tar.bz2, from http://www.eyesbeyond.com/freebsddom/java/jdk16.html.

    Please place the downloaded file(s) in /usr/ports/distfiles and restart the build.

  5. While you are at it, get the file from this prompt as well. I am not sure why it is not in the same prompt above, but it isn’t.

    Because of licensing restrictions, you must fetch the distribution manually.

    Please access http://www.FreeBSDFoundation.org/cgi-bin/download?download=diablo-caffe-freebsd7-amd64-1.6.0_07-b02.tar.bz2 with a web browser and “Accept” the End User License Agreement for “Caffe Diablo 1.6.0”.

    Please place the downloaded file(s) in /usr/ports/distfiles.

  6. Make sure you followed the instructions, download the files, and placed them in /usr/ports/distfiles. Restart the build using the same command you ran before. If you didn’t know, you can probably press the up arrow on your keyboard to see command history so you don’t have to type it again.
  7. You will shortly be prompted with a license agreement. Please read ever word, pressing the space bar to scroll until the end, before typing yes.
  8. Now wait some more as Open Office and its dependencies continue compiling.
  9. No you haven’t waited long enough.
  10. Ok…no just kidding, wait a little more.
  11. No really. It takes a long time to compile Open Office so leave it running and skip to the next step.

When it is done, you will be able to write documents that are compatible with MS Office.

K3b

  1. Access a shell and su to root as software should be installed as root.
  2. FreeBSD has a binary package for K3b, so to install it you only have to run one command:
    FBSD# pkg_add -r k3b

  3. There are a lot of notes about postinstallation steps, so burning a CD is going to be for another day and another document.

Playing MP3s
As for paying I can play MP3s with juK the KDE4 Music player that is installed by default with KDE4.

You should now have the idea and can go installing software that you want.

Playing a DVD

Dragon Player didn’t play the a DVD for me. So I installed kmplayer-kde4. It didn’t play the DVD either. I installed Xine and it worked.

Keywords: FreeBSD X


Copyright ® Rhyous.com – Linking to this article is allowed without permission and as many as ten lines of this article can be used along with this link. Any other use of this article is allowed only by permission of Rhyous.com.

How to enable sound in FreeBSD 8?

FreeBSD doesn’t enable the sound by default. However it is simple to detect and enable your sound card.

Step 1 – Detect Your Sound Cound

  1. Install all sound kernel modules by running the following command:

    FBSD# kldload snd_driver

  2. Check which kernel module was able to bind to your sound card by running this command:

    FBSD# cat /dev/sndstat

    The output will be similar to this but of course you may have a different sound card:

    FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
    Installed devices:
    pcm0: at io 0x2040 irq 16 kld snd_es137x [MPSAFE] (2p:1v/1r:1v channels duplex default)
  3. Notice on the last line after kld there is a snd_. This is you sound card kernel module.

Step 2 - Enable the kernel module for your sound card

  1. Configure your the kernel module of your sound card to load at boot by adding it to the /boot/loader.conf as follows.

    FBSD# echo 'snd_es137x_load="YES"' >> /boot/loader.conf

    (Of course when you run the command, replace "es137x_" with the letters you see in the output for your sound card.)
    Note: If you look at the /boot/default/loader.conf you can find information on proper syntax exactly for your module and other modules.

Your sound card should now be working.

How to compile a wxWidgets application in Visual Studio 2008?

Step 1 – Install Visual Studio 2008

  1. If you don’t have it, get the express edition here: http://www.microsoft.com/Express/VC/
  2. Run through the installer, not much else to do.

Step 2 – Install wxWidgets

  1. Download wxWidgets (select the wxMSW installer file) from here:
    http://www.wxwidgets.org/downloads/
  2. I choose to install to c:\dev\wxwidgets\wxWidgets-2.8.10 but you can choose a different path if you want.

Step 3 – Create an environment variable for the wxWidgets path.

  1. Click the Start icon.
  2. Right click on Computer and choose Properties.
  3. Click Advanced system settings.
  4. Click the Environment variables button.
  5. Under System Variables, click New.
  6. Enter the Variable name: WXWIN
  7. Enter the Variable Value: C:\Dev\wxWidgets-2.8.10
  8. Click OK, click OK, click OK (yes three times).

Step 4 – Compile the wxWidgets Libraries.

  1. Browse to the following folder: C:\Dev\wxWidgets-2.8.10\build\msw
  2. Located the file called wx.dsw and open it with Visual Studio. (I just double-clicked on it.)
  3. Choose “Yes to all” when Visual Studio prompts you to convert the project.
  4. Build the project.
  5. Wait for the build to complete. It took approximately two minutes on my Lenovo T61p (dual core, 4 GB, Windows 7 64 bit). You should a line like this when it finishes successfully.
    ========== Build: 20 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
  6. Close Visual Studio.

Step 5 – Create a new project

  1. In Visual Studio 2008, go to File | New Project.
  2. Select Visual C++ | Empty Project.
  3. Give the project a name and click OK. I named this wxTest.

Step 6 – Create/Copy your source to this project.

  1. Right-click on the Project name and choose Open Folder in Windows Explorer. This will open to the home folder of your project. (Don’t right click the Solution name, make sure to right click the project under the solution name.)
  2. Open a second Windows Explore window.
  3. In the second window, browse to the wxWidgets sample directory and open the Minimal folder: C:\Dev\wxWidgets-2.8.10\samples\Minimal
    Note: You can choose other projects but you may want to start with Minimal and move on from there.
  4. Copy only the minimal.cpp and minimal.rc files to your project directory (the rest are not needed).
  5. Close the second window pointing to the C:\Dev\wxWidgets-2.8.10\samples\Minimal directory, it is not needed anymore.
  6. From the explorer window open to your project directory, use ctrl+click to highlight both the minimal.cpp and minimal.rc files.
  7. Drag both highlighted files into the Visual Studio Window and drop them over the project name.
    The minimal.cpp file should automatically be placed under the Source files section of your project.
    The minimal.rc file should automatically be placed under the Resource files section of your project.

Step 7 – Customize the project properties

  1. Right-click on the wxTest project and select Properties. (Don’t right click the Solution name, make sure to right click the project under the solution name.)
  2. In the top left of the properties window there is a Configuration drop down menu. Select All Configurations.
  3. Click to expand Configuration Properties.
  4. Click to expand C/C++.

    Note: If you don’t see a C/C++ section, then you don’t have any source files.  You need at least one C++ source file for this section to show up.

  5. Click to highlight General.
  6. Enter the following in Additional Include Directories.
    $(WXWIN)\include;$(WXWIN)\lib\vc_lib\mswd
  7. Click to highlight Preprocessor.
  8. Enter the following in Preprocessor Definitions.
    WIN32;__WXMSW__;_WINDOWS;_DEBUG;__WXDEBUG__
  9. Click to expand Linker.
  10. Click to highlight General.
  11. Enter the following in Additional Library Directories.
    $(WXWIN)\lib\vc_lib
  12. Click to highlight Input.
  13. Enter the following in Additional Dependencies.
    wxmsw28d_core.lib wxbase28d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib winmm.lib comctl32.lib rpcrt4.lib wsock32.lib odbc32.lib

    Note: Not all of these libraries are required for this project, however, I list all of these because you may use some of them at some point. If you don’t think one is needed, remove it and recompile and if you don’t get errors, you were right, you probably didn’t need it.

  14. Click to expand Resources. (If you don’t see a Resources option, then you don’t have any files under resources so that is normal. Did you skip Step 5 because you probably should have added a resource in Step 5.)
  15. Click to highlight General.
  16. Enter the following in Preprocessor Definitions.
    _DEBUG;__WXMSW__;__WXDEBUG__;_WINDOWS;NOPCH
  17. Enter the following in Additional Include Directories.
    $(WXWIN)\include;$(WXWIN)\lib\vc_lib\mswd

You are now ready to build your wxWidgets application using Visual Studio 2008 on Windows 7.

Build your project and if you get any errors, go through it again, you probably missed a step (or I did, since I have already been caught with one step left out).


Copyright ® Rhyous.com – Linking to this article is allowed without permission and as many as ten lines of this article can be used along with this link. Any other use of this article is allowed only by permission of Rhyous.com.

How to convert QlikView Time to Salesforce time in a load script?

Ok, so here is what I am doing:

  1. I am storing Salesforce data in a QVD file.
  2. I am getting the QVD file date using:
    Let QVDPath='C:\ProgramData\QlikTech\QVD';
    Let ThisExecTime = Reloadtime();
    Let LastExecTime = QvdCreateTime('$(QVDPath)\SFCase.qvd');
    
  3. I am trying to only get data modified since load using WHERE LastModifiedDate > $(LastExecTime ).

According to salesforce, the time stamp should be in this format:

1999-01-01T23:01:01Z

See this page for more detailed information and alternate formats:
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_select_dateformats.htm

So I created this sub to get Salesforce time from QlikView time:

Sub SFTime(inDateTime)
    Let inDateTime=date(inDateTime, 'YYYY-MM-DD') & 'T' & time(inDateTime, 'HH:MM:SS') & 'Z';
EndSub

It works.

LANDesk Support Tools Beta 7

Hey all,

It has been a while again and again there are good reasons for this.

If you find something not working, please let me know.

Version: 9.0.0.7
( 9.0.0.x Matches our current release of LDMS, though this is not really version dependent.)

Release Notes
===============

  1. Compiled using LDMS 9.
  2. Changed the OSType xml object to search for the value as an exact match and as a contains. (This resolve an issue where in 9.0 Windows Workstations just say Workstation and Windows Servers just say Server, but 8.8 agents might scan in and say XP Workstation, 2008 Server, so by just putting “Workstation, Server” all windows machines should be obtained.)
  3. Added a trick to handle the different the patch to the LDClient directory, which is now much more necessary since %ProgramFiles% doesn’t point to “c:\program files (X86)” on 64 bit machines. (I use this: %LDMS_LOCAL_DIR%\..\)

WARNING: This version is not tested on 8.8 and it is recommend you continue with version beta 6 for 8.8 and only use this version for LDMS 9.

Latest Version:

LANDesk Support Tools beta 7a.exe

Previous Version for LDMS 8.8

LANDesk Support Tools beta 6.exe

How to setup Eclipse C/C++ Development Tools on Windows 7?

How to setup Eclipse C/C++ Development Tools on Windows 7?

Ok, so I download Eclipse C/C++ Development Tools and create a Hello World application and it didn’t run. It failed to compile with this error:

(Cannot run program “make”: Launching failed)

So obviously it is not download and extract and it works…so lets figure it out.

  1. First, install the other dependencies as described here:

    http://help.eclipse.org/galileo/index.jsp

  2. Add c:\mingw\bin to the path of your environment variables.
  3. Then download Eclipse from http://www.eclipse.org.

After doing it all right, I still go this error when I tried to compile the simple Hello World program.

undefined reference to `WinMain@16′

Yeah, I fixed this error by saving my C++ file, as found at this site: http://www.peetm.com/blog/?p=278

ShrewSoft's Windows 7 VPN Client (that works in 64 bit) was released Dec 5th

Hey all,

No more release candidate only. ShrewSoft’s Windows 7 VPN Client (that works in 64 bit) was released Dec 5th.

Go here to download it:

http://www.shrew.net/download/vpn

Or just click this link.

http://www.shrew.net/download/vpn/vpn-client-2.1.5-release.exe

Thank you ShrewSoft for the work you do…

Another Windows 7 annoyance: Right-click options for a folder when it is open from "Libraries"

Ok, so I have another Windows 7 annoyance. (It is the same annoyance on Windows 2008 R2 SP2 Server too.) Again, I am not trying to bash Windows 7. For ever bad thing I post, there are numerous good things I don’t post. Yes, I am a FreeBSD guy (as if you couldn’t tell) but I am not anti-Mircrosoft as some Linux/Unix/BSD admins are. I am more like a car mechanic that wants a good tool for the job at the right price.

PROBLEM
Another Windows 7 annoyance: Right-click options for a folder when it is open from “Libraries”

How to duplicate
I am using TortoiseSVN (because I am a developer and must use a dev repository to commit my code because it is good practice) and it adds options to the right-click menu.

I have a folder under the Documents library that is called “New Folder”. The folder is open and empty, so I should be able to right-click anywhere there is blank space and get some right-click options.

With Tortoise SVN installed I should be able to right-click anywhere there is blank space in the folder and do an SVN Checkout but the option is not there as you can see in the image below:

So in order to get the option to show up, I have to go to the directory without using the “Libraries” interface. Or I can go up a level and right-click on the folder itself (as apposed to having the folder open and right-clicking in blank space). I really am going to be in the folder usually though and going up a directory is annoying. I can browse directly by clicking Computer, or go up a level and right-click on the folder and choose Open folder location and then go into the folder, and it works. Then the option shows up.

So if anyone knows how to fix this, let me know, I will be grateful. I have seen posts on how to remove “Libraries” altogether but I think they are a good idea and really this is the only part of them I don’t like. So I will keep them, I will just be annoyed until Microsoft fixes this or there is a new solution. Maybe Libraries get their right-click options elsewhere and installers will have to add plugins in two places…

oh…sysinternals will show me what happens when I right-click…Ok I am done complaining and am off to test this latest idea that I might be able to add the plugin elsewhere.

Explorer.exe in Windows 7 still hanging when I create a new file, rename the file, delete a file, etc…

Just an update to all who are wondering about my previous post.
Windows 7 hangs when creating a new folder and hangs again when renaming it

I have done some troubleshooting, trying to Analyze what is causing the hang but I still don’t have the answer. I am very disillusioned with Windows 7 because of this problem.

My efforts to troubleshoot this have failed.

Troubleshooting

ACTION: Followed this article:
http://blogs.technet.com/markrussinovich/archive/2005/08/28/the-case-of-the-intermittent-and-annoying-explorer-hangs.aspx

RESULT: I have a nice capture of everything my machine was doing (39 MB but only 3.6 MB zipped) though I filter on explorer.exe in Process Monitor. It show that Explorer.exe hangs, but doesn’t tell me why. Maybe someone can tell what the problem is:
ftp://ftp.landesk.com/incoming/Explorer Hangs.zip
(link only good for about two weeks)

ACTION: Ran this command from an administrator command prompt:

sfc /scannow

RESULT: Nothing wrong

Verification 100% complete.

Windows Resource Protection did not find any integrity violations.

ACTION PLAN

Try a clean boot.
http://support.microsoft.com/kb/929135

How to return an string array from an enum in C++?

How to return an string array from an enum in C++?

Well, you can’t. You can’t just create an enumerator and then get the string. You have to create the string array for it to work.

So if you can’t do it, then what do you need to do?

I would recommend an array of strings, or a vector of strings, etc…

#include <iostream>
enum items
{
	item1 = 1, item2, item3, item4, item5
}

char * item[] = {"item1", 'item2', 'item3', 'item4', 'item5'};

int main()
{
	return 0;
}

I found this way to do this and it doesn’t seem very straight forward. It looks confusing, but hey, it works.

#define OPTIONS_LIST X(Add),\
			         X(Edit),\
					 X(New),\
					 X(Sell),\
					 X(Stock)

#define X(x) x
enum options
{
	OPTIONS_LIST
};
#undef X

#define X(x) #x
const char *szOPTIONS_LIST[] =
{
	OPTIONS_LIST
};
#undef X

There are other ways and they all seem doable but confusing to other developers. Here are some references for other confusing ways….

http://www.cplusplus.com/forum/general/2949/
Note: I liked the comment by Zaita

http://www.codeproject.com/KB/cpp/C___enums_to_strings.aspx

http://www.gamedev.net/community/forums/topic.asp?topic_id=437852

How to get the size in bytes of a file in C++?

How to get the size in bytes of a file in C++?

Using the C++ Standard Library’s fstream object makes this rather easy. I tested this method on Windows 7 and FreeBSD 7.2.

Lets say I have a file called MyFile. How do I get the size of it?

#include
#include

using namespace std;

int main()
{
char * fileName = “MyFile”;
fstream file(fileName, ios::in);
file.seekg(0, ios::end);
int sizeInBytes = file.tellg();

cout << fileName << " is " << sizeInBytes << " bytes long." << endl; } [/sourcecode] That is great. It is simple and it works. Now you can actually make a usable application out. Let's change this to take a parameter, the parameter should be a file, and output the size of the file. [sourcecode language="cpp"] #include
#include

using namespace std;

int main(int argc, char **argv)
{
char * fileName = argv[1];
fstream file(fileName, ios::in);
file.seekg(0, ios::end);
int sizeInBytes = file.tellg();

cout << fileName << " is " << sizeInBytes << " bytes long." << endl; } [/sourcecode] Now if you build this into an executable called filesize, you can run filesize MyFile.

Ok, so their is an idea in the unix world (which I agree with usually) that output should not be chatty, so lets change the output line to only output the size in bytes of the file. This will make it easier for you to use shell scripts to and parse the output.

cout << sizeInBytes << endl; [/sourcecode] Now lets make it a little more rebust and error proof. [sourcecode language="cpp"] #include
#include
#include
#include

using namespace std;

void syntax(char * thisFile);
const char * stripPath(char * inPath);

int main(int argc, char **argv)
{
// Take only one paramter.
// Since there is a default parameter you have to check for 2 not 1
if (argc == 2)
{
char * fileName = argv[1];
fstream file(fileName, ios::in);
if (file)
{
file.seekg(0, ios::end);
int sizeInBytes = file.tellg();
cout << sizeInBytes << endl; } else { cout << "File error. The file you entered could not be sized." << endl; } } else { syntax(argv[0]); exit(1); } return 0; } void syntax(char * thisFile) { cout << "Syntax: " << endl; cout << " " << stripPath(thisFile) << " Filename" << endl; cout << endl; cout << " Filename\t" << "Any file path value such as, MyFile, c:\\myfile, /root/myfile." << endl; cout << endl; } const char * stripPath(char * inPath) { string path = inPath; string fileName = path.substr(path.rfind("\\") + 1); char * retVal = new char[fileName.size() + 1]; strcpy(retVal, fileName.c_str()); return retVal; } [/sourcecode] No there shouldn't be any program crashes when you input an incorrect filename, or a file that you don't have access to. Sources: http://www.cplusplus.com/reference/iostream/istream/read/