Automatic code analysis with Bistr

If you need to analyze the source code of a project, but want to automate this process and use the local power of your computer, the Bistr utility can be a great solution. In this article, we will look at how this utility helps analyze code using the Ollama machine learning model.

What is Bistr?

Bistr is a source code analysis utility that allows you to integrate a local LLM (large language model) model such as Ollama to analyze and process code. With Bistr, you can analyze files in various programming languages ​​such as Python, C, Java, JavaScript, HTML, and more.

Bistr uses the model to check files against specific queries, such as finding an answer to a question about the functionality of the code or a part of it. This provides a structured analysis that helps in developing, testing, and maintaining projects.

How does Bistr work?

  • Load state: When you start an analysis, the utility checks whether the analysis state has been saved previously. This helps you continue where you left off without having to re-analyze the same files.
  • Code Analysis: Each file is analyzed using the Ollama model. The tool sends a request to the model to analyze a specific piece of code. The model returns information about the relevance of the code in response to the request, and also provides a textual explanation of why the given piece is relevant to the task.
  • State Preservation: After each file is parsed, the state is updated to continue with up-to-date information next time.
  • Results output: All analysis results can be exported to an HTML file, which contains a table with a rating of files by relevance, which helps to understand which parts of the code are most important for further analysis.

Installation and launch

To use Bistr, you need to install and run Ollama, a platform that provides LLM models, on your local machine. The Ollama installation instructions for macOS, Windows, and Linux are described below.

Download the latest version of Bistr from git:
https://github.com/demensdeum/Bistr/

After installing Ollama and Bistr, you can start code analysis. To do this, you need to prepare the source code and specify the path to the directory containing the files to be analyzed. The utility allows you to continue the analysis from where you left off, and also provides the ability to export the results in HTML format for easy further analysis.

Example command to run the analysis:


python bistr.py /path/to/code --model llama3.1:latest --output-html result.html --research "What is the purpose of this function?"

In this command:

–model specifies the model to be used for analysis.
–output-html specifies the path to save the analysis results in an HTML file.
–research allows you to ask a question that you want to answer by analyzing the code.

Benefits of using Bistr

  • Local execution: Analysis is performed on your computer without the need to connect to cloud services, which speeds up the process.
  • Flexibility: You can analyze code in different programming languages.
  • Automation: All code analysis work is automated, which saves time and effort, especially when working with large projects.

Radio-Maximum-Electron

Radio Maximum Electron is a powerful and convenient application designed to listen to the radio station “Radio Maximum” on your computer running Windows, Linux and macOS operating systems. This player combines ease of use with high functionality, providing you with access to the stream in real time with minimal effort.

Just download the app from GitHub:

https://github.com/demensdeum/Radio-Maximum-Electron/releases

The author has no connection with Radio Maximum, he just really likes this radio.
The main functionality is implemented by the Nativifier project

https://github.com/nativefier/nativefier

The build scripts are licensed under MIT, the runtime has its own license!

Nixy Player

Nixy Player – A small, extensible, cross-platform JavaScript runtime.

Cross-platform: available on Windows, macOS, and Linux, as well as any other platform with C++ and dynamic library support.
Lightweight: minimal resource consumption with efficient performance.
Extensible: designed to be easily extended with plugins and additional libraries.

Please visit the Releases page to stay up to date with the latest releases and updates:
https://github.com/demensdeum/NixyPlayer/releases/

Raiden Video Ripper

Raiden Video Ripper is an open source project for video editing and format conversion. It is built using Qt 6 (Qt Creator) and allows you to trim and convert videos to MP4, GIF, and WebM formats. You can also extract audio from videos and convert it to MP3 format.
Интерфейс RaidenVideoRipper

Still from COSTA RICA IN 4K 60fps HDR (ULTRA HD)
https://www.youtube.com/watch?v=LXb3EKWsInQ
Please visit the Releases page to stay up to date with the latest releases and updates:
https://github.com/demensdeum/RaidenVideoRipper/releases

FatBoySize – utility for displaying the size of folders and files

FatBoySize is a utility for displaying the size of folders and files in the terminal.
Works on any system that supports Python 3.

Run: python3 fbs.py
Output mode 1: python3 fbs.py -v
Output mode 2: python3 fbs.py --version

Only works for the current open path in the terminal.

Example of the result:
python3 ~/Sources/my/fatboysize/fbs.py
.local -> 145.GB
Downloads -> 103.GB
.cache -> 37.0 GB
.android -> 11.6 GB
Sources -> 8.63 GB

As you can see, the Downloads folder is quite big

Links

https://gitlab.com/demensdeum/fatboysize/

KleyMoment – utility for gluing script files

I present to your attention a utility for gluing script files – KleyMoment, as well as a reverse utility for ungluing files back. The utility can be used to glue JavaScript files into one.
The tool is implemented in Python 3 and has a simple command line interface of the form:

python3 KleyMoment.py extensionFiles directoryContainingFiles outputFile

For example, recursive merging of js files from the scripts directory into the output.js file

python3 KleyMoment.py js scripts output.js

Also a utility for unsticking files back AntiKleyMoment, it takes a glued file as input, for example:

python3 AntiKleyMoment.py output.js

Repository:
https://gitlab.com/demensdeum/kleymoment/

Slowride Block Devices Benchmark

Slowride is a utility for testing the read speed of block devices for POSIX compliant operating systems with root access to /dev/sd*. You can test the read performance of block devices using a time threshold to diagnose read performance.
Command to read 100mb blocks on the entire device with output of blocks above the threshold of 2 seconds:

sudo ./slowride /dev/sda 100 2000

Source code

https://gitlab.com/demensdeum/slowride

Swift 4.2.3 – Ubuntu 18.10

Build Swift with the necessary libraries to run on Ubuntu 18.10. The latest version available on the Apple website – for Ubuntu 18.04. Based on the build from the official website with the addition of libraries from Ubuntu 18.04. Also added a sample script to add PATH and LD_LIBRARY_PATH for the bash terminal:
http://www.mediafire.com/file/lrs74mvoj3fti03/swift4.2.3.ubuntu.18.10.x86_64.tar.gz/file