Skip to content

Instantly share code, notes, and snippets.

View clifferson's full-sized avatar

Cliff Erson clifferson

View GitHub Profile
⚙️ The SSN Format Validation Algorithm
This is the most you can do without calling an external service. The process checks if a given SSN string adheres to the standard format and avoids known invalid number ranges. The core of this process is often a regular expression (regex) that checks for specific patterns and invalid combinations.
1. Basic Format and Length
A valid SSN must have nine digits. It's most commonly presented in the format AAA-GG-SSSS (Area-Group-Serial).
AAA (Area): The first three digits.
GG (Group): The next two digits.
#!/bin/bash
# A simple script to add all changes, commit with a custom message, and push to the remote repository.
# Check if a commit message was provided as a command-line argument.
if [ -z "$1" ]; then
echo "Error: Please provide a commit message."
echo "Usage: ./git-commit-all.sh \"Your commit message here\""
exit 1
fi
file "/path/to/file" do
inherits True
end
@clifferson
clifferson / gist:34b925965ba20d4f3c11
Created August 20, 2014 01:47
extend a lvm logical volume to all the free space
lvextend -l +100%FREE /dev/vg_name/lv_name
[ ] erlang-R14B-04.3.el6.x86_64.rpm 20-Nov-2013 21:46 26K
[ ] erlang-amf-0-0.6.20110224gitb36dfb6.el6.x86_64.rpm 09-May-2012 19:32 45K
[ ] erlang-appmon-R14B-04.3.el6.x86_64.rpm 20-Nov-2013 21:46 145K
[ ] erlang-asn1-R14B-04.3.el6.x86_64.rpm 20-Nov-2013 21:46 1.0M
[ ] erlang-basho_stats-1.0.3-1.el6.x86_64.rpm 12-Mar-2013 00:42 12K
[ ] erlang-bear-0.1.3-1.el6.x86_64.rpm 09-Mar-2013 10:32 21K
[ ] erlang-bitcask-1.6.1-1.el6.x86_64.rpm 08-Apr-2013 21:56 749K
[ ] erlang-cluster_info-1.2.3-1.el6.x86_64.rpm 12-Mar-2013 00:42 25K
[ ] erlang-common_test-R14B-04.3.el6.x86_64.rpm 20-Nov-2013 21:46 508K
[ ] erlang-compiler-R14B-04.3.el6.x86_64.rpm
@clifferson
clifferson / gist:732f34839bc0ea434f49
Last active August 29, 2015 14:01
Notes on Upstart

Job config file

lives in /etc/init/service.conf

Start/stop an Upstart controlled service

  • "start servicename"
  • "stop servicename"

Reload upstart when adding a new config

  • "initctl reload-configuration"
@clifferson
clifferson / gist:7345596
Last active December 27, 2015 15:09
Using shell to install chef to use ruby to configure your mac!

What?

Use chef-solo driven by soloist to apply recipes to a mac and configure it just how you like.

bit.ly/chef4mac < this presentation (meta)

What is chef-solo and soloist

  • chef-solo : Dont concern yourself with this much?
@clifferson
clifferson / gist:5834687
Created June 21, 2013 22:03
install pcre on a virtual box OSX.
brew install -vd pcre
@clifferson
clifferson / gist:5440326
Created April 23, 2013 02:20
Find out what repo an rpm was installed from
yum-utils provides repoquery
For a single package, you can find this with
repoquery -i package
PACKAGE=ruby-enterprise
repoquery --qf "%{repoid}" $PACKAGE
Replace $PACKAGE with the name of the package you care about.
@clifferson
clifferson / Vagrantfile
Last active December 12, 2015 01:08
Vagrantfile for celery using rabbitmq and worker recipe.
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'berkshelf/vagrant'
Vagrant::Config.run do |config|
config.vm.host_name = "celery-berkshelf"
#config.vm.box = "Berkshelf-CentOS-6.3-x86_64-minimal"
#config.vm.box_url = "https://dl.dropbox.com/u/31081437/Berkshelf-CentOS-6.3-x86_64-minimal.box"