Posts

Showing posts from 2020

Using icacls.exe command to change the permission of a folder

Use following command to change the permission of a folder:  C:\folder> icacls FOLDER_NAME /grant user_id:(OI)(CI)(F) Reference:  https://stackoverflow.com/questions/38725364/icacls-permissions-not-applying-as-i-expect F - Full Access OI - Inherit file CI - Inherit sub-folder

Ubuntu WiFi device disappear with dual boot Windows 10

 When your device is dual boot with Ubuntu and Windows 10, you'll got a chance to lose the WiFi device in Ubuntu. To fix this issues, try to disable the "Fast Startup" feature in Windows 10. It solves the problem for me, hope this work for you too.

Ubuntu apt-get update with NO_PUBKEY error

 In Ubuntu, I'd encountered the following error when doing a apt-get update : The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F7E06F06199EF2F2 This key belongs to the repository https://qgis.org/ubuntu. To add the key, I did the following: sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 F7E06F06199EF2F2 By default, the command above will called gpg which uses port 11371. I had to force command   to use port 80 instead. Also, please also pay attention that the protocol is called "hkp://" Ref: https://askubuntu.com/questions/1119727/gpg-keyserver-receive-failed-connection-timed-out

Stop / hide up pcieport error in Ubuntu / Linux

 Number of ways  to try in grub: pci=nomsi pci=noaer pcie_aspm=off Actual steps: sudo vi /etc/default/grub Edit line: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pci=noaer" sudo update-grub Reboot machine

Restart / Reboot Linux

To restart Linux anytime: Hold Alt-SysRq (i.e. PrtSc) and type R E I S U B Reference: http://blog.kember.net/articles/reisub-the-gentle-linux-restart/

Console log freezes / hangs in Eclipse

Sometimes your Eclipse console log becomes very jerky, freezes or even hang up. It's very likely that your console log got something which is very long without word warp. It can even causes Windows itself becomes freezing too! So make your console "Word wrap". Or set a width limit on the console in Eclipse preference. The problem will be solved.

SQL Developer installation in Windows 10

 Quick suggestion for getting the SQL Developer to work in Windows 10: Get the SQL Developer (with JRE) edition. I got bad experience when getting SQL Developer to work with my own JDK 1.8 installation in Windows 10. No matter where I copy the MSVCR100.DLL (It always said JAVA_HOME\jre\bin\msvcr100.dll cannot be launched, crazy). So, just get the "with JRE" version. The font size are crazily small on a high DPI screen. So get a larger font, right-click on the "sqldeveloper.exe", choose "Compatibility > Change high DPI settings > High DPI scaling override > System (Enhanced)" (Reference:  https://christian-gohmann.de/2018/10/25/running-sql-developer-on-high-dpi-screens/ )

Command line to stop Windows 10 updates

To stop Windows 10 updates: > net stop wuauserv > net stop bits > net stop dosvc Resume it: > net start wuauserv > net start bits > net start dosvc Ref:  https://lifehacker.com/pause-windows-10-updates-easily-from-the-command-line-1786614642

Sign and verify your file using SSL / OpenSSL

I want to learn know to sign and verify my file using SSL / OpenSSL. And I'd found Enrico Zimuel has did a very nice illustration on this issue: https://www.zimuel.it/blog/sign-and-verify-a-file-using-openssl

Add git information to your bash prompt

To show git information in your bash prompt, add the following function in your ~/.bashrc function git-shell() {   export GIT_PS1_SHOWDIRTYSTATE=1   export PS1='\[\033[01;33m\] (git) \[\033[01;34m\]\w$(__git_ps1 " \[\033[01;32m\](%s)")\[\033[00m\]\n\$ ' } Then, in your bash, run "git-shell" and you will get a nice git prompt: (git) /path_to_your_git_project (master *) $

curl returns "ssl_choose_client_version:unsupported protocol" error in Ubuntu 20.x

If you encountered  "ssl_choose_client_version:unsupported protocol" when using curl in Ubuntu 20:      $ curl https://somehost/   curl: (35) error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol It may because the "somehost" only accepts old protocol (e.g. TLS v1, etc.), but in Ubuntu 20.x, the OpenSSL assumes minimum = TLS v1.2 by default.  If the "somehost" just cannot upgrade to TLS v1.2, you might consider fixing it with the following: 1) Modify  /etc/ssl/openssl.cnf Search for the line "oid_section = new_oids" Add the following lines below it: openssl_conf = default_conf [default_conf] ssl_conf = ssl_sect [ssl_sect] system_default = system_default_sect [system_default_sect] MinProtocol = TLSv1.1 CipherString = DEFAULT@SECLEVEL=1 2) curl "somehost" with the following parameters $ curl --tlsv1 https://somehost 3) If the "somehost" just using a self-signed certificate      $ curl -k --tlsv1 https://som...

SQL Developer JavaFX problem

When running SQL Developer in Linux, you may encounter the "JavaFX" problem stating that the JavaFX libraries / components are not found. To solve this issue, you can consider the following solution: Install SDKMAN Use SDKMAN to install either "OpenJDK 11" or "Zulu JDK with FX" sdk install java 11.0.7-open                     OR sdk install java 8.0.252.fx-zulu Check the SQL Developer "product.conf" file to make sure the correct JDK is used. ~/.sqldeveloper/<version>/product.conf SetJavaHome /path_to_java_home If you just comment out the "SetJavaHome" variable, then the current JDK you use will be used with SQL Developer. Enjoy!

Tab key not working in tmux

Add the following to the .tmux.conf:     unbind -n Tab Wow, TAB is back!

Using GDAL with SpringBoot in Ubuntu

To use GDAL with SpringBoot in Ubuntu: Apt install gdal-bin, gdal-data, libgdal-java (optionally libgdal26, don't know whether it's necessary) Set the Environment variables in Eclipse: GDAL_DATA = /usr/share/gdal LD_LIBRARY_PATH = /usr/lib/jni:$LD_LIBRARY_PATH Reference:  http://geoexamples.blogspot.com/2012/05/running-gdal-java.html

OpenShot UI too large on screen in Windows

OpenShot UI could become very large in your Windows if you can set your screen scale to something like 150%. To resolve this issues, you may adjust the " QT_AUTO_SCREEN_SCALE_FACTOR " value: Add line SET QT_AUTO_SCREEN_SCALE_FACTOR=0 before launch.exe in the batch file " C:\Program Files\OpenShot Video Editor\launch-win.bat " Reference: https://github.com/OpenShot/openshot-qt/issues/2443 If you are using the PortableApps's build, you can add the line " QT_AUTO_SCREEN_SCALE_FACTOR=0 " under the " [Environment] " in file " OpenShotPortable.ini " in " \OpenShotPortable\App\AppInfo\Launcher "

Windows 10 Build 1909 search bar returns nothing but just a black page

Image
The search bar just failed (no result but just a black screen) after Windows 10 Build 1909 update. Sigh... Windows is still windows. To solve it, disable the Bing search in Windows: regedit Go to "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" Add DWORD "BingSearchEnabled", value = 0 Add DWORD "CortanaConsent", value = 0 Restart Reference:  https://www.howtogeek.com/224159/how-to-disable-bing-in-the-windows-10-start-menu/

Dunning Kruger Effect

Image
What is Dunning Kruger Effect? To my knowledge, DKE means you are overconfident when you just know nothing about a particular area, and you think it would be very easy and joyful to work on it. But of course, the truth is that when you drilled deeper to the area, you will it's not easy to accomplish the stuff, and you lose your confidence. The situation will be improve when you got more and more knowledge, you'll get back your confidence eventually. So how to cope with Dunning Kruger Effect? Keep learning ;P

Cross platform application framework

Summary of cross platform framework: Qt - UI is too old and outdated; complicated build process for mobile React Native - Not pixel-perfect as it just maps to native UI; Kotlin Native - Ecosystem is very poor but the good thing is you can use the native libraries in each platform and create wrappers to unify them; also the framework itself hasn't yet reached production stage; you have to write the UI separately for each platform Flutter - Very poor ecosystem/libraries; Xamarin Forms - Like react native as it maps to native UI; slow startup; Xamarin Native - Like kotlin native as you have to write separate UI codes for each platform; but uses arguably the best programming language in C#; and backed by Microsoft which is even more reliable than Google; also supports the most number of platforms including UWP, WPF, MacOS, etc. on top of iOS and Android; you have the support of the entire .NET ecosystem Nativescript - Performance is terrible (build time, startup time, Angular performan...