Recovering MySQL Password from Homebrew Installation

I recently forgot the MySQL password on my local machine and found a way to recover it. Open and edit the configuration file my.cnf: sudo vim /opt/homebrew/etc/my.cnf Add skip-grant-tables to the configuration file: # Default Homebrew MySQL server config [mysqld] skip-grant-tables # Only allow connections from localhost bind-address = 127.0.0.1 mysqlx-bind-address = 127.0.0.1 Restart the service: sudo brew restart mysql Connect to MySQL: mysql -u root -p Flush privileges: FLUSH PRIVILEGES; Change the account password:...

2025-02-05 · 1 min · 81 words · Kyxie

Formatting USB Multiple Partitions

After using a USB drive to install a system, the drive often gets divided into multiple partitions. Below are instructions for merging it back into a single partition and formatting it on both MacOS and Windows. MacOS For detailed instructions, see: Setting up OpenWrt as a Bypass Router Using Raspberry Pi 4B+ | Kunyang’s Blog Windows Open Command Prompt: diskpart List disks: list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 931 GB 1024 KB * Disk 1 Online 931 GB 1024 KB * Disk 2 Online 7696 MB 5050 MB * Select the disk (be careful not to select the wrong one):...

2024-12-15 · 1 min · 182 words · Kyxie

Installing Python and Git on M Chip MacBook with Homebrew

Mac users strongly recommend using Homebrew to install software. For Python, downloading directly from the official website will create both IDLE and Python Launcher icons in Launchpad, which I personally find ugly. Actually, macOS Catalina comes with Python 3 pre-installed (Python 2 before that). If you only need to handle basic Python functions, you can just use the system’s built-in version. However, for the convenience of version control, it’s highly recommended to use Homebrew to download another version for easy management, avoiding impacts to the system’s Python....

2024-11-11 · 2 min · 306 words · Kyxie

Installing GUI on AWS Server

Recently I had a project that required a GUI and wanted it to run automatically in the cloud. Initially, I considered using a Windows instance, but found that even downloading a browser was very slow. As a free AWS user, I could only use the command-line-only Ubuntu Server. Then I had a spontaneous idea: what if I could install a GUI on Ubuntu Server? I looked it up and the method seemed feasible (though ultimately it’s not very practical - I’ve decided to stop tinkering with it, but I did manage to install a GUI successfully)....

2024-11-07 · 2 min · 292 words · Kyxie

Simple OpenVPN Configuration

Assume we have two Linux virtual machines A and B, where A and B act as Server and Client for each other. TLS Mode Assume A acts as the server and B acts as the client. TLS Server Download OpenVPN on A: sudo apt-get install openvpn In the /usr/share/doc/openvpn/examples/sample-keys/ folder there are sample keys. On the server, copy ca.crt, server.key, server.crt, and dh2048.pem to /etc/openvpn/tls-server: sudo cp /usr/share/doc/openvpn/examples/sample-keys/{ca.crt,server.key,server.crt,dh2048.pem} /etc/openvpn/tls-server Write the server configuration file:...

2024-04-26 · 2 min · 413 words · Kyxie

Simple LDAP Server Configuration

Linux Download OpenLDAP: sudo apt update sudo apt install slapd ldap-utils sudo apt install ldap-utils Configure OpenLDAP: sudo dpkg-reconfigure slapd DNS domain name: example.org Password: root Create user.ldif: # ldap is the username dn: uid=ldap,dc=example,dc=org objectClass: inetOrgPerson objectClass: posixAccount uid: ldap sn: LDAP givenName: LDAP cn: LDAP User displayName: LDAP User uidNumber: 10000 gidNumber: 10000 homeDirectory: /home/ldap loginShell: /bin/bash Add the user to the OpenLDAP server: ldapadd -x -D "cn=admin,dc=example,dc=org" -W -f user....

2024-02-27 · 1 min · 109 words · Kyxie

Customizing Terminal

I enjoy tinkering with decorative things and found the default Windows terminal really ugly. I planned to use Oh My Posh to beautify it. This tutorial is based on the Terminal that comes with Windows 11. Font I use the CodeNewRoman Nerd Font, which is also the font used for my blog. You can download it from here. After downloading, simply install it. You can also use this font in VS Code....

2023-04-01 · 2 min · 328 words · Kyxie