Showing posts with label Reset. Show all posts
Showing posts with label Reset. Show all posts

02 June 2024

Have forgotten root password of mysql server

$ sudo service mysql stop

$ sudo vi /etc/mysql/mysql.conf.d/reset-mysql-password.cnf

[mysqld] 
skip-grant-tables

$ sudo mysqld_safe --skip-grant-tables &

$ mysql -u root

mysql > UPDATE mysql.user SET authentication_string=null WHERE User='root'; 

mysql > FLUSH PRIVILEGES;

mysql > exit

$ mysql -u root

mysql > ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourpasswd';

mysql > FLUSH PRIVILEGES;

sudo rm /etc/mysql/mysql.conf.d/reset-mysql-password.cnf

$ mysql -u root

mysql > 

08 June 2021

How to undo (almost) anything with Git

How to undo (almost) anything with Git


https://github.blog/2015-06-08-how-to-undo-almost-anything-with-git/



 

checkout, reset, restore, revert, and switch. What do they really do?

 checkout, reset, restore, revert, and switch. What do they really do?

Written by torek, etc.


https://stackoverflow.com/questions/58003030/what-is-the-git-restore-command-and-what-is-the-difference-between-git-restor


The whole page is useful, especially from 'To add to VonC's answer, and bring into the picture all the relevant commands, in alphabetical order, I will cover:'

I also like -

$git restore -s@ -SW -- <file> 

above the aforesaid section.



07 June 2021

How to undo and redo in git?

 How to undo and redo in git?

For both undo and redo, use git reflog and git reset --hard head@{n}

You will find n in the result of git reflog.

13 April 2019

How to Reset Windows Server 2008 R2 Administrator Password

How to Reset Windows Server 2008 R2 Administrator Password





In the past, when someone forgot their password to a Windows machine, the only known remedy was to reinstall the operating system. This was as true for personal computers running Home versions of Windows as for Windows Server products like Server 2008. Today, that is no longer the case. There are several tools that will allow you to reset a Windows Server password, and most of them are relatively easy to use if you have some experience working with computers.
That being said, the case is different for novice users. Users who have never reset a password on a Windows machine before may find a couple of these methods to be a little tricky. Choose the one that you are most comfortable with, and follow the steps in the description.

Method 1: Reset Windows Server 2008 Password via Reinstall

Some administrators still prefer the old way of reinstalling the server OS if they forget the password. Maybe they have had bad experiences with password reset tools; maybe some of their data had been compromised; or maybe they are not comfortable using freeware applications, which can pose security and other risks. If you are one of the "old school" administrators and this is how you want to do it, then here's how to reinstall Windows Server 2008:
Step 1. Before doing anything, please take a backup of all your local data. Since you are doing a full reinstallation of Windows Server, this is absolutely essential. Do not proceed without doing a backup.
Step 2. Next, get your installation disk for Windows Server 2008 R2, insert it into your server PC and wait for the Install Windows screen to appear. Enter all the basic preferences such as language, time and currency format and keyboard input method and click on "Next". You will now see a button that says Install Now. Click on that.
Step 3 . The Installer window will ask you to select an operating system. Select the appropriate one and click on Next. Now accept the licence terms and click on "Next" again. The next option will be to choose the type of installation. The options are Upgrade and Custom. Unless you have purchased a licence for server 2012 or 2016, choose the Custom option.
Windows Server 2008 Password Reset
Step 4 . Select the disk location details and click on Install Now, and the installation will begin. Your server will restart once the installation is complete. This particular method will prepare your computer for first use, which means the password must be changed before logging on for the first time. This is where you enter a new password, confirm it, and proceed to the next step.
Step 5 . You may now configure the server and activate the licence.
Note: You need to realise that since you are reinstalling the operating system, all the information in the local drives will be overwritten. That means you will need to take a backup of all your data prior to doing the reinstallation. This is also a labour-intensive task, so if you don't want to go through so much trouble, try the next method described below.

Method 2. Reset Windows Server 2008 Admin Password in One-Click

TunesBro WinGeeker Ultimate is a finely tuned piece of software that can reset various types of password on Windows machines. It has been extensively tested even before its first release, and testing has been done on over 1600 models of PCs, laptops and tablets.
Because of the extensive testing and the continuous feature and capability additions to the software, it has an amazing recovery rate of 100% for Windows passwords. Using this utility will allow you to reset Windows Server password with absolutely no trouble and no disturbance to your data.
Main Features of WinGeeker Ultimate
  • Easily reset Windows Server 2008 .
  • Support local and admin password on Window Server.
  • Add new user account and password for login.
  • Create bootable password reset disk from USB or DVD.
 

Step 1 Install TunesBro WinGeeker

On a different Windows machine, download and install TunesBro WinGeeker Ultimate. Now insert a USB drive or a writable DVD / CD and launch the program.
install wingeeker

Step 2 Make Password Reset Disk

On the software interface you will see two burning options. Depending on what media you inserted, click on the 'Burn' option against that choice. Your bootable media will now be created in a few moments.
install wingeeker

Step 3Change Boot Order on Windows Server 2008

Now take the DVD/CD or drive and insert it into the locked Windows Server. Boot up the machine and enter the boot menu to change the boot order. You can do this during the boot process by pressing F2 or another special key that will be shown on the screen.
insert USB drive

Step 4 Reset Administrator Password of Windows Server 2008 R2

Once you see the TunesBro WinGeeker interface, select the correct ISO file, which will be the Server 2008 R2 OS version. Then select the admin username and click on ‘Reset Password'. You can now click on the "Reboot" button, then remove the media from the server and restart the machine normally. You will be able to enter the admin account without requiring a password.
start to reset Windows password

Method 3: Recover Server 2008 Password via Offline NT Password & Registry Editor

This popular utility is also known as NT password or, simply, chntpw utility. It's a fast way to reset Windows machine password, and there is no need to do a full backup before executing this particular process.
The method requires a little bit of command line work, but most of it is restricted to leaving the default option as it is and simply hitting the Enter key multiple times. You must follow the process from start to finish as it is described below in order to reset your Windows Server password without disturbing any other system files.
Here is how to use NT password to reset your Windows Server 2008 R2 password. Obviously, since you don't have the password for your server machine, the first two steps will need to be executed on a different PC:
Step 1. First of all, you will need to download Offline NT Password & Registry Editor and extract the ISO file from the ZIP file that you downloaded. You will now need to create bootable media from this ISO file.
Step 2. The next step is to insert this bootable media into the server machine and boot up the system. You will now see the command line interface for NT Password after the initial boot process. Press Enter to select the default boot option and proceed.
Step 3 . From here on, you can simply type 1 and press Enter at every option. In the step that asks you to select the appropriate username, type in the username for the account which you need to clear the password for.
Step 4 . The last step is to exit the application and confirm writing the registry. You can do this by pressing '!' and Enter, then the letter 'q' and Enter again, and then 'y' and Enter when asked to confirm registry writing. You should see an 'EDIT COMPLETE' message on the screen if you have followed all the steps correctly.
NT Password
Although steps are fairly straightforward, a lot of administrators are reluctant to use the software because it is open source. That means there has been no security updates for a long time, and using the software on a company server could compromise customer data or lead to other complications. If you are in this position, try the third method described below.

Summary

The first method is obviously not required unless you really want to do a reinstallation of Windows Server 2008 R2 for some reason. The second choice does have its own drawbacks as well, such as being outdated and prone to security risks. The recommended choice, therefore, is option 3, which is highly reliable and trusted by millions of users around the world. However, it is entirely up to you to choose which method you want to use to reset your Windows Server 2008 R2 password.

29 September 2014

Definitive Guide: Factory Reset Brother HL-2170W Wireless Printer

http://binglongx.wordpress.com/2013/06/23/definitive-guide-factory-reset-brother-hl-2170w-wireless-printer/

The little printer was easy to set up initially, see a previous post. However, Brother does not have very good configuration support if anything changes in the wireless network, for example, your wireless router, SSID or key. Supposedly you just need to re-connect the Ethernet cable, and re-run Wireless Setup Wizard for Windows to let the printer know your new wireless network information, and restore printing. What you may often see, however, is that the Wizard reports it could not find the printer at all, letting alone allowing you to change its configuration.
The problem is that the printer is stuck with the stale network information and even prevents configuration connections. Whenever the PC cannot see the printer, the recommended approach is to factory reset the printer and redo the setup process. You can find the official factory reset instructions here. However, the instructions are too concise and do not tell you what is normal and what is not during the process, and you could wonder if you did it right. I stumbled a few times on that. By combining the official instructions with Brother HL-2170W: Installation Gotchas + Reset to Factory Settings and How do I configure the wireless printer with the temporary use of a network cable and install the printer driver in Windows, and after some experiments, I believe below is the best guide available over the internet for factory resetting Brother HL-2170W:
  1. Turn off the printer.
  2. Remove the Ethernet cable and USB cable from the printer.
  3. Remove paper from printer and close the front cover. Removing paper is optional and to save paper and toner; if you go wrong, the printer may print TEST PRINT pages, which I have had a bunch…
  4. Hold the Go button and turn on the printer. In fact the Go button is the only button that you can operate. It is white, and has blue light when on.
  5. Keep the Go button pressed down until the Toner, Drum and Error LEDs light up. For my printer, as soon as I power up the printer all the three LEDs light on immediately.
  6. Release the Go button and make sure the Toner, Drum and Error LEDs go off. Again, for my printer, the three LEDs go off right after I release the Go button. At this time, all the LEDs and the Go button light are off.
  7. Press (and of course release) the Go button 7 times. When the Go button is pressed, its blue light is on. After 7 presses, all the LEDs and the Go button light are off. For a few seconds, the printer may not seem to respond to your presses at all. Don’t worry, I believe it is just unsure and waiting for you to press more if you want to do some other secret settings. For example, pressing Go more times can print the TEST PRINT page.
  8. After the waiting period (for my printer this silence takes about 10 seconds), all the Toner, Drum and Error LEDs and the Go button light come on briefly and go off, then the Go button light slowly flashes for a few times. This means the factory reset is successful.
  9. After the factory reset, as you usually see when the printer is turned on, it makes some noise and then the Go button remain lit. The printer is now ready.
If you believe you go wrong in the middle, just turn off the printer and start over. The procedure above could be too much for first time users. In my point of view, since any change in network settings essentially requires resetting the wireless printer, Brother could have really added a reset button in the back of the printer and made it painless.
Once your printer is reset, you can use an Ethernet cable to connect it to your home network. If your router has a DHCP server, HL-2170W will try to get an IP there. The instructions say that you may need to wait for 1 minute, but I can see that the printer gets an IP right away from my router in the router’s management page. It is also shown that the printer names itself as BRNxxxxxxxxxxxxxx in the DHCP client list.
Now you just need to run Wireless Setup Wizard for Windows, and it will see the printer with the BRNxxxxxxxxxxxxxx host name and IP from DHCP. You just need to follow the rest of Installing Brother HL-2170W Wireless Laser Printer to finish the installation.

15 February 2013

How to reset password of mysql to none?

http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

For Windows, use

mysql\bin>mysqld-nt --skip-grant-tables


C.5.4.1.3. Resetting the Root Password: Generic Instructions
The preceding sections provide password-resetting instructions for Windows and Unix systems. Alternatively, on any platform, you can set the new password using the mysql client (but this approach is less secure):
  1. Stop mysqld and restart it with the --skip-grant-tables option. This enables anyone to connect without a password and with all privileges. Because this is insecure, you might want to use --skip-grant-tables in conjunction with --skip-networking to prevent remote clients from connecting.
  2. Connect to the mysqld server with this command:
    shell> mysql
    
  3. Issue the following statements in the mysql client. Replace the password with the password that you want to use.
    mysql> UPDATE mysql.user SET authentication_string=PASSWORD('MyNewPass')
        ->                   WHERE User='root';
    mysql> FLUSH PRIVILEGES;
    
    The FLUSH statement tells the server to reload the grant tables into memory so that it notices the password change.
You should now be able to connect to the MySQL server as root using the new password. Stop the server, then restart it normally (without the --skip-grant-tables and --skip-networking options).