Posts

Export/Backup Ollama Model

The following commands help to export/backup the ollama models which allows to quick restore the models or setup an offline machine using file transfer. Pull a model from registry ollama pull llava:7b Export the model mkdir -p llava_7b_backup cd llava_7b_backup ollama show --modelfile llava:7b > Modelfile cat Modelfile | grep -E '^FROM' | cut -d ' ' -f 2 | xargs -I {} cp {} . cat Modelfile | grep '# FROM' | cut -d ' ' -f 3 | xargs -I {} echo 'ollama create {} -f Modelfile' > readme.txt sed -i '' -E 's/^FROM.*blobs/FROM ./g' Modelfile Import the model  cd llava_7b_backup ollama create llava:7b -f Modelfile Run the model ollama run llava:7b Remove the model ollama rm llava:7b

AWS Workspaces Client and Linux Changes

The following changes to AWS Workspaces Client and Linux will boost developer's productivity Make the following changes in the AWS Workspace Client: Menu -> Settings -> Manage Hardware Acceleration -> Enabled (Tick) Menu -> Settings -> Display Settings -> High DPI Mode (Tick) Menu -> Settings -> Switch Running Mode -> Always On (Select) Make the following tweaks inside the Amazon Linux Operating System: Settings -> Privacy -> Screen Lock -> Automatic Screen Lock -> Off Settings -> Power -> Power Saving -> Blank Screen -> Never Settings -> Power -> Suspend & Power Button -> Automatic Suspend -> Off GNOME Tweaks Extension Install the Gnome Tweaks Extension and make the following adjustment Activities -> Show Applications -> Software -> Search -> GNOME Tweaks Open GNOME Tweaks and make the following changes: Activities -> Show Applications -> Utilities -> Tweaks Appearance -> Themes -> Applic...

Java's ScheduledExecutorService example

Example of Java's ScheduledExecutorService to run a block of code once (with a delay) or repeatedly at fixed rate or fixed delay. ScheduledExecutorService can be a single threaded executor (used to execute in a coordinated way) or can be multi threaded executor (used to execute in parallel) import java.util.concurrent.Executors ; import java.util.concurrent.ScheduledExecutorService ; import java.util.concurrent.TimeUnit ; public class ExampleScheduledExecutor implements AutoCloseable { private final ScheduledExecutorService executorService = Executors . newSingleThreadScheduledExecutor (); // use newScheduledThreadPool() for running with multiple threads in parallel // private final ScheduledExecutorService executorService = Executors.newScheduledThreadPool(2); public ExampleScheduledExecutor ( long initialDelay , long fixedDelay ) { executorService .schedule(() -> executeOnlyOnce(), initialDelay , TimeUnit . SECONDS ); executorService .scheduleAtFixedR...

less - Unix / Linux command line reader cheat sheet

Useful gist that contains the common commands used in less command line reader  https://gist.github.com/harishkannarao/2bbda02dcca774c93eb3c2a0bce9de7f

vi - Unix / Linux command line editor cheat sheat

Useful gist file that contains the common commands used in vi command line editor https://gist.github.com/harishkannarao/f897f1dd60d5f3e894f93a640c0ca9c5

Jetbrains IDE - IntelliJ Customisation for Developer Productivity

Exporting current settings of any Jetbrains IDE (IntelliJ / PyCharm): File -> Manage IDE Settings -> Export Settings -> Choose location and file name as a zip file Importing settings from zip file into any Jetbrains IDE (IntelliJ / PyCharm): File -> Manage IDE Settings -> Import Settings -> Choose location and zip file The following changes to any Jetbrains IDE (IntelliJ / PyCharm) makes developers more productive. Appearance Changes: View Menu -> Appearance -> Status Bar -> Tick View Menu -> Appearance -> Status Bar Widgets -> Git Branch -> Tick View Menu -> Appearance -> Status Bar Widgets -> Line:Column Number -> Tick Settings Changes: Settings -> Appearance & Behaviour -> Appearance -> Zoom -> 90 or 100 or 110 based on Screen Resolution Settings -> Appearance & Behaviour -> Appearance -> Use custom font -> Size 16 Settings -> Appearance & Behaviour -> Appearance -> UI Options -> Show ...

sdkman - Multiple versions of Java JDK on Mac

Install sdkman curl -s "https://get.sdkman.io" | bash Verify Installation Open a new terminal and execute sdk version List candidates sdk list List available version for a candidate sdk list java Install Java LTS versions sdk install java 21.0.4-jbr sdk install java 17.0.12-jbr sdk install java 11.0.14.1-jbr Set default Java version sdk default java 21.0.4-jbr Create alias in $HOME/.zprofile to switch jdk echo "alias jdk_21_use='sdk default java 21.0.4-jbr'" >> $HOME/.zprofile echo "alias jdk_17_use='sdk default java 17.0.12-jbr'" >> $HOME/.zprofile echo "alias jdk_11_use='sdk default java 11.0.14.1-jbr'" >> $HOME/.zprofile List current default version of a candidate sdk current java List currently installed versions of a java sdk list java | grep 'installed' Install Maven sdk install maven List currently installed version of maven or other candidates sdk list maven | grep '*'