I, Kiwinewt, am a TechnoHippy.

Technohippies are a breed of their own. They are not malicious, but only interested in the way things work. They have a broad wisdom of many different technologies. Ignorance and hatred is looked down upon by the technohippy. The technohippy embraces the environment and will do as much as they can to protect it and help it flourish. All in all, a technohippy is a philosophically-open eccentric geek.

  • Pages:

    • Me
      • About
      • Portfolio
      • Testimonials
      • Contract Work
    • Software
      • OSS
      • RoR
      • Releases
    • Contact
  • Tags:

    Alternate Energy Business Code Design DIY Eco Friends Garden General GitHub Green Linkage Modding Money Organic Parenting Pictures Project365 Rant Recipe Review RoR SliceHost Technology Testing Thoughts Trains
  • Archives:

    • ▶2010 (11)
      • ▶April (1)
      • ▶March (1)
      • ▶February (1)
      • ▶January (8)
    • ▶2009 (45)
      • ▶December (2)
      • ▶November (9)
      • ▶October (2)
      • ▶September (2)
      • ▶August (1)
      • ▶July (4)
      • ▶June (11)
      • ▶May (4)
      • ▶March (3)
      • ▶February (1)
      • ▶January (6)
    • ▶2008 (54)
      • ▶December (6)
      • ▶November (2)
      • ▶October (10)
      • ▶September (11)
      • ▶August (6)
      • ▶July (3)
      • ▶June (8)
      • ▶May (3)
      • ▶April (4)
      • ▶January (1)
    • ▶2007 (18)
      • ▶December (1)
      • ▶November (1)
      • ▶October (2)
      • ▶September (2)
      • ▶August (1)
      • ▶July (2)
      • ▶April (5)
      • ▶March (4)

Python script to log dhcp leases

Posted by kiwinewt on 28 December, 2007

Thought I would share this. It is called from DNSMasq in the dnsmasq.conf file: dhcp-script=/home/nate/logdhcp.py enjoy #!/usr/bin/env python import sys, string, array appendLine=1 if sys.argv[4]: f=open(‘/home/nate/dhcplog’, ‘r’) lineArray=f.readlines() for line in f: lineArray.append(line) for line in lineArray: if line == (string.join(sys.argv[1:])+”\n”): appendLine=0 f.close() if appendLine==1: f=open(‘/home/nate/dhcplog’, ‘a’) f.write(string.join(sys.argv[1:])+”\n”) f.close()

Filed under: Technology 1 Comment »

© 2010 TechnoHippy