Skip to content

Instantly share code, notes, and snippets.

#!/usr/share/foreman/script/rails runner -e production
Host.all.each do |host|
next unless host.dhcp?
print "#{host}..."
dhcp_record = host.dhcp_record
print "#{dhcp_record}..."
@JohnSpeno
JohnSpeno / My Python style guide.md
Last active September 20, 2019 12:25
John Speno's personal Python style guide

John Speno's Python Style Guide

If you don't use it, you are dead to me.

  • Avoid long lines and do not use a backslash for line continuation. Figure it out. Look at some of these examples for help:
zone_sums = dict(
    one_free=Sum('ports__one_gig_available'),
 one_total=Sum('ports__one_gig_total'),
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 24, 2025 05:05
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
#! /usr/share/foreman/script/rails runner -e production
Host.all.each do |host|
next unless host.dhcp?
print "#{host}..."
dhcp_record = host.dhcp_record
if dhcp_record.valid?
puts "VALID"
elsif dhcp_record.conflicting?
puts "CONFLICT"