Mindblown: a blog about philosophy.

  • Adding HTML Emails To Trac 1.0.1

    [[[TOC]]] ——- =Intro= Below is a patch to add HTML Emails to Trac and below that is a sample template to generate a nice looking email. The completed file can be located [[file:notification.zip|Here]] and should be placed in `trac/ticket/notification.py`. This patch has been tested with [[http://trac.edgewall.org/|Trac 1.0.1dev-r11400]]. Because we will be mucking with Trac’s source,…

  • Expanding A Linux Filesystem

    [[[TOC]]] ———- = Expand the Partition/Logical Volume = * **LVM (Ideal Method)** {{{ vgextend LogicalVolume /dev/sdd #< Add /dev/sdd to volume group lvextend -l +100%FREE /dev/VolumeGroup/LogicalVolume #< Fill free space }}} * **Partitions (Through parted)** ** Open parted {{{ parted /dev/sdd #< Sub /dev/sdd for your HDD location }}} ** Display in sectors {{{ unit…

  • Setup Trac w/ multiple projects, mod_wsgi, LDAP & MySQL – Ubuntu 12.10

    [[[TOC]]] —– = Installation = {{{ sudo apt-get install -y apache2 libapache2-mod-python python-setuptools python-genshi mysql-server python-mysqldb easy_install a2enmod #< Base Packages sudo apt-get install -y libapache2-mod-wsgi #< WSGI support sudo apt-get install -y subversion #< Subversion (not covering the config) sudo easy_install trac #< Trac }}} ------------ = Prep MySQL = * Log in {{{…

  • Round To Nearest X

    Sometimes it is necessary to round a number to the nearest X (.1,5,10, etc). Below is some code to do that: ==PHP== {{{ lang=php line=1 # Round int to nearest $round_to function round_int($n, $round_to=10){ return round($n / $round_to) * $round_to; } # Round float to nearest $round_to, configurable rounding down function round_float($n, $round_to = .1,…

  • Setup SNMPD (v2) in Ubuntu 12.10

    * Install {{{ sudo apt-get install snmpd }}} * Backup old configs {{{ sudo mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.org }}} * Create `/etc/snmp/snmpd.conf` {{{ rocommunity public syslocation “Server Closet, 1B” syscontact dave@dlasley.net }}} * Tell snmpd to use the new file and listen on all interfaces ** `sudo nano /etc/default/snmpd` ** Replace {{{ SNMPDOPTS=’-Lsd -Lf /dev/null -u…

  • Remote MakeMKV

    = CHECK OUT THE NEW VERSION W/ WEB UI – [[https://blog.laslabs.com/projects/remote-makemkv]] = ————- //**Provides a GUI usable for a headless server with multiple drives. Can sling through a SOCKS proxy**// [[[TOC]]] —— **Requires [[http://www.makemkv.com/|MakeMKV]], [[http://qt-project.org/downloads|QT 4]], `mkisofs` (For ISO functionality), `Python 2.7` (have not tested other versions), `PyQt4` (on client), `socksipy-branch` (on server and client)**…

  • Ethernet Bonding – Ubuntu 12.10

    * Install package {{{ sudo apt-get install ifenslave-2.6 }}} * Enable Kernel Module: * `sudo nano /etc/modules` * add `bonding` to the end (if not already contained in the file) * Stop networking and load kernel module {{{ sudo stop networking sudo modprobe bonding }}} * Configure `/etc/network/interfaces` {{{ # The loopback network interface auto…

  • PHP Levenshtein distance

    Below is my implementation of Levenshtein distance in PHP. This is useful to determine the distance between two latitude & longitude pairs. {{{ lang=php line=1 $lat1 = deg2rad($location1->lat); $lng1 = deg2rad($location1->lng); $lat2 = deg2rad($location2->lat); $lng2 = deg2rad($location2->lng); $theta = $location1->lng – $location2->lng; $dist = sin($lat1) * sin($lat2) + cos($lat1) * cos($lat2) * cos(deg2rad($theta)); $dist =…

  • Upgrade Ubuntu

    [[[TOC]]] ——— =LTS To Normal= * Update-Manager install, this may or may not already be installed {{{ sudo apt-get install update-manager-core }}} * Set `lts` to `normal` in `/etc/update-manager/release-upgrades` {{{ Prompt=normal }}} * Perform the upgrade {{{ sudo apt-get update sudo do-release-upgrade -d }}} ——— =Normal To LTS= * Update-Manager install, this may or may…

  • Apache Reverse Proxy w/ URL Rewrite & REMOTE_USER Header

    Here is a sample Location block for setting up Apache as an authentication proxy for a remote Trac install. It sets a REMOTE_USER header so that Trac does not need to worry about authentication, and rewrites the URL for the remote URL Schema. {{{ lang=xml line=1 RewriteEngine On #< Allows Rewritin the URL with regexes…

Got any book recommendations?