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!!