Tag Archives: script
Command line scripting with Node.js
I often write custom deploy scripts for the projects I work on. In most cases, I choose python. You can do pretty much everything with shell and system commands, but python dictionaries and lists make it very easy to manipulate data, lists of files, text, etc. Networking is also very easy in python (http, ftp, [...]
Python script: remove empty folders
One of the scripts I often use is this one to remove empty folders under a specific location on your hard drive. The usage is simple: $ [path to the script]/remove_empty_folders.py [path_to_clean] Here is the code: #! /usr/bin/env python import os, sys def removeEmptyFolders(path): if not os.path.isdir(path): return # [...]
Crawling sitemaps with Python
This a basic script I have created to crawl an xml sitemap file (does not support nested sitemaps). It will report if the request was successfully processed by the server or if, instead, it returned some kind of error. #!/usr/bin/env python from sys import argv from re import findall from socket import setdefaulttimeout from urllib2 [...]
Check your server status with email notification
I wanted to do this for a while and never really sit down and code it. Yesterday I came across this pretty nice script by Ben from Coderholic which does exactly that: check your server status and send you an email if it is other than 200 (OK). #!/bin/bash # Query a supplied [...]
