Category Archives: Tips & tricks

Beating eval() slowness in Python

Turned out, eval() function, which evaluates and executes the specified expression, is dramatically slow in Python, as the compilation is done on the fly. Seeking for a way to enhance the performance, I have stumbled at the Stackoverflow discussion which … Continue reading

Posted in Tips & tricks | Tagged , , | Leave a comment

PAM authentication useful links

Sample PAM Application and Sample PAM Conversation Function from FreeBSD documentation Writing Conversation Functions by Oracle example application from The Linux-PAM Application Developers’ Guide

Posted in Tips & tricks | Tagged , , , | Leave a comment

NoneType issues in chains of inherited dictionaries in Python

There are good hints to avoid errors like: in the brilliant Python tips 1: beware of Python dict.get() post.

Posted in Tips & tricks | Tagged , , , | Leave a comment

A single write locks the entire SQLite database for both: reading and writing

This fact is quite an unpleasant thing for a database with a lot of writes and relative seldom reads like, for example, a small packet capturing tool I write for my router. The classical mechanics of SQLite locking is described … Continue reading

Posted in Tips & tricks | Tagged , , , , , , | Leave a comment

A quick memo on creating virtual machines using VirtualBox CLI

Sorry people, I have to leave it here because at my age I still have trouble organising records in a way that allows me to find notes without being surprised by the cryptic scribbles written on them*. VirtualBox has a … Continue reading

Posted in IRL, OS in the VirtualBox, Tips & tricks | Tagged , , , | 2 Comments

Printing lines side by side in shell

Everybody knows, there is paste command in every *NIX to print two files side by side or join which is obviously used to join text-files by their key-fields. And there are a lot of examples and tutorials over Internet, so the subject is as … Continue reading

Posted in Tips & tricks | Tagged , , , , | 10 Comments

A nice way to return string values from functions in Bash

What can be as trivial as returning a value from a function in a scripting language? For those who has ever dealt with Bash, the answer turns out to be not so obvious. First, there are multiple options to do … Continue reading

Posted in Misc, My projects, Tips & tricks | Tagged , , , , , , , , | Leave a comment

Sorting Tumblrs you are following by their last activity

It seems, migration to GitLab stimulated me to code more in unusual for me languages and environments. First, it pushed me to do something in PowerShell: A short script to change audit rules on a file or a directory in … Continue reading

Posted in My projects, Tips & tricks | Tagged , , , , , , , | Leave a comment

A short script to change audit rules on a file or a directory in Microsoft Windows

Suddenly I have got a lot of work setting audit rules on multiple assorted files on Wintel servers. This short script may help me to do things much quicker. Will check it tomorrow: It requires administrative rights to run. Many thanks https://technochat.in forContinue reading

Posted in My projects, Tips & tricks | Tagged , , , | 1 Comment

Quickly report alive IPv6 addresses on the network

While searching a robust solution to discover all alive hosts on the local IPv6 subnet, I have found the easiest way except, probably, ndp is to ping … no, not each of them, but the multicast address ff02::1 and then … Continue reading

Posted in Misc, My projects, sp_ping, Tips & tricks | Tagged , , , , , , , | Leave a comment