Thursday, June 25, 2009

MySql Root Password Recovery

A few of my Linux machines only get accessed remotely from a shell or web interface. Since they are usually very reliable and don't give me any problems I have a tendency to forget about them and all the different passwords that I use on them.

Now being a somewhat security conscious person I use unique and complex passwords for every account and machine that I have control over. I also do not have the best memory in the world so I have used a few of the password manager utilities. I am currently using KeePass and experimenting with LastPass to manage some of my passwords.

But as life would have it I must not have entered or forgotten to update the password for one of my MySql instances and here is how I solved the problem.

This method will take down the MySql daemon for a short time so I first made sure that no important services would be interrupted. Then I stopped the server.


[root@localhost /]# /etc/rc.d/init.d/mysqld stop
Shutting down MySQL: ... [ OK ]


Then start the server skipping the grant table.


[root@localhost /]# mysqld_safe --skip-grant-tables


If the server does not start you probably have other issues but assume that the server started up correctly. Now you need to reset the password. Login to the MySql server.


[root@localhost /]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 33
Server version: 5.1.34 - MySQL Standard Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> update user set Password=PASSWORD('new-password') where user='root';

mysql> flush privileges;

mysql> exit


Now the password has been reset so you need to kill the mysqld process and start the server normally. To kill the server I just grepped for the process number.


[root@localhost /]# ps aux | grep mysql
mysql 8856 ....deletia...
[root@localhost /]# kill -9 8856
[root@localhost /]# /etc/rc.d/init.d/mysqld start
Starting MySQL: ... [ OK ]


Now you should be up and running with a new password and DO NOT forget to update the password manager with the new password.

Thursday, June 18, 2009

SBS2008 Library Event Warning

I have been seeing an error in the Event Viewer of my SBS 2008 server for a while but I have ignored it until now.

The error is event id 2003, Performance Library Availability.

The configuration information of the performance library "C:\Windows\system32\sqlctr90.dll" for the "MSSQL$SBSMONITORING" service does not match the trusted performance library information stored in the registry. The functions in this library will not be treated as trusted.


The Technet entry seems recent but it says to use the lodctr command.

After opening a command prompt with Administrator privileges the command I used was lodctr /t:sqlctr90.dll.

I will check the event log again in a few days to see if the event is still appearing. Now I need to solve the annoying event 10009 and event 10010 DCOM errors.

Thursday, June 11, 2009

Do the Right Thing

The fact that traffic sucks is one thing that most people can agree on. What to do about the traffic is another matter entirely. Everyone wants the government to fix the problem but no one wants to pay for it.

In my observations I would say that one of the most prevalent problems is oblivious drivers in the passing lanes talking or texting on phones, eating food, putting on makeup or even all three at the same time. These self centered ignorant people think that they own the road and everyone else should just deal with it. This behavior forces the impatient people behind them to do stupid thing like swerving across multiple lanes of traffic and cutting off other people to try and get around the ignoramus in the left lane.

A survey of state laws shows that most states follow the Uniform Vehicle Code which requires slower vehicles to keep right. In particular Virginia State Code 46.2-842.1 states that:
§ 46.2-842.1. Drivers to give way to certain overtaking vehicles on divided highways.

It shall be unlawful to fail to give way to overtaking traffic when driving a motor vehicle to the left and abreast of another motor vehicle on a divided highway. On audible or light signal, the driver of the overtaken vehicle shall move to the right to allow the overtaking vehicle to pass as soon as the overtaken vehicle can safely do so. A violation of this section shall not be construed as negligence per se in any civil action.


The National Motorists Association has a great concept called Lane Courtesy where the advantages of moving over are "self-evident".
If people would "do the right thing" and show a little courtesy by moving over then the people who want to drive faster can and people who want to go slower can do it in the right lane without having to complain about somebody tailgating them.

Thursday, June 4, 2009

Model 1917 Ejector Replacement


The Model 1917 Enfield was actually issued to more Soldiers during World War 1 than the M1903 Springfield. The short history is that in the early years of WW1 U.S. manufacturers were making the British Enfield P14 rifle and when the U.S. entered the war there were not enough M1903s to meet demand. It would have taken too long to retool the factories to start building the M1903 so it was decided to rechamber the P14 from 303 British to 30-06, giving birth to the Model 1917.

Enough history for now, the other day I was shooting my 1917 in a match when I ran into a problem ejecting the empties during the prone slow fire stage. I finished the stage by pulling the empty out of the chamber after each shot. Not that hard but it blew my concentration a bit.

After the stage I took a look at the rifle and found that the ejector was not popping out when I pulled the bolt back. I took the ejector housing off and of course the ejector spring was broken. Not one to give up, I scavenged a spring from a ball point pen, cut it to length and put everything back together.

Everything worked well and I was able to finish the match, including the rapid fire stages without any problem. Even though my score was not that great I left feeling pretty good that I was able to fix the rifle in the field and continue.

Once I got home, I got on the Internet and started looking for a replacement ejector spring. I found one at Numrich for a decent price and ordered it. I had it in my hands about 4 days later and now it is time to replace the spring.

Here is the left side of the receiver showing the ejector housing and the screwdriver in position to remove the one and only screw needed for this repair.


After removing the screw and pulling the housing off of the receiver I laid the parts out so I would not lose any. Sorry this one is a bit blurry.


And now a shot of a new ejector spring next to the ball point pen modification I made. The one on top is the normal leaf spring type ejector spring and on the bottom is the modification I made to finish the match. If you look closely you can see the little nib where the old leaf spring broke off.


Putting it back together was not hard. It seemed like a third hand would have helped trying to push against the spring to get the screw hole lined up but I got it back together and tested the ejector to make sure it worked. Now I just need to find time to go out and test it at the range!!

Thursday, May 21, 2009

Memorial Day

Over the years the meaning of Memorial Day has faded too much from the public consciousness. From a solemn day of mourning, rememberance, and honor to our departed loved ones, it has degenerated into a weekend of Bar B Q's, shopping bargains and beaches where only token nods toward our honored dead is given, if at all. Too many don't know what the day stands for.

Memorial Day used to be a sacred day that was reserved for the remembrance of those who paid the ultimate price for our freedoms. Businesses closed for the day. Towns held parades honoring the fallen, the parade routes often times ending at a local cemetery, where Memorial Day speeches were then given. People took the time that day to clean and decorate with flowers and flags the graves of those the fell in service to their country.

It is human nature to avoid the unpleasant. But we need to remember the cost of war, we need to remember the price paid for our freedoms, we need to not let those who died, die forgotten and in vain.

When Congress made the day into a three-day weekend in with the National Holiday Act of 1971 (P.L. 90 - 363), it made it all the easier for us to be distracted from the spirit and meaning of the day.

We need to teach our children the day's meaning. Show others by our actions that we will not forget. You don't have to believe in war to honor our family, friends and neighbors who died in service to their country.

Have a safe weekend with your families.

Tuesday, May 12, 2009

DVD Library in Vista Media Center

I have been looking around for a integrated way to store movies on the server and allow all of the computers in the house to access those movies. I think I found a good solution in this Microsoft Knowledge Base Article.

It details how to enable the built in DVD Library support in Vista Media Center. All of the movies are stored in individual folders located in a shared folder on the server in the VIDEO_TS format.

Then on each of the client Vista machines, open regedit and navigate to the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Media Center\Settings\DvdSettings subkey.
Locate the ShowGallery key and modify the value from Play to Gallery.

Then launch Media Center and you should see DVD Library under TV & Movies.



This worked fine on my rig but when I tried it for my wife the registry setting did not change the GUI and the DVD Library did not show up.
I fixed this by giving her account temporary local admin, made the registry change, made sure it worked , and then removed her from the local admin group.

Once the DVD Library shows up in the gui click on it and then right click and select add a shared folder from another computer and then select the share with the movies.

The movies should start appearing in the Library. There are still a few issues for me to sort out. One is that the information such as the cover art and meta data is not cached and it needs to be looked up every time. As the number of movies increases this can take a bit of time. You can place an image called folder.jpg in each movies folder and that will take precedence over the download. Another issue is the dvdid.xml, and I have been doing a bit of reading and cam across this site that appears rather interesting.

Thursday, May 7, 2009

Vista DRM Issue

Never one to pass up a good deal, I was able to get a new Q9650 Quad Core processor at a good price. I replaced the E8400 Dual Core in my main Rig, updated the bios and fired her up. I am running Vista Ultimate x64 in this machine and it started right up and I just had to open Task Manager and see all four cores looking good.

After the obligatory re-activation, I ran the Vista performance benchmark for the experience Index and I am now 5.9 across the board with 8 Gig RAM, 8800GTS video, and a WD Raptor 150 Gig Drive.

Then I opened up Media Center and I encountered the first of my issues. Error windows popped up about the receiver service not working and Digital Cable device registration application stopped working errors started opening up.

As it turns out Vista DRM is tied to the CPU so you need to delete the DRM cache. Open up an explorer window and go to the tools menu on the toolbar. If you do not see the toolbar, hit the alt key and it should appear. Go to folder options and choose the "view" tab.

Select the show hidden folders and unselect the Hide Protected Operating System Files. Then go to C:\ProgramData\Microsoft\Windows\DRM. Make sure it is the correct DRM folder, there is another DRM folder one level up and it is empty. If I am feeling cynical I think it is a decoy to confuse people. Inside the correct DRM folder there should be some files like this.





Now delete all of the file inside of the DRM folder but not the DRM folder itself. Then log off and reboot for good measure. You may want to reset the folder view options back to their default options. Now the annoying errors should be gone Media Center should be working fine again.