techrobatics.com

Sysadmin Ex Machina

Browsing Posts in Sys Admin

For those of you stuck behind a corporate intranet firewall, here’s a few python functions that might come in handy: #!/usr/bin/env python #iptools.py import socket import urllib2 def get_intranet_ip: “”"Relies upon your company’s intranet web site being available”"” s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((“www.myintranethost.net”, 80)) ipaddr, port = s.getsockname() return ipaddr def get_internet_ip: “”"Relies upon external [...]

For you python enthusiasts, here is a script that will recurse through directories, from the location where you run this, and show you the top disk space consumers. It’s handy for finding a runaway process, or indulgent user… #!/usr/bin/env python #dutop.py import os import sys import operator cutoff_percentage=5 #The following matches “du -h” output def [...]

Place a copy of this block at the bottom of your apache2.conf. Reproduce it for EACH directory, on which you want to enable the rewrite rules (each wordpress root instance). < Directory /var/www/wordpress> Options Indexes FollowSymlinks MultiViews < IfModule mod_rewrite.c> RewriteEngine On #RewriteBase /wordpress/ <– If you want to point somewhere else RewriteCond %{REQUEST_FILENAME} !-f [...]

Under the covers, Mac OSX is a not quite clone of freeBSD, known as “Darwin”. The mascot is appropriately a platypus, both because the platypus is a nod to the famous Charles Darwin, and because the folks at Apple have outfitted Darwin with all sorts of customizations cannibalized from the old NeXT project that confound [...]