Buy Me a Coffee

[Ubuntu] External hard drive is read-only

Yesterday I installed Ubuntu on my PC, but I met an issue about the external drive is always the read-only. As the hard drive was the destination of my internal minio server, so I have make it writable too. Error: mkdir: cannot create directory ‘abc’: No such file or directory When I ran the df -T, it shows like /dev/sdb2 fuseblk 3907000316 278934580 3628065736 8% /media/username/InternalBackup I labelled the hard drive name as InternalBackup in the Windows OS before. ...

[microk8s] Troubleshooting Microk8s Installation on macOS

Error: Your Command Line Tools are too outdated By following the instruction from the official website Alternative install methods: macOS, I got an error while running brew install ubuntu/microk8s/microk8s as shown below As the prompt suggested, I installed the latest Xcode from the AppStore. (It took quite long to be honest). But it still showed the same error after updating the Xcode to the 13.2.1 The trick is that we should run the following commands: ...

[Git] How to work with remote repository (with example)

When we manage and maintain a public github repository, it is common to see a case that a fixed branch from outside contributor’s is staled. The reasons can be The github repository owner/maintainer and contributor did not actively process the issue in time. The contirbutor only commited the changes in his branch but didn’t make a pull request, and after a period, he is not reachable. Other reasons… Overall, it is not easy to maintain a public github repository, especially the one with lots of stars. This post will show a way to solve the above issue with a git feature. ...

[Git] How to ignore the commited file

In Git, we can ignore to track of a file or folder by adding their paths into the file .gitignore. However, sometimes we could mistakenly commit and push file and folders that are not needed to be tracked by Git. In such case, .gitignore will be not working. The issue can be solved by the below steps: Add the file path into .gitignore file. Remove the commited file from the git cache by git rm --cached bar/foo.log Commit the changes by git commit -m "xxx" After executing the above steps, you can see the file bar/foo.log is still there but will be not tracked by Git. ...

[macOS] How to set environment variable on macOS

It is very common for developers to set Environment Variable while doing some development work or configuring the development environment. There are two kinds of Environment Variable: temporary and permanent. This post will show how to set both on macOS 1. Temporary environment variable We can simply execute the below command in the Terminal export [env_key]=[env_value] For example, to set DEBUG_MODE to true before running the development project. export DEBUG_MODE=true 2. Permanent environment variable Go to the user working directory to locate the file .bash_profile. Normally we can use vi ~/.bash_profile. Add the below command to the bottom of the file export [env_key]=[env_value] Save the changes with :wq in vim Refresh the cache of .bash_profile with source ~/.bash_profile After setting the environment variable, we can type echo ${env_key} to validate if it is successfully set. ...

[Inkscape] How to smooth svg file with Inkscape

Again, Inkscape is a free and open-source vector graphics editor. Open Inkscape Right click and choose Trace Bitmap, just simply click OK After trace bitmap, the original svg file is still in the background, we need to resize the front processed svg in order to showing out the original svg file. And delete it Done In this example, the svg image has full black color surround it. We should make some space for it so that it can look better. Set image size 22px, document size 24px, starting point is (1,1)

Windows Handbook (🚧Continuous Update)

1. Find the running process with <PORT> netstat -ano | findstr :<PORT> 2. Delete the running process with <PID> taskkill /PID <PID> /F # Or tasklist /FI "PID eq <PID>" 3. Find the running Named Pipe Open the powershell with the administrator permission and execute get-childitem \\.\pipe\ | grep "me.clic.ipc.v1"

[Inkscape] How to Convert Svg to Png with Inkscape

Inkscape is a free and open-source vector graphics editor. Open the graphic software Inkscape Drag the svg file into the software Adjust the width and height Press Shift+Ctrl+E to open the dialog of Export PNG Image Change to Page tab and adjust the Width and Height. Set up the output path with the button Export As Export the file with the button Export

[HTTPS/TLS] How does HTTPs work

Another way to ask this question is what will happen after typing a https url in your web browser? The browser requests secure page (HTTPs) from a web server. The server sends its public key with its SSL certificate, which is digitally signed by a third party, or we call Certificate Authority, or simply CA. Once the browser gets the certificate, it will check the issuer’s digital signature to make sure the certificate is valid. As we know, a digital signature is created by a CA’s private key, and the browser, either Chrome or Firefox, is previously installed with many major CA’s public keys. Thus, digital signature can be verified. Once the certificate’s signature is verified, the digital certificate can be trusted. The browser creates one symmetric key, or a shared secret. It keeps one and gives a copy to the web server. However, the browser does not want to send the shared secret in plain text. Therefore, it uses the web server’s public key to encrypt the secret, and then sends it to the web server. When the web server gets the encrypted symmetric key, it uses its private key to decrypt it. Now the web server gets the browser’s shared key. From now on, all traffic between the client and the web server will be encrypted and decrypted with the same key, a symmetric key.

[Inkscape] How to create SVG file with an existing SVG image

Sometimes we need to extract part of the SVG from the original SVG image. This post will show how to do it with Inkscape. I will take the Storadera logo as an example. Go to Storadera website, we can see the company logo and download the logo Open the logo with web browser and inspect the element. We can see the logo is originally svg file. Open the graphic software Inkscape Drag the downloaded logo into the software Ungroup the logo Delete the text part, only keep the logo Place the logo at (0,0) Record the original width and height in specific unit Press Shift+Ctrl+D to edit the width and height and tick the Checkerboard background option Hold Ctrl and scroll the mouse to zoom up the image if it is too small Adjust the image position with up, down, left, and right arrow key Hold Ctrl and hover the mouse on the double direction arrow to adjust the image size. This will make a margin for the final image, which looks better Repeat the step#11 again for the image Change the color if necessary Save the file as a plain svg format

DigitalOcean Referral Badge
Sign up to get $200, 60-day account credit !