...du verbe Drupaler (1er groupe)

cron

Ruby nmap script to scan IP range for wireless camera and push IP to web server

Please note: the content on this page orginates from ericlondon.com.
When our son was born, my wife and I purchased and setup an IP camera in his room. Unfortunately its IP changes periodically and it can be annoying to look it up. I finally gave in and wrote a network IP scan script to find its IP, and copy it to a file on my server in a public location.

First I used Homebrew to install nmap on my Mac:

BASH shell wrapper script to setup RVM environment and execute Ruby scripts via cron

Please note: the content on this page orginates from ericlondon.com.
Here's a BASH shell wrapper script I use to execute Ruby scripts via cron. It ensures the following are setup correctly: environment variables, Ruby version, RVM gemset, and will pass command line arguments to Ruby. It assumes an .rvmrc file exists in the same directory as the script being executed.


#!/usr/bin/env bash

# check if rvm_path var is empty and should be sourced

Daily cron job to check for outdated Ruby gems via RVM

Please note: the content on this page orginates from ericlondon.com.
I am running Apache + Passenger on a server which is set to use the global RVM gemset for all vhosts. Here's a simple cron script to check for gem updates.

Check which RVM gemset you are using:

$ rvm current
ruby-1.9.3-p392@global

# search through apache conf to find RVM environment path:
$ grep -i passenger /etc/apache2/apache2.conf
Subscribe to cron