Posts

Showing posts from 2023

ffmpeg to convert MPEG4 to Animated GIF

In short, use the following command to do the conversion: ffmpeg -i source_file.m4v -filter_complex "[0:v] split [a][b];[a] palettegen [p];[b][p] paletteuse" output_trimmed_enhanced.gif Reference: https://www.bannerbear.com/blog/how-to-make-a-gif-from-a-video-using-ffmpeg/

Using Conda behind firewall

 To use conda behind firewall, in Windows: 1) Edit the .condarc channels: - defaults proxy_servers:   http: <proxy_host>:8080   https: <proxy_host>:8080 ssl_verify: False NOTE: Beware doing something like this: http: http://proxyhost:8080 https: http://proxyhost:8080 Don't add "http://" above, it's wrong! 2) Using pip (need to trust the hosts) pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pandas Some other better methods exist, the above is just one of the options that works.

Bind port 80 for normal user in Linux

To bind port 80 for normal user in Linux, use 'authbind' Steps: 1. sudo apt get authbind 2. sudo touch /etc/authbind/byport/80 3. sudo chown user:user /etc/authbind/byport/80 4. chmod 500 /etc/authbind/byport/80 5. authbind --deep <command to run> (e.g. quasar dev)

Favourite LS_COLORS

Just wanna have my script files  (Python script, Shell script)  shows color in ls: LS_COLORS=$LS_COLORS:'*.py=0;94:*.sh=0;94' ; export LS_COLORS 

Watch git log automatically

Image
Linux one-liner to watch and refresh git log every 30 secs: watch --color -n 30 "git fetch; git log origin/master -30 --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --color=always"

scp windows recursive copy problem

 In you encounter scp problem when doing a recursive copy from Windows to Linux, try adding the -O parameter. scp -r -O sample-files/ target-server:/target-path/

Run X11 application in docker

 To run X11 / X-Window application in docker, the following tutorial provides a simple approach to archive it: https://blog.yadutaf.fr/2017/09/10/running-a-graphical-app-in-a-docker-container-on-a-remote-server/

Stop QGIS from generating the .aux.xml files when opening GeoTiff files

Start QGIS Go to "Settings" > "Options" In Options window, find "System", then "Environment" Add environment variable "GDAL_PAM_ENABLED" with value equals "NO" Restart QGIS Reference:  https://blog.csdn.net/u014311125/article/details/108625203

Compile fanvanzh's 3dtiles in Linux

Working for fanvanzh's 3dtiles Linux compilation for days. Some items for reminding everybody how wants to do the same thing. liwei0705 did a good move in making fanvanzh's 3dtiles converter works. But if you are using a new version of OSG and GDAL, pay attention to the following summarised reminders when building your own version of "_3dtile" Delete 3dtiles/bin, it is for windows only Compile your own OpenSceneGraph Copy OpenSceneGraph /lib to 3dtiles Copy OpenSceneGraph /include/* to 3dtiles/src/osg/* If not compile OpenSceneGraph on your own, you can install "openscenegraph" and "libopenscenegraph-dev" instead Delete /lib in 3dtiles (the /lib is for self-compiled OSG, GDAL actually) Delete 3dtiles/src/osg/ (no need to provide OSG header, use the one in libopenscenegraphi-dev) Install gdal-bin, libgdal-dev rm -rf 3dtiles/src/gdal (we will use libraries and header by gdal-bin and libgdal-dev) Source file: src/tileset.cpp Hide up #ifdef _WIN32 , ...