The mktemp command in Linux creates temporary files and directories with unique, unpredictable names, which is the safest way to handle scratch data inside shell scripts and system tasks. Most shell scripts you will read online create temporary files with something like /tmp/mydata.txt or /tmp/backup-$$.log, which works until two copies of the script run at the same time, or until a malicious user guesses the filename and drops a symlink in /tmp pointing to /etc/passwd. Suddenly, your harmless script is overwriting system files, and you have a real problem on your hands. The fix is mktemp, a small utility that…
Author: drweb
One of the popular features of Redgate Monitor has been the ability to add custom mertics for various purposes. This has been popular, and along with our curated list at sqlmonitormetrics.com, it’s a feature that’s used by many.It has been a SQL Server only function for awhile, but customers have requested other platforms. We’ve added the capability for Oracle and PostgreSQL.This is part of a series of posts on Redgate Monitor. Click to see the other posts.Adding Custom MetricsYou can see on my custom metric config page that I have a few business metrics added. I recommend these to customers…
When you are developing a user interface, it can be valuable to have a log of what’s going on. Creating a log in Textual, a text-based user interface, is even easier than creating one for wxPython or Tkinter. Why? Well, because Textual includes a logger that is compatible with Python’s own logging module, so it’s almost plug-and-play to hook it all up! You’ll learn how to do this in this short tutorial! Logging to File and the Console Textual includes a built-in logging-type handler that you can use with Python’s own logging module called TextualHandler. Python has many built-in logging handler…
Color detection is one of the most approachable problems in computer vision. The idea is simple: look at any pixel in an image and figure out what color it represents. Yet doing this reliably across different lighting conditions, camera types, and backgrounds requires more than just comparing RGB numbers. This guide walks through building a color detector in Python with OpenCV, covering both the RGB distance method and the HSV range method, with working code for still images, webcam feeds, and an interactive click-to-detect tool. By the end you have a complete, working color detection pipeline you can adapt for…
In this guide, we’ll explain what claude-desktop-debian is, how to build the native package without wine, and how to connect MCP servers on Linux. Anthropic ships Claude Desktop for Windows and Mac, but Linux users have been stuck with the web browser for over a year. The claude-desktop-debian project fixes that by repackaging the official Windows build into a native .deb or .AppImage that runs without Wine, without containers, and without the lag of a browser tab. You have been running Claude in a browser tab. It drains battery, eats RAM, and every time Chrome crashes you lose your conversation…
Text mining is the process of turning raw, unstructured text into structured data you can count, analyze, and visualize. In Python, a handful of libraries handles the full pipeline — loading text, cleaning it, tokenizing words, removing common filler words, and producing frequency charts that reveal what a document is actually about. This guide walks through each step of the pipeline from scratch. No machine learning required — just Python, NLTK, Pandas, and Matplotlib. What is Text Mining? Text mining, also called text analytics, extracts meaningful information from natural language by counting word frequencies after cleaning and normalizing the text.…
Functions are how you name behavior. Instead of writing the same five lines every time you need to validate user input, you write those five lines once, give them a name like validate_input, and call that name whenever you need it. That act of naming is the core purpose of a function and the starting point for everything else in this guide. This is not a beginner glossary entry. If you have written Python for a few weeks and find yourself copying blocks of code between files or writing the same logic in multiple places, this is where that habit…
The while loop in Python repeats a block of code as long as a condition evaluates to True. You use it when you do not know upfront how many iterations you need. The loop stops the moment the condition becomes False, or when you explicitly break out of it. This is the fundamental difference between a while loop and a for loop. For loops iterate over a known sequence, while loops wait for a condition to change. This guide covers the while loop syntax, the flow of execution, common patterns like counters and user input validation, and the finer details…
Optical Character Recognition lets you extract printed, handwritten, or scanned text from images and convert it into machine-readable data. If you have ever stared at a photograph of a table and dreaded typing all that data into a spreadsheet by hand, OCR is the solution. You write the code once, feed it any image, and get clean spreadsheet rows out the other end without touching a keyboard. In this article you will build two complete Python pipelines that handle end-to-end OCR on table images and write the results directly to Excel files. The first pipeline uses Pytesseract, the wrapper around…
Always normalize case and filter stopwords before analyzing word frequencies in most applications The complete pipeline from raw text to frequency comparison and visualization fits in under 100 lines of Python Save results to CSV for downstream use and generate Matplotlib charts for visual reporting Frequently Asked Questions What is the difference between tokenization and stemming? Tokenization splits text into individual units called tokens, typically words or subword sequences. Stemming reduces those tokens to their root form by removing affixes. Tokenization is a prerequisite for stemming, and both are standard steps in any text mining pipeline. Can text mining work…
