Skip to content

Instantly share code, notes, and snippets.

View mherkazandjian's full-sized avatar

Mher Kazandjian mherkazandjian

  • Freelance consultant
  • The Netherlands
View GitHub Profile
@mherkazandjian
mherkazandjian / script for executing arbitrary commands based on inotify events
Last active April 30, 2025 13:49
script for watching content and executing arbitrary commands when changes are detected
#!/bin/bash
usage() {
echo "Usage: $0 --watch <path_pattern> --cmd <command>"
echo " Monitors files/directories matching <path_pattern> for close_write events"
echo " and executes <command> upon detection."
echo " The placeholder {} in <command> will be replaced with the full path of the changed file."
echo "Examples:"
echo " $0 --watch 'src/**/*.js' --cmd 'echo \"File {} changed\" && eslint {}'"
echo " $0 --watch '/config/app.conf' --cmd '/bin/bash /opt/scripts/reload_service.sh {}'"
@mherkazandjian
mherkazandjian / couchdb_create_database.py
Created August 20, 2025 12:16
couchdb quick tutorial and examples
"""
<keywords>
test, python, couchdb, database, create, connect, server
</keywords>
<description>
This script connects to a CouchDB server and creates a database named "tutorial"
if it does not already exist.
</description>
"""