Skip to content

Instantly share code, notes, and snippets.

@divyavanmahajan
divyavanmahajan / combine_markdown.py
Created February 21, 2026 11:59
Combine markdown files from subdirectories in correct page order. Ignores files with duplicate page numbers and reports them. Only processes files that are exactly one subdirectory level deep.
#!/usr/bin/env python3
"""
Combine markdown files from subdirectories in correct page order.
Ignores files with duplicate page numbers and reports them.
Only processes files that are exactly one subdirectory level deep.
"""
import os
import re
from pathlib import Path
{"text": "<title>Hard Times In New York Town</title> <lyrics>Come you ladies and you gentlemen, a-listen to my song\n\nSing it to you right, but you might think it’s wrong\n\nJust a little glimpse of a story I’ll tell\n\n’Bout an East Coast city that you all know well\n\nIt’s hard times in the city\n\nLivin’ down in New York town\n\n\n\nOld New York City is a friendly old town\n\nFrom Washington Heights to Harlem on down\n\nThere’s a-mighty many people all millin’ all around\n\nThey’ll kick you when you’re up and knock you when you’re down\n\nIt’s hard times in the city\n\nLivin’ down in New York town\n\n\n\nIt’s a mighty long ways from the Golden Gate\n\nTo Rockefeller Plaza ’n’ the Empire State.\n\nMister Rockefeller sets up as high as a bird\n\nOld Mister Empire never says a word\n\nIt’s hard times from the country\n\nLivin’ down in New York town\n\n\n\nWell, it’s up in the mornin’ tryin’ to find a job of work\n\nStand in one place till your feet begin to hurt\n\nIf you got a lot o’ money you can make your
{"text": "<title>Hard Times In New York Town</title> <lyrics>Come you ladies and you gentlemen, a-listen to my song\n\nSing it to you right, but you might think it’s wrong\n\nJust a little glimpse of a story I’ll tell\n\n’Bout an East Coast city that you all know well\n\nIt’s hard times in the city\n\nLivin’ down in New York town\n\n\n\nOld New York City is a friendly old town\n\nFrom Washington Heights to Harlem on down\n\nThere’s a-mighty many people all millin’ all around\n\nThey’ll kick you when you’re up and knock you when you’re down\n\nIt’s hard times in the city\n\nLivin’ down in New York town\n\n\n\nIt’s a mighty long ways from the Golden Gate\n\nTo Rockefeller Plaza ’n’ the Empire State.\n\nMister Rockefeller sets up as high as a bird\n\nOld Mister Empire never says a word\n\nIt’s hard times from the country\n\nLivin’ down in New York town\n\n\n\nWell, it’s up in the mornin’ tryin’ to find a job of work\n\nStand in one place till your feet begin to hurt\n\nIf you got a lot o’ money you can make your
{"text":"Dreamstation manual\n\nAccessories\nThere are several optional accessories available for your DreamStation 2 device. For a full list of accessories that can be used with this device, see the DreamStation 2 accessory list at www.philips.com/IFU. Contact your home care service provider for additional information on the available accessories. When using optional accessories, always follow the instructions enclosed with the accessories.\nYou can order accessories for the dreamstation online. Home health professionals can order accessories at https://www.homehealth.estore.philips.com/. Hospital professionals can order at https://www.patientcare.shop.philips.com/.\n\n\n2. Device Setup\n\nPlace the device on a firm, flat surface somewhere within easy reach of where you will use it at a level lower than your sleeping position. Make sure the device is away from any heating or cooling equipment (e.g., forced air vents, radiators, air conditioners). Note: When positioning the device, make sure that the power ca
https://share.philips.com/sites/STS20150610141515/_vti_bin/ListData.svc/ITServicePortfolio()?$filter=not substringof('Lighting',Domain/Domain) and (ServiceManager eq null or Subdomain eq null or LifecycleStatus eq null)&$select=ServiceManagerId,SubdomainId,LifecycleStatusId
@divyavanmahajan
divyavanmahajan / delete_profiles.sh
Created March 15, 2016 02:44
Turnkey OpenVPN - remove all URLs for downloaded OVPN files
#!/bin/bash -e
rm -rf /var/www/openvpn/htdocs/profiles/[0-9a-f]*
@divyavanmahajan
divyavanmahajan / generate_profiles.sh
Created March 15, 2016 02:44
Turnkey OpenVPN - generate URLs to download the OVPN files for all users.
#!/bin/bash -e
rm -rf /var/www/openvpn/htdocs/profiles/[0-9a-f]*
ls /etc/openvpn/easy-rsa/keys/*ovpn|xargs -n 1 -I FNAME basename FNAME .ovpn|grep -v proxy|xargs -n 1 -I CNAME ./create_user.sh CNAME
@divyavanmahajan
divyavanmahajan / watch_users.sh
Created March 15, 2016 02:43
Turnkey OpenVPN - watch active users
#!/bin/bash -e
watch -n 1 cat /var/log/openvpn/server.log
@divyavanmahajan
divyavanmahajan / list_users.sh
Last active December 27, 2023 14:30
Turnkey OpenVPN - List active users and user profiles.
#!/bin/bash -e
# List users in the system
echo "Users setup in the system."
ls /etc/openvpn/easy-rsa/keys/*ovpn|xargs -n 1 -I FNAME basename FNAME .ovpn|grep -v proxy|xargs -n 1 -I NAME echo " NAME"
echo ------
echo Active users
echo ------
cat /var/log/openvpn/server.log
@divyavanmahajan
divyavanmahajan / delete_profiles.sh
Created March 15, 2016 02:40
Turnkey OpenVPN script - delete all web urls - since the "expiry" only removes downloaded links
#!/bin/bash -e
rm -rf /var/www/openvpn/htdocs/profiles/[0-9a-f]*