Resetting a lost mysql root password

root@steve:~# /etc/init.d/mysql stop

Now you should start up the database in the background, via the mysqld_safe command:

root@steve:~# /usr/bin/mysqld_safe --skip-grant-tables &
[1] 6702
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[6763]: started

Here you can see the new job (number "1") has started and the server is running with the process ID (PID) of 6702.

Now that the server is running with the --skip-grant-tables flag you can connect to it without a password and complete the job:

Finding Executable that is using a port

So I ran into a problem with my computer where I was trying to set up a Tomcat server to run on port 8081. Every time I started the server, I experienced an error saying that the port was already in use. Since I didn't have any other applications open, I became baffled so I did a little exploring.

Running netstat -a -p TCP:

TCP 0.0.0.0:8081 eng01:0 LISTENING
TCP [::]:8081 eng01:0 LISTENING

Enabling NTLM Authentication Single Sign-On (SSO) in Internet Explorer

Internet Explorer supports NTLM authentication out of the box. It should just work for intranet hosts, but you can add other hosts to the security settings:

Internet Explorer: Tools → Internet Options → Security → Local Intranet → Sites
 

Adding trusted hosts can also be done through group policy.

You must also make sure either your Local security policy or Domain Group policy reflects the following:

Go to Local Security policy > Security settings > local policies > security options

Enabling NTLM Authentication Single Sign-On (SSO) in Firefox

How many of you have noticed that when you are using Internet Explorer and you browse to your companies intranet page that it will automatically authenticate you but when you use Firefox you will be prompted with a login box?

I recently, in searching for solutions to allow NTLM authentication with Apache, stumbled across how to set a preference in Firefox that will pass the NTLM authentication information to a web server. The preference is network.automatic-ntlm-auth.trusted-uris.

So how do you do it?

Automatic HTML form submission using Perl module WWW::Mechanize

Here is a short tip on how to automatically submit a HTML form using a Linux command line and perl script. For this example we would need a WWW::Mechanize perl module and some basic PHP website. Let's start with simple PHP website. The website will consist of two files:

form.php:

<form action="submit.php" method="post">
First Name: <input name="fname" type="text" />
Last Name: <input name="lname" type="text" />
<input type="submit" />
</form>

submit.php

Pages

Subscribe to kb.kaminskiengineering.com RSS