Posts tagged windows

Fix ^M in Linux/UNIX using vi/vim

Sometimes if you edit a file in windows and then open it in Linux/UNIX it will have the special characters ^M at the end of each sentence. To fix ^M in Linux/UNIX using vi/vim run the following:

%s/[ctrlkey+v and ctrl-key+M]//g

Recover MySQL root password on Linux and Windows

It happens that sometimes (after 2 days 🙂 ) you forget the password for your root user on MySQL, well there are few steps to perform to recover it.

This was performed on version:

$ mysql -V
mysql  Ver 14.14 Distrib 5.1.61, for debian-linux-gnu (x86_64) using readline 6.2

The following steps need to be performed as root user, so either login with it or use sudo.

Step 1:Stop the MySQL service

$ sudo /etc/init.d/mysql stop

Step 2: Start the MySQL server without password

$ sudo mysqld_safe --skip-grant-tables &

Step 3: Connect to the MySQL server using the MySQL client

$ sudo mysql -u root

Step 4: Change the password for the root user

mysql> use mysql;
Database changed
mysql> update user set password=PASSWORD("YOUR_NEW_PASS") where user = 'root';
Query OK, 3 rows affected (0.01 sec)
Rows matched: 3  Changed: 3  Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye

Step 5: Stop the MySQL server again

$ sudo /etc/init.d/mysql stop

Step 6: Start the MySQL server (normally) and test the new password

$ sudo /etc/init.d/mysql start
$ sudo mysql -u root -p

 

This should also work on Windows as well, you will just need to use different commands for start/stop of the MySQL deamon.

 

 

Disable “Restart Now” on automatic updates in Windows

If you have setup your Windows machine to perform automatic updates, when a new update is available it will nag you with a popup message to restart your computer so that the updates can be applied.

There are several ways to disable or post-pone this from annoying you every 10 minutes (default setting).

  1. Disable the Automatic Updates Service for the current session, meaning it will not show up this message until the computer is restarted. Note that this will be reset after the restart so you will need to repeat it again next time when you have new updates to be applied. To disable the automatic updates for the current session type the following in the Run screen in Windows (Start -> Run):
    sc stop wuauserv

  2. Modify the group policy settings so the time between message popup is greater than the default value. Open the Group Policy Settings by entering gpedit.msc in Start -> Run. On the screen that will open, go to the following location:
    Local Computer Policy

    Computer Configuration
    Administrative Templates
    Windows Components
    Windows Update


    Now, locate the Re-prompt for restart with schedule installations option in the list and double click on it.

    Set it is as Enabled and change the waiting period to 1440 minutes (maximum value == 1 day). Enjoy the uninterrupted work! 🙂

Note: Option 2 works only on Windows XP Professional and not on Windows XP Home. However, option 1 works for all versions of Windows XP. These options were not tested on Windows 7, but they might work there as well.

Go to Top