Add the following to the .tmux.conf:
unbind -n Tab
Wow, TAB is back!
Wednesday, May 20, 2020
Monday, May 18, 2020
Using GDAL with SpringBoot in Ubuntu
To use GDAL with SpringBoot in Ubuntu:
Reference: http://geoexamples.blogspot.com/2012/05/running-gdal-java.html
- 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
Sunday, May 10, 2020
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"
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"
Wednesday, February 5, 2020
Windows 10 Build 1909 search bar returns nothing but just a black page
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
Thursday, January 9, 2020
Dunning Kruger Effect
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
Friday, January 3, 2020
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 performance, etc.)
Reference:
https://amp.reddit.com/r/Kotlin/comments/bo1ur4/kotlin_vs_qt_for_mobile_apps/
Tuesday, December 17, 2019
Keep the color prompt in tmux
To keep your prompt (PS1) with color shown in tmux screen, add the following property in .bashrc:
force_color_prompt=yes
force_color_prompt=yes
Create docker container with the simple flask application
I will try to create a docker container with the simple flask application created some times ago.
First, I create a shell script for starting the flask application, namely "boot.sh":
boot.sh
#!/bin/sh
export FLASK_APP=simple.py
flask run --host 0.0.0.0
export FLASK_APP=simple.py
flask run --host 0.0.0.0
Second, we need to create a requirements.txt file:
requirements.txt
flask==1.1.1
Actually you can run the following to get the requirements.txt:
pip freeze > requirements.txt
Third, together with the simple.py file created in the simple flask application, put those 3 files in an "app" directory:
app/
- boot.sh
- requirements.txt
- simple.py
Forth, create a Docker file outside the app directory:
Dockerfile
FROM python:3.6-alpine
WORKDIR /home/app
COPY app/ ./
RUN chmod +x ./boot.sh
RUN pip install -r requirements.txt
EXPOSE 5000
ENTRYPOINT ["./boot.sh"]
WORKDIR /home/app
COPY app/ ./
RUN chmod +x ./boot.sh
RUN pip install -r requirements.txt
EXPOSE 5000
ENTRYPOINT ["./boot.sh"]
Build the docker image using the Dockerfile:
docker build -t simple:latest .
Run the docker container with the docker image we just created:
docker run -d -p 5000:5000 simple:latest
Check "http://localhost:5000" to check the Flask application.
Simple Flask sample
Just wanna to create a very simple Flask application in a single python source file:
simple.py
To run this Flask application, run the following:
Now, navigate "http://localhost:5000" to see the word "Hello World" displayed on the browser.
simple.py
from flask import Flask
application = Flask("simple")
@application.route("/")
def index():
return "Hello World"
To run this Flask application, run the following:
- export FLASK_APP=simple.py
- flask run
- flask run --host 0.0.0.0
Now, navigate "http://localhost:5000" to see the word "Hello World" displayed on the browser.
Monday, December 16, 2019
Navigate tmux splitted pane using mouse
To enable navigation on tmux splitted pane using mouse
In tmux environment, do the following:
In tmux environment, do the following:
- Ctrl-b
- Type :setw -g mouse on
Done, try to switch your tmux pane with mouse.
Note:
To make this setting persistent, save this line in .tmux.conf:
setw -g mouse on
To make this setting persistent, save this line in .tmux.conf:
setw -g mouse on
Subscribe to:
Posts (Atom)
CSP on Apache
To add CSP to root if sort of funny. The following will NOT work for most cases !! <LocationMatch "^/$"> Header s...

