Execute the following command (as root): To put in in a crontab, to execute every 6 hours (assuming the script with the command at /root/clean_caches.sh): Source: https://github.com/microsoft/WSL/issues/4166
-
-
RDP server on Kubuntu 18.04
These steps allow remote access to the graphical terminal on a Kubuntu 18.04 installation. Install the following packages Enable the xrdp service Check that the xrdp server is listening (port 3389 should be active and open in the system’s firewall) Create the following files to prevent password authorization prompts during RDP login:
-
Java object to JSON serialization
How to serialize/de-serialize objects to/from JSON in Java: http://websystique.com/java/json/jackson-convert-java-object-to-from-json/ http://programmerbruce.blogspot.com/2011/05/deserialize-json-with-jackson-into.html
-
Fix serializations issues in spring-boot REST JSON answers
How to solve infinite recursions: https://www.baeldung.com/jackson-bidirectional-relationships-and-infinite-recursion
-
IPTables tips
Some tips for iptables Listing nat rules iptables -t nat -v -L POSTROUTING -n --line-number Delete a certain rule iptables -t nat -D POSTROUTING (from https://www.cyberciti.biz/faq/how-to-iptables-delete-postrouting-rule/ ) Create a rule to redirect outgoing packets for a certain IP/port iptables -t nat -A PREROUTING -p tcp -d OLD_IP --dport 80 -j NETMAP --to NEW_IP (from https://linux-tips.com/t/rewriting-destination-ip-address/221)
-
CentOS firewall-cmd tips
Some tips for CentOS 7 firewall-cmd tool: Allow openvpn firewall-cmd --zone=public --add-service openvpn --permanent firewall-cmd reload Add a rule firewall-cmd --zone=public --add-port=8080/tcp --permanent firewall-cmd reload
-
How to make an older commit the latest
How to make a certain commit the latest in a repository (deleting all following commits): git reset –hard CommitId git push -f origin master (from https://stackoverflow.com/questions/40245767/delete-commit-on-gitlab )
-
GIT list status on all directories
To list status on all git repositories in a folder: find . -maxdepth 1 -mindepth 1 -type d -exec sh -c '(echo {} && cd {} && git status -s && echo)' \; (from https://coderwall.com/p/grmruq/git-status-on-all-repos-in-folder)
-
Matlab under VMWare
If a message similar to this appears: com.jogamp.opengl.GLException: X11GLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x413b9df1, isOwner false, [count 0, qsz 0, owner ]]] at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:326) at jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:297) at java.lang.Thread.run(Unknown Source) Caused by: com.jogamp.opengl.GLException: glXGetConfig(0x1) failed: error code Unknown error code 6 at jogamp.opengl.x11.glx.X11GLXGraphicsConfiguration.glXGetConfig(X11GLXGraphicsConfiguration.java:570) at jogamp.opengl.x11.glx.X11GLXGraphicsConfiguration.XVisualInfo2GLCapabilities(X11GLXGraphicsConfiguration.java:500) at jogamp.opengl.x11.glx.X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationXVisual(X11GLXGraphicsConfigurationFactory.java:434) at jogamp.opengl.x11.glx.X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(X11GLXGraphicsConfigurationFactory.java:240) at jogamp.opengl.x11.glx.X11GLXDrawableFactory.createMutableSurfaceImpl(X11GLXDrawableFactory.java:524) at jogamp.opengl.x11.glx.X11GLXDrawableFactory.createDummySurfaceImpl(X11GLXDrawableFactory.java:535) at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:283) ... 2 more Just configure Matlab to run with software opengl: >> opengl(‘save’,’software’)