21 June 2024
13 June 2024
05 June 2024
'Error loading MySQLdb module. Did you install mysqlclient?'
In project/setting.py
Insert the following 2 lines -
import pymysql
pymysql.install_as_MySQLdb()
14 Free Online Tools You Should Know About
https://gizmodo.com/14-free-online-tools-you-should-know-about-1851511822
1. Convert Word to PDF
2. Create a GIF
3. Compress images
4. Edit PDF files
5. Unzip file archives
6. Generate QR codes
7. Convert between units
8. Add watermarks to images
9. Remove image backgrounds
10. Extract text from images
11. Trim audio clips
12. Pick out colors
13. Translate text between languages
Googel Translate
or
ChatGPT
14. Make calculations
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 >
20 May 2024
How to Set up SSH Access to Github
==================================
How to Set up SSH Access to Github
==================================
1. Generate both public key and private key
-------------------------------------------
On your machine, change directory to ~/.ssh
$ ssh-keygen -t ed25519
You have got two files - 'id_ed25519' and 'id_ed25519.pub'. One is the public key, the other the private key. The public key file name has '.pub' at the end. The private key file has not.
2. Put public key on Github
---------------------------
Open github website. Log in. Click the Profile icon at the top right hand side corner > Settings > 'Access | SSH and GPG keys' > 'SSH keys | New SSH key'. Paste your public key there.
3. Copy your repository SSH address
-----------------------------------
Click profile icon > 'Your repositories'. Click one of the repositories > Code > SSH. Click the copy icon.
4. git clone
------------
Go back to your machine. You can git clone already.
$ git clone <Github SSH address> # (without <>)
5. git remote add origin
------------------------
Change directory to the branch. Append the SSH address to the following command, and run the command
$ git remote add origin <Github SSH address> # (without <>)
Change directory to .git/ under the branch directory.
Open ~/.git/config, you would see
[remote "origin"]
url = git@github.com:<githubUserName>/<branch>.git
6. Delete branch https address
------------------------------
If you used to use password/token access to Github, then there must be an http url in the config file. Remove it, otherwise Github will still ask for your password/token.
7. git pull or push
-------------------
You can now git pull and git push now.
$ git pull origin main
$ git push origin main
Subscribe to:
Comments (Atom)