<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Tutorial on Kelvin Nicholson</title><link>https://www.kelvinism.com/tags/tutorial/</link><description>Recent content in Tutorial on Kelvin Nicholson</description><generator>Hugo -- 0.164.0</generator><language>en-us</language><lastBuildDate>Wed, 10 Sep 2025 21:30:00 +1100</lastBuildDate><atom:link href="https://www.kelvinism.com/tags/tutorial/index.xml" rel="self" type="application/rss+xml"/><item><title>Overnight Oats</title><link>https://www.kelvinism.com/recipes/overnight-oats.html</link><pubDate>Wed, 10 Sep 2025 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/recipes/overnight-oats.html</guid><description>&lt;h3 id="background"&gt;Background&lt;/h3&gt;
&lt;p&gt;Lots of fibre.&lt;/p&gt;
&lt;h3 id="ingredients"&gt;Ingredients&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;125g steel cut oats&lt;/li&gt;
&lt;li&gt;1 tbsp sunflower seeds&lt;/li&gt;
&lt;li&gt;1 tbsp goji berries&lt;/li&gt;
&lt;li&gt;1 tbsp raisins&lt;/li&gt;
&lt;li&gt;1/2 tsp turmeric, ground&lt;/li&gt;
&lt;li&gt;1/2 tsp cinnamon, ground&lt;/li&gt;
&lt;li&gt;1/4 tsp ginger, ground&lt;/li&gt;
&lt;li&gt;1 dash of lite salt&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="directions"&gt;Directions&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Put in a jar&lt;/li&gt;
&lt;li&gt;Add water about 50% above the oats&lt;/li&gt;
&lt;li&gt;Let soak overnight&lt;/li&gt;
&lt;li&gt;Eat&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="version-history"&gt;Version History&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Number&lt;/th&gt;
&lt;th&gt;Change&lt;/th&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;v2&lt;/td&gt;
&lt;td&gt;Adjusted to 1 tbsp each to ease making&lt;/td&gt;
&lt;td&gt;30-Sept-2025&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;v1&lt;/td&gt;
&lt;td&gt;Initial recipe&lt;/td&gt;
&lt;td&gt;30-Jan-2025&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</description></item><item><title>Tomato Soup</title><link>https://www.kelvinism.com/recipes/tomato-soup.html</link><pubDate>Wed, 10 Sep 2025 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/recipes/tomato-soup.html</guid><description>&lt;h3 id="background"&gt;Background&lt;/h3&gt;
&lt;p&gt;My primary goal here is to boost lycopene. Courtesy of Serious Eats.&lt;/p&gt;
&lt;h3 id="ingredients"&gt;Ingredients&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;1/2 cup extra virgin olive oil, divided&lt;/li&gt;
&lt;li&gt;2 cloves garlic, grated on a microplane grater&lt;/li&gt;
&lt;li&gt;1 small onion, finely sliced (about 1 cup)&lt;/li&gt;
&lt;li&gt;1 teaspoon dried oregano&lt;/li&gt;
&lt;li&gt;1/2 teaspoon red pepper flakes&lt;/li&gt;
&lt;li&gt;2 slices white bread, crusts removed, torn into rough 1/2inch pieces&lt;/li&gt;
&lt;li&gt;2 800ml cans whole peeled tomatoes packed in juice&lt;/li&gt;
&lt;li&gt;Kosher salt and freshly ground black pepper&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="directions"&gt;Directions&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Heat 2 tablespoons olive oil in a large saucepan over mediumhigh heat until shimmering. Add garlic, onions, oregano, and red pepper flakes. Cook, stirring frequently until onions are softened but not browned, about 4 minutes. Add bread and tomatoes. Roughly mash tomatoes with a whisk or a potato masher. Add 2 cups water. Bring to a boil over high heat, then reduce to a simmer. Cook for 5 minutes.&lt;/li&gt;
&lt;li&gt;Transfer half of the soup to the jar of a blender. Blend soup, starting at low speed and gradually increasing to high. With blender running on high, gradually trickle in half of remaining olive oil. Season soup to taste with salt and pepper. Transfer to a large bowl and repeat with remaining half of soup and olive oil. Ladle into individual serving bowls, top with minced herbs, drizzle with more olive oil, and serve with toast or grilled cheese.&lt;/li&gt;
&lt;li&gt;Divid in two portions and serve with bread or crackers.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="version-history"&gt;Version History&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Number&lt;/th&gt;
&lt;th&gt;Change&lt;/th&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;v1&lt;/td&gt;
&lt;td&gt;Initial recipe&lt;/td&gt;
&lt;td&gt;30-Sept-2025&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</description></item><item><title>Chana Masala</title><link>https://www.kelvinism.com/recipes/chana-masala.html</link><pubDate>Mon, 01 Sep 2025 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/recipes/chana-masala.html</guid><description>&lt;h3 id="background"&gt;Background&lt;/h3&gt;
&lt;p&gt;The primary goal here is to increase my lycopene consumption, as I was noticing this is one of the antioxidants that Cronometer reported as me needing to focus on.&lt;/p&gt;
&lt;h3 id="ingredients"&gt;Ingredients&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Olive oil (a lot)&lt;/li&gt;
&lt;li&gt;4 cans chickpeas, drained &amp;amp; rinsed&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;2 large onions, finely chopped&lt;/li&gt;
&lt;li&gt;6 cloves garlic, minced&lt;/li&gt;
&lt;li&gt;140g tomato paste (concentrated lycopene hit)&lt;/li&gt;
&lt;li&gt;2 cans (400g) crushed tomatoes&lt;/li&gt;
&lt;li&gt;2–4 tbsp extra virgin olive oil (for absorption)&lt;/li&gt;
&lt;li&gt;1 bay leaf&lt;/li&gt;
&lt;li&gt;2 tsp cumin seeds&lt;/li&gt;
&lt;li&gt;2 tsp ground coriander&lt;/li&gt;
&lt;li&gt;2 tsp turmeric&lt;/li&gt;
&lt;li&gt;2 tsp garam masala&lt;/li&gt;
&lt;li&gt;½ tsp ginger powder&lt;/li&gt;
&lt;li&gt;1 tsp chili powder (optional, adjust to spice tolerance)&lt;/li&gt;
&lt;li&gt;1/2 tsp black pepper (enhances absorption of antioxidants)&lt;/li&gt;
&lt;li&gt;1 tsp lite salt&lt;/li&gt;
&lt;li&gt;Fresh coriander (cilantro), chopped (folate boost)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="directions"&gt;Directions&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Take out immersion blender so you don&amp;rsquo;t forget to blend it.&lt;/li&gt;
&lt;li&gt;Heat olive oil in a pan. Add cumin seeds and let them sizzle. Add onions, cook until golden. Stir in garlic. Cook 1–2 min until fragrant.&lt;/li&gt;
&lt;li&gt;Add tomato paste, crushed tomatoes, and spices (coriander, turmeric, garam masala, chilli, black pepper). Simmer ~10 min → this cooking step boosts lycopene bioavailability.&lt;/li&gt;
&lt;li&gt;Add 1 cup water.&lt;/li&gt;
&lt;li&gt;Use an immersion blender to blend&lt;/li&gt;
&lt;li&gt;Stir in chickpeas and bay leaf. Simmer 15–20 min, stirring occasionally, until thickened. Remove bay leaf.&lt;/li&gt;
&lt;li&gt;Finish with lemon juice and lots of fresh coriander.&lt;/li&gt;
&lt;li&gt;Divide in to 6 servings.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="version-history"&gt;Version History&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Number&lt;/th&gt;
&lt;th&gt;Change&lt;/th&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;v1&lt;/td&gt;
&lt;td&gt;Initial recipe&lt;/td&gt;
&lt;td&gt;30-Sept-2025&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</description></item><item><title>Lentil Bolognese</title><link>https://www.kelvinism.com/recipes/lentil-bolognese.html</link><pubDate>Mon, 01 Sep 2025 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/recipes/lentil-bolognese.html</guid><description>&lt;h3 id="background"&gt;Background&lt;/h3&gt;
&lt;p&gt;Another way for me to get lycopene.&lt;/p&gt;
&lt;h3 id="ingredients"&gt;Ingredients&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;1 ½ tablespoons olive oil&lt;/li&gt;
&lt;li&gt;1 large onion, diced&lt;/li&gt;
&lt;li&gt;4 garlic cloves, minced&lt;/li&gt;
&lt;li&gt;1 teaspoon dried oregano&lt;/li&gt;
&lt;li&gt;1 teaspoon dried thyme (or use more oregano)&lt;/li&gt;
&lt;li&gt;1 ½ teaspoons kosher salt, plus more to taste&lt;/li&gt;
&lt;li&gt;Freshly ground black pepper to taste&lt;/li&gt;
&lt;li&gt;140g can of tomato paste&lt;/li&gt;
&lt;li&gt;500 mL vegetable broth&lt;/li&gt;
&lt;li&gt;760g red lentils, soaked (use boxed lentils)&lt;/li&gt;
&lt;li&gt;32g walnuts, crushed finely&lt;/li&gt;
&lt;li&gt;800g can of whole peeled tomatoes, blended&lt;/li&gt;
&lt;li&gt;1 tablespoon high quality balsamic vinegar (see note 5)&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id="optional"&gt;Optional&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;Whole-wheat pasta or other whole grain base&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="directions"&gt;Directions&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Add olive oil then onion. Cook 10min, deglaze periodically&lt;/li&gt;
&lt;li&gt;Add the garlic, thyme, oregano, 1 1/2 tsp kosher salt, and pepper to taste. Stir frequently and cook for 60-90 seconds.&lt;/li&gt;
&lt;li&gt;Stir in the tomato paste and cook for 2-3 minutes to caramelise, stirring very frequently, until it’s darker red in colour.&lt;/li&gt;
&lt;li&gt;Deglaze with broth, add lentils and walnuts, bring to boil.&lt;/li&gt;
&lt;li&gt;Simmer for 20 minutes, stirring occasionally.&lt;/li&gt;
&lt;li&gt;Add the crushed tomatoes and simmer for another 15-20 minutes&lt;/li&gt;
&lt;li&gt;Finish with the balsamic vinegar&lt;/li&gt;
&lt;li&gt;Makes 5 servings (about 475g per serving)&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="version-history"&gt;Version History&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Number&lt;/th&gt;
&lt;th&gt;Change&lt;/th&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;v2&lt;/td&gt;
&lt;td&gt;Increased tomato paste&lt;/td&gt;
&lt;td&gt;30-Sept-2025&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;v1&lt;/td&gt;
&lt;td&gt;Initial recipe&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</description></item><item><title>Nutty Pudding Modified Recipe (Australia)</title><link>https://www.kelvinism.com/recipes/nutty-pudding.html</link><pubDate>Mon, 01 Sep 2025 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/recipes/nutty-pudding.html</guid><description>&lt;h3 id="background-og"&gt;Background (OG)&lt;/h3&gt;
&lt;p&gt;It has now been quite some time since I&amp;rsquo;ve been making &lt;a href="https://protocol.bryanjohnson.com/Step-1-Step-2-Step-3"&gt;Blueprint&amp;rsquo;s&lt;/a&gt; &lt;a href="https://www.youtube.com/watch?v=8eb_41ZpyOQ"&gt;Nutty Pudding&lt;/a&gt;. For future reference, in case the Blueprint site stops showing recipes, here is the OG:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;50-100 mL Macadamia Nut Milk&lt;/li&gt;
&lt;li&gt;3 tbsp ground macadamia nuts&lt;/li&gt;
&lt;li&gt;2 tsp of ground walnuts&lt;/li&gt;
&lt;li&gt;2 tbsp chia seeds&lt;/li&gt;
&lt;li&gt;1 tsp of ground flaxseed (seed that is ground into flour)&lt;/li&gt;
&lt;li&gt;1/4 brazil nut&lt;/li&gt;
&lt;li&gt;6 grams of Blueprint cocoa&lt;/li&gt;
&lt;li&gt;1 tsp sunflower lecithin&lt;/li&gt;
&lt;li&gt;1/2 tsp ceylon cinnamon&lt;/li&gt;
&lt;li&gt;1/2 cup blueberries/raspberries/strawberries (your choice)&lt;/li&gt;
&lt;li&gt;3 cherries&lt;/li&gt;
&lt;li&gt;2 oz pomegranate juice&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="my-tweaks"&gt;My Tweaks&lt;/h3&gt;
&lt;p&gt;Some of these items are a little hard to get in Australia, or have (in my opinion) below average value-to-benefit ratios, and I&amp;rsquo;ve decided to swap them out. Instead, this is the recipe I am currently using:&lt;/p&gt;</description></item><item><title>Quick Sardines</title><link>https://www.kelvinism.com/recipes/quick-sardines.html</link><pubDate>Mon, 01 Sep 2025 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/recipes/quick-sardines.html</guid><description>&lt;h3 id="background"&gt;Background&lt;/h3&gt;
&lt;p&gt;My primary goal here is to boost Omega 3, B12, and Calcium. This is generally the only meat that I&amp;rsquo;ll consume outside of travel.&lt;/p&gt;
&lt;h3 id="ingredients"&gt;Ingredients&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;1 can 120g sardines in olive oil&lt;/li&gt;
&lt;li&gt;2 large garlic cloves, minced&lt;/li&gt;
&lt;li&gt;½ tsp dried oregano&lt;/li&gt;
&lt;li&gt;Pinch of low sodium salt&lt;/li&gt;
&lt;li&gt;Ground pepper&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="directions"&gt;Directions&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Preheat oven to 250°C&lt;/li&gt;
&lt;li&gt;Put sardines in an oven-proof tray&lt;/li&gt;
&lt;li&gt;Cover with garlic&lt;/li&gt;
&lt;li&gt;Sprinkle the oregano, kosher salt, and pepper on top.&lt;/li&gt;
&lt;li&gt;Cook the sardines for approximately 15 minutes until they get nice and roasted on top. There is no need to flip the fish while it cooks.&lt;/li&gt;
&lt;li&gt;Put on a plate and eat with a few crackers.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="version-history"&gt;Version History&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Number&lt;/th&gt;
&lt;th&gt;Change&lt;/th&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;v1&lt;/td&gt;
&lt;td&gt;Initial recipe&lt;/td&gt;
&lt;td&gt;30-Sept-2025&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</description></item><item><title>Super Veggie</title><link>https://www.kelvinism.com/recipes/super-veggie.html</link><pubDate>Mon, 01 Sep 2025 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/recipes/super-veggie.html</guid><description>&lt;h3 id="background"&gt;Background&lt;/h3&gt;
&lt;p&gt;Inspired from Bryan Johnson&amp;rsquo;s OG &amp;ldquo;Super Veggie&amp;rdquo; recipe, this is my version with some tweaks.&lt;/p&gt;
&lt;h3 id="ingredients"&gt;Ingredients&lt;/h3&gt;
&lt;h4 id="base"&gt;Base&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;1.5kg frozen broccoli / cauliflower&lt;/li&gt;
&lt;li&gt;180g french style lentils&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="sauce"&gt;Sauce&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;½ tsp black pepper, ground&lt;/li&gt;
&lt;li&gt;125g of EVOO&lt;/li&gt;
&lt;li&gt;2 tsp of turmeric&lt;/li&gt;
&lt;li&gt;½ tsp Lite salt&lt;/li&gt;
&lt;li&gt;½ tsp ginger, ground&lt;/li&gt;
&lt;li&gt;1 tsp mustard powder&lt;/li&gt;
&lt;li&gt;1 tsp garlic powder&lt;/li&gt;
&lt;li&gt;1 tsp onion powder&lt;/li&gt;
&lt;li&gt;1 tsp cumin, ground&lt;/li&gt;
&lt;li&gt;1 tbsp nutritional yeast&lt;/li&gt;
&lt;li&gt;1 tbsp apple cider vinegar&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="toppings"&gt;Toppings&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;8 tsp hemp seeds&lt;/li&gt;
&lt;li&gt;8 tsp sesame seeds&lt;/li&gt;
&lt;li&gt;8 tsp of pumpkin seeds&lt;/li&gt;
&lt;li&gt;150g of beetroot, thinly sliced&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="directions"&gt;Directions&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Add cold water to a big pot, put in lentils. Cook for 15 minutes.&lt;/li&gt;
&lt;li&gt;Put in frozen vegetables. Cook for ~5 minutes.&lt;/li&gt;
&lt;li&gt;Portion to 4 containers&lt;/li&gt;
&lt;li&gt;Make sauce and spread evenly on each container.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="version-history"&gt;Version History&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Number&lt;/th&gt;
&lt;th&gt;Change&lt;/th&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;v3&lt;/td&gt;
&lt;td&gt;Reduced lentils, increased veggies&lt;/td&gt;
&lt;td&gt;30-Sept-2025&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;v2&lt;/td&gt;
&lt;td&gt;Added beetroot and changed seeds&lt;/td&gt;
&lt;td&gt;01-Aug-2025&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;v1&lt;/td&gt;
&lt;td&gt;Initial recipe&lt;/td&gt;
&lt;td&gt;10-Apr-2025&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</description></item><item><title>Migrating To Github Pages</title><link>https://www.kelvinism.com/2025/03/migrating-to-gh-pages.html</link><pubDate>Sun, 16 Mar 2025 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2025/03/migrating-to-gh-pages.html</guid><description>&lt;p&gt;I started this website 20 years ago as a means to learn Django, which made sense, as at the time I wished to do &lt;em&gt;everything&lt;/em&gt; myself: website and hosting, running my own mail server, dns server, and probably something else, too. Over time my desire to spend time on these activities dwindled, and I &lt;a href="https://www.kelvinism.com/2013/01/migrate-custom-blog-to-blogger.html"&gt;move my content&lt;/a&gt; to blogger.&lt;/p&gt;
&lt;p&gt;Year by year I wrote fewer articles, and then it became years since I wrote anything. Perhaps it was the UI for blogger or the niggling feeling that Google could kill it off at any time, or perhaps it was having a kid. Eventually the libraries were no longer maintained. This weekend I opted to:&lt;/p&gt;</description></item><item><title>Geocoding Photos (Mac)</title><link>https://www.kelvinism.com/2014/12/geocoding-photos-mac.html</link><pubDate>Sat, 13 Dec 2014 10:00:00 +1100</pubDate><guid>https://www.kelvinism.com/2014/12/geocoding-photos-mac.html</guid><description>&lt;p&gt;I&amp;rsquo;ve recently started using OSX (again), and am really enjoying it (again). One Windows-only tool that I found really useful is &lt;a href="http://www.geosetter.de/en/"&gt;Geosetter&lt;/a&gt;, which allows you to add geo coordinates into photos. There don&amp;rsquo;t appear to be any free geocoding tools that work to my satisfaction to do this, so the next best thing was geocode like you would using Linux. Here&amp;rsquo;s how.&lt;/p&gt;
&lt;p&gt;We&amp;rsquo;re going to use the command line program &lt;a href="http://www.sno.phy.queensu.ca/~phil/exiftool/"&gt;ExifTool&lt;/a&gt; (by Phil Harvey) to extract coordinates from a gpx file and embed them in a directory of images.&lt;/p&gt;</description></item><item><title>Snap-CI Deploy to OpenShift</title><link>https://www.kelvinism.com/2014/11/snap-ci-deploy-to-openshift.html</link><pubDate>Sat, 01 Nov 2014 23:37:00 +1100</pubDate><guid>https://www.kelvinism.com/2014/11/snap-ci-deploy-to-openshift.html</guid><description>&lt;p&gt;There are some wonderful &lt;a href="http://www.thoughtworks.com/continuous-integration"&gt;CI&lt;/a&gt; / &lt;a href="http://www.thoughtworks.com/continuous-delivery"&gt;CD&lt;/a&gt; tools out there right now, and some of them have very usable free tiers. A few good examples include &lt;a href="https://www.shippable.com/"&gt;Shippable&lt;/a&gt;, &lt;a href="http://wercker.com/"&gt;Wercker&lt;/a&gt;, &lt;a href="http://www.cloudbees.com/products/dev"&gt;CloudBees,&lt;/a&gt; and &lt;a href="https://www.snap-ci.com/"&gt;Snap-CI&lt;/a&gt;. There are others, of course, but these all allow at least one private project to get started.&lt;/p&gt;
&lt;p&gt;I have recently moved my projects to Snap, and my hack for the day needed to be deployed to OpenShift. Although Snap has built in integrations for some providers, no such integration currently exists for OpenShift (yet!). However, it takes less than 10 minutes to configure a Deploy step to OpenShift, and here&amp;rsquo;s how.&lt;/p&gt;</description></item><item><title>Solved: slow build times from Dockerfiles with Python packages (pip)</title><link>https://www.kelvinism.com/2014/07/solved-slow-build-times-from.html</link><pubDate>Wed, 02 Jul 2014 18:13:00 +1000</pubDate><guid>https://www.kelvinism.com/2014/07/solved-slow-build-times-from.html</guid><description>&lt;p&gt;I have recently had the opportunity to begin exploring &lt;a href="http://www.docker.com/"&gt;Docker&lt;/a&gt;, the currently hip way to build application containers, and I generally like it. It feels a bit like using Xen back in 2005, when you still had to download it from cl.cam.ac.uk, but there is &lt;em&gt;huge&lt;/em&gt; momentum right now. I like the idea of breaking down each component of your application into unique services and bundling them up - it seems clean. The next year is going to be very interesting with Docker, as I am especially looking forward to seeing how Google&amp;rsquo;s App Engine allows Docker usage, or what&amp;rsquo;s in store for the likes of Flynn, Deis, CoreOS, or Stackdock.&lt;/p&gt;</description></item><item><title>TLS Module In SaltStack Not Available (Fixed)</title><link>https://www.kelvinism.com/2014/05/tls-module-in-saltstack-not-available.html</link><pubDate>Wed, 07 May 2014 12:50:00 +1000</pubDate><guid>https://www.kelvinism.com/2014/05/tls-module-in-saltstack-not-available.html</guid><description>&lt;p&gt;I was trying to install &lt;a href="https://github.com/saltstack/halite"&gt;HALite&lt;/a&gt;, the WebUI for &lt;a href="http://www.saltstack.com/"&gt;SaltStack&lt;/a&gt;, using the provided instructions. However, I kept getting the following errors when trying to create the certificates using Salt:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;&amp;#39;tls.create_ca_signed_cert&amp;#39;&lt;/span&gt; is not available.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;&amp;#39;tls.create_ca&amp;#39;&lt;/span&gt; is not available.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Basically, the &amp;rsquo;tls&amp;rsquo; module in Salt simply didn&amp;rsquo;t appear to work. The reason for this is detailed on &lt;a href="http://intothesaltmine.org/install_and_configure_halite_alpha_on_arch_linux.html"&gt;intothesaltmind.org&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note: Use of the tls module within Salt requires the pyopenssl python extension.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;That makes sense. We can fix this with something like:&lt;/p&gt;</description></item><item><title>Error opening /dev/sda: No medium found</title><link>https://www.kelvinism.com/2014/03/error-opening-devsda-no-medium-found.html</link><pubDate>Sat, 01 Mar 2014 10:02:00 +1100</pubDate><guid>https://www.kelvinism.com/2014/03/error-opening-devsda-no-medium-found.html</guid><description>&lt;p&gt;I have had this issue before, solved it, and had it again.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s say you plug in a USB drive into a Linux machine, and try to access it (mount it, partition it with fdisk/parted, or format it), and you get the error&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Error opening /dev/sda: No medium found
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Naturally the first thing you will do is ensure that it appeared when you plugged it in, so you run &amp;lsquo;dmesg&amp;rsquo; and get:&lt;/p&gt;</description></item><item><title>Finding The Same (Misspelled) Name Using Python/NLTK</title><link>https://www.kelvinism.com/2013/09/finding-same-misspelled-name-using.html</link><pubDate>Fri, 13 Sep 2013 17:24:00 +1000</pubDate><guid>https://www.kelvinism.com/2013/09/finding-same-misspelled-name-using.html</guid><description>&lt;p&gt;I have been meaning to play around with the &lt;a href="http://nltk.org/"&gt;Natural Language Toolkit&lt;/a&gt; for quite some time, but I had been waiting for a time when I could experiment with it and actually create some value (as opposed to just play with it). A suitable use case appeared this week: matching strings. In particular, matching two different lists of many, many thousands of names.&lt;/p&gt;
&lt;p&gt;To give you an example, let&amp;rsquo;s say you had two lists of names, but with the name spelled incorrectly in one list:&lt;/p&gt;</description></item><item><title>Mapping Mesh Blocks with TileMill</title><link>https://www.kelvinism.com/2013/07/mapping-mesh-blocks-with-tilemill.html</link><pubDate>Sat, 20 Jul 2013 02:00:00 +1000</pubDate><guid>https://www.kelvinism.com/2013/07/mapping-mesh-blocks-with-tilemill.html</guid><description>&lt;p&gt;This quick tutorial will detail how to prepair the ABS Mesh Blocks to be used with MapBox&amp;rsquo;s TileMill. Beyond scope is how to install postgresql, postgis and TileMill. There is a lot of documentation how to do these tasks.&lt;/p&gt;
&lt;p&gt;First, we create a database to import the &lt;a href="http://www.abs.gov.au/AUSSTATS/abs@.nsf/DetailsPage/1270.0.55.001July%202011?OpenDocument"&gt;shapefile&lt;/a&gt; and &lt;a href="http://www.abs.gov.au/AUSSTATS/abs@.nsf/DetailsPage/2074.02011?OpenDocument"&gt;population data&lt;/a&gt; into:&lt;/p&gt;
&lt;p&gt;Using &amp;lsquo;psql&amp;rsquo; or &amp;lsquo;SQL Query&amp;rsquo;, create a new database:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;CREATE&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;DATABASE&lt;/span&gt; transport &lt;span style="color:#66d9ef"&gt;WITH&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;TEMPLATE&lt;/span&gt; postgis20 &lt;span style="color:#66d9ef"&gt;OWNER&lt;/span&gt; postgres;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;#&lt;/span&gt; Query returned successfully &lt;span style="color:#66d9ef"&gt;with&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;no&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;result&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;in&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;5527&lt;/span&gt; ms.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It is necessary to first import the Mesh Block spatial file using something like PostGIS Loader.&lt;/p&gt;</description></item><item><title>Migrate Custom Blog to Blogger</title><link>https://www.kelvinism.com/2013/01/migrate-custom-blog-to-blogger.html</link><pubDate>Thu, 10 Jan 2013 20:14:00 +1100</pubDate><guid>https://www.kelvinism.com/2013/01/migrate-custom-blog-to-blogger.html</guid><description>&lt;p&gt;For the last ten years I have run this website from various systems. First it was on Wordpress, then Mambo, then Joomla, and since early 2006 it has been running on custom code written using Django. I used this site as a learning tool for Django, re-wrote it after gaining more knowledge of Django, and then re-wrote it again when Google released App Engine. However, I recently realised that for the last few years I have spent more time writing little features than actually writing. I have entire trips that I never wrote because I was too busy writing code.&lt;/p&gt;</description></item><item><title>How to convert 131500 TDX to GTFS</title><link>https://www.kelvinism.com/2012/07/how-to-convert-131500-tdx-to-gtfs.html</link><pubDate>Mon, 02 Jul 2012 13:59:00 +1000</pubDate><guid>https://www.kelvinism.com/2012/07/how-to-convert-131500-tdx-to-gtfs.html</guid><description>&lt;p&gt;TDX data has been available for a number of years on 131500.info, but many tools are GTFS specific. I also find GTFS easier to work with.&lt;/p&gt;
&lt;p&gt;Luckily, converting from TDX to GTFS is not overly difficult, and below are some instructions. This howto is a bit old, as I am only now copying it from my &amp;ldquo;Notes&amp;rdquo; folder to put online to help others.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; You can now directly download GTFS from the TransportInfo website: &lt;a href="https://tdx.131500.com.au/"&gt;https://tdx.131500.com.au&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Destroying Hard Drives</title><link>https://www.kelvinism.com/2011/10/destroying-hard-drives_7046.html</link><pubDate>Fri, 14 Oct 2011 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2011/10/destroying-hard-drives_7046.html</guid><description>&lt;p&gt;If you&amp;rsquo;re like me there is a box of hard drives sitting in a dusty corner somewhere. Some are mine, some are others&amp;rsquo;, but they are all in a failed or semi-failed state. So, why have I lugged them around? I&amp;rsquo;ve been a bit paranoid about throwing them away. Some of the hard drives are encrypted, others aren&amp;rsquo;t, and the drives from friends certainly aren&amp;rsquo;t. Although the chances of somebody getting the drive from a landfill and restoring it is minimal, I never wanted to take the chance.&lt;br&gt;
So, I kept lugging a bag of drives through each move.&lt;br&gt;
My friend Clinton has recently returned from Europe, and he brought me a gift: a Swiss-made Victorinox, the &amp;lsquo;CyberTool&amp;rsquo;. After playing with it for several minutes I noticed it came with a Torx 8, 10 and 15 bit. This was a reminder that one method of mostly disabling a hard drive is to destroy the platters.&lt;br&gt;
Other methods I have heard are to use a hammer and nails - which I unfortunately don&amp;rsquo;t have in our tiny apartment. Whilst finishing Dexter I started pulling apart the box of hard drives, and it surprisingly didn&amp;rsquo;t take long to disable them.&lt;br&gt;
&lt;strong&gt;Step 1:&lt;/strong&gt; Remove Torx screws&lt;/p&gt;</description></item><item><title>Reload a Cisco Router WIthout Worry</title><link>https://www.kelvinism.com/2011/06/reload-cisco-router-without-worry.html</link><pubDate>Wed, 08 Jun 2011 14:15:00 +1000</pubDate><guid>https://www.kelvinism.com/2011/06/reload-cisco-router-without-worry.html</guid><description>&lt;p&gt;Recently I tried editing my Cisco&amp;rsquo;s ACL at home on the train. It went something like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I logged in&lt;/li&gt;
&lt;li&gt;I started updating the ACL&lt;/li&gt;
&lt;li&gt;I hit a blackspot in my 3g coverage&lt;/li&gt;
&lt;li&gt;My command stops at &amp;ldquo;router(config)#access-&amp;rdquo;&lt;/li&gt;
&lt;li&gt;I get an alert saying my home internet was down&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Although it is simple enough to just ask her to &amp;ldquo;flip the switch on the black box&amp;rdquo;, I still don&amp;rsquo;t like doing it. Plus, if she&amp;rsquo;s not home, I&amp;rsquo;m stuck. This accident immediately reminded me of one of a trait of the &amp;lsquo;reload&amp;rsquo; command: it can be scheduled.&lt;/p&gt;</description></item><item><title>Converting GTFS to GraphServer</title><link>https://www.kelvinism.com/2011/06/converting-gtfs-to-graphserver.html</link><pubDate>Mon, 06 Jun 2011 14:07:00 +1000</pubDate><guid>https://www.kelvinism.com/2011/06/converting-gtfs-to-graphserver.html</guid><description>&lt;p&gt;If you want to use Graphserver to do some analysis with GTFS, you will need to convert GTFS into the database. This is how I did it.&lt;/p&gt;
&lt;h4 id="get-an-appropriate-ami-from-amazons-ec2"&gt;Get an appropriate AMI from Amazon&amp;rsquo;s EC2&lt;/h4&gt;
&lt;p&gt;I used the following AMI. If you have enough memory, you don&amp;rsquo;t need to do this.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-plain" data-lang="plain"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ami-7000f019
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Lookup and read the GTFSDB &lt;a href="http://code.google.com/p/gtfsdb/downloads/detail?name=GTFSDB%20INSTALL.txt"&gt;INSTALL.txt&lt;/a&gt; document&lt;/p&gt;
&lt;h4 id="prepare-system"&gt;Prepare system&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt-get install mercurial
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;hg clone https://gtfsdb.googlecode.com/hg/ gtfsdb
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt-get install python-setuptools
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo easy_install psycopg2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt-get install build-essential
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="download-gtfs-database"&gt;Download GTFS database&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ubuntu@domU-12-31-39-00-5D-B8:/mnt/gtfsdb$ pwd
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;/mnt/gtfsdb
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo python setup.py install
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo wget http://cdn.kelvinism.com/google_transit.zip
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt-get install python-psycopg2
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;EDIT 16-03-2025: I&amp;rsquo;ve since removed these files.&lt;/p&gt;</description></item><item><title>Removing Unused ContentTypes</title><link>https://www.kelvinism.com/2011/01/removing-unused-contenttypes_4881.html</link><pubDate>Wed, 19 Jan 2011 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2011/01/removing-unused-contenttypes_4881.html</guid><description>&lt;p&gt;I&amp;rsquo;ve been cleaning up my personal blog a bit, and I noticed that my tagging system recently broke. I&amp;rsquo;ve investigated the cause, and it appears to be because I removed some apps but the contenttypes remained. This meant that whenever I tried calling a tag with a TaggedItem that had been deleted, I was getting this error:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-plain" data-lang="plain"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;#39;NoneType&amp;#39; object has no attribute &amp;#39;_meta&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The solution is to first list all app_labels for contenttypes, and then delete any not in use.&lt;/p&gt;</description></item><item><title>Integrate imified into Django</title><link>https://www.kelvinism.com/2011/01/integrate-imified-into-django_2631.html</link><pubDate>Tue, 18 Jan 2011 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2011/01/integrate-imified-into-django_2631.html</guid><description>&lt;p&gt;I recently had the desire to send small updates to my so called &lt;a href="http://www.blogger.com/about-me/"&gt;lifestream&lt;/a&gt; page via XMPP/GTalk. I played around with Twisted Words and several other Python XMPP clients, but I didn&amp;rsquo;t really want to keep a daemon running if unnecessary. It turns out imified took a lot of the pain out of it. The steps for me were as follows:&lt;br&gt;
Create an account with imified, and create a URL, e.g. /app/api/&lt;br&gt;
We then configure the &lt;strong&gt;urls.conf&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Enable ICMP through UFW</title><link>https://www.kelvinism.com/2010/09/enable-icmp-through-ufw_461.html</link><pubDate>Tue, 21 Sep 2010 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2010/09/enable-icmp-through-ufw_461.html</guid><description>&lt;p&gt;I like using Ubuntu&amp;rsquo;s UFW command, but today I needed to allow outgoing ICMP. I received results as so:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ ping 4.2.2.2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;PING 4.2.2.2 &lt;span style="color:#f92672"&gt;(&lt;/span&gt;4.2.2.2&lt;span style="color:#f92672"&gt;)&lt;/span&gt; 56&lt;span style="color:#f92672"&gt;(&lt;/span&gt;84&lt;span style="color:#f92672"&gt;)&lt;/span&gt; bytes of data.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ping: sendmsg: Operation not permitted
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ping: sendmsg: Operation not permitted
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ping: sendmsg: Operation not permitted
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To allow outbound icmp I edited &amp;lsquo;before.rules&amp;rsquo; and added the following lines.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ sudo vi /etc/ufw/before.rules
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# allow outbound icmp&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;-A ufw-before-output -p icmp -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;-A ufw-before-output -p icmp -m state --state ESTABLISHED,RELATED -j ACCEPT
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Using HTML in a Django form label</title><link>https://www.kelvinism.com/2010/07/using-html-in-django-form-label_2240.html</link><pubDate>Sun, 11 Jul 2010 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2010/07/using-html-in-django-form-label_2240.html</guid><description>&lt;p&gt;I recently had the need to add some HTML to the label for a form field using Django. The solution is pretty easy, except I didn&amp;rsquo;t see it written explicitly anywhere, and I missed the memo of the function I should be using.&lt;br&gt;
My form first just had the HTML in the form label as so:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; django &lt;span style="color:#f92672"&gt;import&lt;/span&gt; forms
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;class&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;AccountForm&lt;/span&gt;(forms&lt;span style="color:#f92672"&gt;.&lt;/span&gt;Form):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; name &lt;span style="color:#f92672"&gt;=&lt;/span&gt; forms&lt;span style="color:#f92672"&gt;.&lt;/span&gt;CharField(widget&lt;span style="color:#f92672"&gt;=&lt;/span&gt;forms&lt;span style="color:#f92672"&gt;.&lt;/span&gt;TextInput(), max_length&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;15&lt;/span&gt;, label&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#39;Your Name (why?&amp;#39;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;However, when I displayed it, the form was autoescaped.&lt;br&gt;
&lt;a href="accountsform.jpg"&gt;&lt;img decoding="async" height="133" loading="lazy" sizes="(min-width: 900px) 720px, calc(100vw - 40px)" src="https://www.kelvinism.com/2010/07/using-html-in-django-form-label_2240/accountsform.jpg" srcset="https://www.kelvinism.com/2010/07/using-html-in-django-form-label_2240/accountsform_hu_bba0a056eeb48b4b.jpg 360w, https://www.kelvinism.com/2010/07/using-html-in-django-form-label_2240/accountsform.jpg 532w" width="532"&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Ubuntu 10.04, Django and GAE - Part 1</title><link>https://www.kelvinism.com/2010/06/ubuntu-1004-django-and-gae-part-1_8750.html</link><pubDate>Sat, 12 Jun 2010 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2010/06/ubuntu-1004-django-and-gae-part-1_8750.html</guid><description>&lt;p&gt;I&amp;rsquo;ve started to get into Google&amp;rsquo;s App Engine again, and have started developing a simple product that I had a use for. The initial first draft was a quick 200 lines in webapp, and it worked great. However, I&amp;rsquo;m starting to find certain things quite cumbersome. I&amp;rsquo;m a huge fan of Django, and but also about keeping things as simple as possible, which is why I picked webapp to begin with.&lt;br&gt;
I&amp;rsquo;m now considering making a swap to Django, but there are some development issues; namely, I&amp;rsquo;m using Ubuntu 10.04, Python 2.6, and Django 1.2. This setup presents several setbacks, as GAE has the requirement of Django 1.1 and Python 2.5. There are two solutions that I found: a) use virtualenv, which &lt;a href="http://www.blogger.com/blogger.g?blogID=3439832858234004835#"&gt;I&amp;rsquo;ve detailed&lt;/a&gt;, or b) chroot. This document will hopefully show how to configure a chroot environment of Ubuntu 9.10 and prepare it for Django on GAE. Using a jailed environment should allow you to edit your code with your normal IDE and VCS, but use Django 1.1 and Python 2.5.&lt;br&gt;
First, I installed schroot and debootstrap.&lt;/p&gt;</description></item><item><title>Ubuntu 10.04, Django and GAE - Part 2</title><link>https://www.kelvinism.com/2010/06/ubuntu-1004-django-and-gae-part-2_6130.html</link><pubDate>Sat, 12 Jun 2010 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2010/06/ubuntu-1004-django-and-gae-part-2_6130.html</guid><description>&lt;p&gt;All my Django sites are running 1.2, which poses a conflict with writing apps for Google&amp;rsquo;s App Engine, as use_library currently only supports &amp;lt; Django 1.1. There are two solutions that I found: a) use virtualenv, or b) chroot, which &lt;a href="http://www.kelvinism.com/howtos/ubuntu-1004-django-and-gae-part-1/"&gt;I&amp;rsquo;ve already detailed&lt;/a&gt;. This document will hopefully show you how to create a virtual environment to use a secondary django version, especially for GAE. Of the two options, I think this one is a bit quicker, but there will likely be tradeoffs that a chroot environment can deal with better, e.g. python imaging (I don&amp;rsquo;t use it for GAE).&lt;br&gt;
First, install PIP and virtualenv:&lt;/p&gt;</description></item><item><title>Debug Postfix Tip</title><link>https://www.kelvinism.com/2010/05/debug-postfix-tip_7051.html</link><pubDate>Thu, 20 May 2010 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2010/05/debug-postfix-tip_7051.html</guid><description>&lt;p&gt;One thing I love about open source stuff is that the developers usually take great care to allow awesome debug messages. There&amp;rsquo;s a catch-22, however: how much logging to enable? Today I was creating a Postfix/Dovecot/Postgresql install and I kept getting an error message in mail.log, but it wasn&amp;rsquo;t very helpful.&lt;/p&gt;
&lt;p&gt;Luckily you can turn up the verbosity in Postfix for error messages. You&amp;rsquo;ll need to find out what component is in error, e.g. &amp;ldquo;postfix/virtual[4467]: warning:&amp;rdquo;, and then open master.cf. Add a -v to the end of the daemon that&amp;rsquo;s faulting, and you&amp;rsquo;ll get more logging than you know what to do with.&lt;/p&gt;</description></item><item><title>Retiring Old Websites</title><link>https://www.kelvinism.com/2010/05/retiring-old-websites_2251.html</link><pubDate>Sun, 16 May 2010 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2010/05/retiring-old-websites_2251.html</guid><description>&lt;p&gt;Sometimes all good things &lt;a href="http://www.kelvinism.com/tech-blog/rip-old-sites/"&gt;come to an end&lt;/a&gt;. There aren&amp;rsquo;t too many links going into either of these sites, but I&amp;rsquo;d like to redirect all of them to a page on my blog saying the website doesn&amp;rsquo;t exist anymore. I&amp;rsquo;ve already created simple screendumps for nostalgic purposes with the Firefox plugin Screengrab!, so the remaining simple server-side steps are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Edit the DNS records from the live server to the server with the notice page is on.&lt;/li&gt;
&lt;li&gt;Create a new vhost on the server the notice exists on, add old websites as ServerAlias.&lt;/li&gt;
&lt;li&gt;Add a redirect in the vhost to the notice about the retired sites.&lt;/li&gt;
&lt;li&gt;Reload apache config.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The below vhost entry will redirect any link to the retired sites to the notice page.&lt;/p&gt;</description></item><item><title>Reduce Bandwidth By Shrinking Images</title><link>https://www.kelvinism.com/2010/01/reduce-bandwidth-by-shrinking-images_3510.html</link><pubDate>Sun, 24 Jan 2010 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2010/01/reduce-bandwidth-by-shrinking-images_3510.html</guid><description>&lt;p&gt;A friend has a simple WordPress-based website that I set up for him a few year ago - and he likes to post a lot of images. For various reasons I have it hosted on my VPS in Australia, which only comes with 15GB of bandwidth, most likely because I got a crazy good deal on it.&lt;/p&gt;
&lt;p&gt;The problem is, that isn&amp;rsquo;t much bandwidth. Each page of his site was previously using almost 10MB of bandwidth per view - which meant the 15GB was running out. I deduced the high usage in Firebug and noticed it was &lt;em&gt;gasp&lt;/em&gt; from large images, some almost 1MB large. The images on the server are contained in subdirectories under a gallery folder - and I wanted to resize them. What I actually wanted to do was:&lt;/p&gt;</description></item><item><title>Vortex86DX Instructions from ICOP</title><link>https://www.kelvinism.com/2009/12/vortex86dx-instructions-from-icop_3935.html</link><pubDate>Sat, 05 Dec 2009 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2009/12/vortex86dx-instructions-from-icop_3935.html</guid><description>&lt;p&gt;Alexandru T. and I have exchanged a few emails, and he sent through a few helpful suggestions that were provided from ICOP. I have included them below. Thanks Alexandru!&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install Debian 5.0 on a normal PC (using a netinst image, for minimal install)&lt;/li&gt;
&lt;li&gt;After installation boot normally from the same PC&lt;/li&gt;
&lt;li&gt;Then, take the kernel from &lt;a href="ftp://icop.com.tw/DIS_info/VDX/operating_system/VDX_Linux/linux-image-2.6.30-vortex86mx_1.0_i386.deb"&gt;ftp://icop.com.tw/DIS_info/VDX/operating_system/VDX_Linux/linux-image-2.6.30-vortex86mx_1.0_i386.deb&lt;/a&gt; and then issue the following commands :&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# dpkg -i linux-image-2.6.30-vortex86mx_1.0_i386.deb&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# update-initramfs -k 2.6.30-vortex86mx -c&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# update-grub&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# restart&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start="4"&gt;
&lt;li&gt;Then take the hard-drive and install it on the Vortex86DX&lt;/li&gt;
&lt;li&gt;When GRUB menu appears, press &amp;ldquo;e&amp;rdquo; and modify the boot loader as follows :&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root &lt;span style="color:#f92672"&gt;(&lt;/span&gt;hd0,0&lt;span style="color:#f92672"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kernel /boot/vmlinuz-2.6.30-vortex86mx root&lt;span style="color:#f92672"&gt;=&lt;/span&gt;/dev/hdb1 ro --&amp;gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; hdb1 does not work you can try &lt;span style="color:#f92672"&gt;(&lt;/span&gt;hda1&lt;span style="color:#f92672"&gt;=&lt;/span&gt; Primary Master or hdc1&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Secondary Master&lt;span style="color:#f92672"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;initrd /boot/initrd.img-2.6.30-vortex86mx
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then press b to boot&lt;/p&gt;</description></item><item><title>Lenny on Ebox 3310A</title><link>https://www.kelvinism.com/2009/11/lenny-on-ebox-3310a_5547.html</link><pubDate>Tue, 03 Nov 2009 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2009/11/lenny-on-ebox-3310a_5547.html</guid><description>&lt;p&gt;As a preface, I take absolutely no credit for the below instructions. Stefan L kindly sent these through these instructions on installing Debian on the 3310A. I need to send a special thanks to Stefan, as I receive a lot of emails about the 3310 - but I don&amp;rsquo;t have one, so I can&amp;rsquo;t really do much:&lt;/p&gt;
&lt;p&gt;The only edit I&amp;rsquo;ve done is change out the links to my files on S3. If you find these helpful, or want to suggest an alteration, please leave a comment.&lt;/p&gt;</description></item><item><title>New Atheros Module and Ubuntu</title><link>https://www.kelvinism.com/2009/09/new-atheros-module-and-ubuntu_1580.html</link><pubDate>Tue, 22 Sep 2009 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2009/09/new-atheros-module-and-ubuntu_1580.html</guid><description>&lt;p&gt;I&amp;rsquo;ve been using Atheros for quite some time, and I&amp;rsquo;ve always liked the madwifi drivers. They allowed really easy switching into monitor mode, and decent levels of packet injection. However, since I&amp;rsquo;m mostly in an office now, instead of writing web apps in cafes and trying to score free internet, I don&amp;rsquo;t really need anything fancy. My gentoo stage 1 (3?) days are over. I use Ubuntu, because I&amp;rsquo;m lazy, and it mostly works.&lt;/p&gt;</description></item><item><title>Remove Dead Tags</title><link>https://www.kelvinism.com/2009/09/remove-dead-tags_6886.html</link><pubDate>Mon, 21 Sep 2009 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2009/09/remove-dead-tags_6886.html</guid><description>&lt;p&gt;I&amp;rsquo;ve noticed my django-tagging install has been giving a lot of empty entries when doing a lookup on a tag. Tonight I finally got around to looking at what was causing this. This is surely not the best way to do this, but at 12:00am on a weekday, well, I shouldn&amp;rsquo;t be doing it in the first place&amp;hellip; I first wanted to see what type of content was generating the error:&lt;/p&gt;</description></item><item><title>Simple Arduino + LED Tutorial</title><link>https://www.kelvinism.com/2009/07/simple-arduino-led-tutorial_319.html</link><pubDate>Wed, 01 Jul 2009 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2009/07/simple-arduino-led-tutorial_319.html</guid><description>&lt;p&gt;For this you&amp;rsquo;ll need: an Arduino, an LED, a USB cable, and the Arduino software.&lt;/p&gt;
&lt;p&gt;&lt;a href="arduinowLED.jpg"&gt;&lt;img decoding="async" height="768" loading="lazy" sizes="(min-width: 900px) 720px, calc(100vw - 40px)" src="https://www.kelvinism.com/2009/07/simple-arduino-led-tutorial_319/arduinowLED.jpg" srcset="https://www.kelvinism.com/2009/07/simple-arduino-led-tutorial_319/arduinowLED_hu_7b4ef6f19540cfc8.jpg 360w, https://www.kelvinism.com/2009/07/simple-arduino-led-tutorial_319/arduinowLED_hu_a5509d97e22141f9.jpg 540w, https://www.kelvinism.com/2009/07/simple-arduino-led-tutorial_319/arduinowLED_hu_48c40454357c1cfc.jpg 720w, https://www.kelvinism.com/2009/07/simple-arduino-led-tutorial_319/arduinowLED_hu_fc5271d47fd7b5a1.jpg 960w, https://www.kelvinism.com/2009/07/simple-arduino-led-tutorial_319/arduinowLED.jpg 1024w" width="1024"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Get the LED, and plug it in to your Arduino. Plug in the long end to pin 13, plug the short end to the GND.&lt;/li&gt;
&lt;li&gt;Plug in the Arduino into your laptop. Go to Tools-&amp;gt;Serial Port. Choose the USB port that appears.&lt;/li&gt;
&lt;li&gt;Take the code from the &lt;a href="http://www.arduino.cc/en/Tutorial/BlinkingLED"&gt;BlinkingLED tutorial&lt;/a&gt; and paste it in to the arduino like so:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href="arduino-LED.png"&gt;&lt;img decoding="async" height="681" loading="lazy" sizes="(min-width: 900px) 720px, calc(100vw - 40px)" src="https://www.kelvinism.com/2009/07/simple-arduino-led-tutorial_319/arduino-LED.png" srcset="https://www.kelvinism.com/2009/07/simple-arduino-led-tutorial_319/arduino-LED_hu_e3306233c4d051cf.png 360w, https://www.kelvinism.com/2009/07/simple-arduino-led-tutorial_319/arduino-LED.png 500w" width="500"&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>ISO Code Error</title><link>https://www.kelvinism.com/2009/06/iso-code-error_1265.html</link><pubDate>Wed, 17 Jun 2009 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2009/06/iso-code-error_1265.html</guid><description>&lt;p&gt;I&amp;rsquo;ve received this error a few times when working with pytz:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Error reading file &lt;span style="color:#e6db74"&gt;&amp;#39;/usr/share/xml/iso-codes/iso_3166.xml&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In short, install the &amp;lsquo;iso-codes&amp;rsquo; package in Ubuntu/Debian. I&amp;rsquo;m sure this is covered in the manual that I didn&amp;rsquo;t read, but I&amp;rsquo;m sure others didn&amp;rsquo;t read it too.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;apt-get install iso-codes
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Installing Debian 5.0 on Vortex86DX</title><link>https://www.kelvinism.com/2009/06/installing-debian-50-on-vortex86dx_3246.html</link><pubDate>Sun, 14 Jun 2009 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2009/06/installing-debian-50-on-vortex86dx_3246.html</guid><description>&lt;p&gt;After writing about &lt;a href="http://kelvinism.com/tech-blog/compiling-kernel-vortex86dx/"&gt;compiling a new kernel&lt;/a&gt; for the Vortex86DX, I&amp;rsquo;ve had quite a few people email me asking how I installed Debian in the first place. The installation is actually quite straightforward, but it involved several quirky techniques. After doing another install I decided to keep track of the process of installing Debian 5.0 on my eBox-3300.&lt;/p&gt;
&lt;p&gt;The following guide assumes a few things. First, you are currently using Linux and a debian variety (although instructions could be altered if using Windows). Second, your USB shows up as /dev/sdb. Third, your eBox-3300 has the HDD set in Native mode. Forth, you are patient.&lt;/p&gt;</description></item><item><title>Create a Movie from Images</title><link>https://www.kelvinism.com/2009/06/create-movie-from-images_6692.html</link><pubDate>Mon, 01 Jun 2009 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2009/06/create-movie-from-images_6692.html</guid><description>&lt;p&gt;I&amp;rsquo;ve started leaving my webcam on as a motion detector to find out who is leaving the shopping cards on our lawn, and ultimately have found it useful to stitch the images together into a movie. There are several ways to do this - and my way maybe isn&amp;rsquo;t the best - but it works for me.&lt;/p&gt;
&lt;p&gt;I first installed and configured &lt;a href="http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome"&gt;motion&lt;/a&gt;, which I&amp;rsquo;ve used for years. I then created a file in ~/.motion called motion.com:&lt;/p&gt;</description></item><item><title>Fixing locale errors in Ubuntu 8.04</title><link>https://www.kelvinism.com/2009/05/fixing-locale-errors-in-ubuntu-804_7736.html</link><pubDate>Sun, 03 May 2009 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2009/05/fixing-locale-errors-in-ubuntu-804_7736.html</guid><description>&lt;p&gt;I&amp;rsquo;ve hit this problem a few times, and figured I&amp;rsquo;d leave a note for myself how to fix it. Ubuntu 8.04 seems to hiccup sometimes (on a VPS) for generating the correct locales. In particular, I get this error, a lot:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;perl: warning: Setting locale failed.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;perl: warning: Please check that your locale settings:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;LANGUAGE &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#f92672"&gt;(&lt;/span&gt;unset&lt;span style="color:#f92672"&gt;)&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;LC_ALL &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#f92672"&gt;(&lt;/span&gt;unset&lt;span style="color:#f92672"&gt;)&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;LANG &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;en_US.UTF-8&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;are supported and installed on your system.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;perl: warning: Falling back to the standard locale &lt;span style="color:#f92672"&gt;(&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;C&amp;#34;&lt;/span&gt;&lt;span style="color:#f92672"&gt;)&lt;/span&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Normally I just do &amp;lsquo;dpkg-reconfigure locales&amp;rsquo;, but with 8.04, this doesn&amp;rsquo;t seem to do squat. The solution is to edit the &lt;strong&gt;/var/lib/locales/supported.d/local&lt;/strong&gt; file, and insert the correct locales (it will normally not exist, so create it):&lt;/p&gt;</description></item><item><title>Fixing mysql warning message</title><link>https://www.kelvinism.com/2009/05/fixing-mysql-warning-message_4782.html</link><pubDate>Sun, 03 May 2009 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2009/05/fixing-mysql-warning-message_4782.html</guid><description>&lt;p&gt;After restoring databases from one server to another I sometimes get this error on Ubuntu or Debian:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;error: &lt;span style="color:#e6db74"&gt;&amp;#39;Access denied for user &amp;#39;&lt;/span&gt;debian-sys-maint&lt;span style="color:#e6db74"&gt;&amp;#39;@&amp;#39;&lt;/span&gt;localhost&lt;span style="color:#e6db74"&gt;&amp;#39; (using password: YES)&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This makes a lot of sense, and the solution is pretty simple. If you look in:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cat /etc/mysql/debian.cnf
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You&amp;rsquo;ll see the defaults for your system. Copy the password listed there, and open a connection to MySQL as root (or some other user). Next, enter this (lets say your password specified in debian.cnf was &amp;lsquo;abracadabra&amp;rsquo;:&lt;/p&gt;</description></item><item><title>Files between ESX and Linux via NFS</title><link>https://www.kelvinism.com/2009/03/files-between-esx-and-linux-via-nfs_6022.html</link><pubDate>Mon, 02 Mar 2009 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2009/03/files-between-esx-and-linux-via-nfs_6022.html</guid><description>&lt;p&gt;I like ESX. I like Linux. It is absurdly easy to configure Linux as an NFS server and mount it in ESXIi).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Installed NFS&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I currently use Ubuntu Server for my home lab, but the process is basically the same for Red Hat and derivatives.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt-get install nfs-common
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt-get install nfs-kernel-server
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Next, configure NFS so it can server your local LAN. Normally you would list only specific servers, but, well, we&amp;rsquo;re being cheap and dirty today. Open /etc/exports in VI or your editor of choice.&lt;/p&gt;</description></item><item><title>Renaming Apache Log Locations</title><link>https://www.kelvinism.com/2009/01/renaming-apache-log-locations_1724.html</link><pubDate>Sun, 25 Jan 2009 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2009/01/renaming-apache-log-locations_1724.html</guid><description>&lt;p&gt;I realized a few of my log files were growing unusually large, and even worse, logrotate was skipping them. I took a look in logrotate.d and straight away realized why: I had created silly names for the log file. logrotate look for .log files, but I had specified mine as .log &amp;ndash; e.g. kelvinism_access_log. I was as familiar with logrotate when I set up the domains, so set forth to get them in the rotation.&lt;/p&gt;</description></item><item><title>Beginning Scripting ESXi</title><link>https://www.kelvinism.com/2009/01/beginning-scripting-esxi_6126.html</link><pubDate>Tue, 06 Jan 2009 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2009/01/beginning-scripting-esxi_6126.html</guid><description>&lt;p&gt;I&amp;rsquo;m not impressed too often with much software, especially the closed source kind. I find a leaning preference to all things FOSS. If I had a million dollars, I&amp;rsquo;d likely spend all day contributing to all the projects I wish I had time to contribute to. Regardless, there are a select few closed-source products that I believe are truly excellent. I mean, the type of software where you aren&amp;rsquo;t asking &amp;ldquo;I wish this could do this&amp;rdquo; and start asking &amp;ldquo;I wonder what else this can do.&amp;rdquo;&lt;/p&gt;</description></item><item><title>NetFlow into MySQL with flow-tools</title><link>https://www.kelvinism.com/2008/12/netflow-into-mysql-with-flow-tools_5439.html</link><pubDate>Sun, 21 Dec 2008 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2008/12/netflow-into-mysql-with-flow-tools_5439.html</guid><description>&lt;p&gt;I&amp;rsquo;ve been side-tracked on another little project, and keep coming back to NetFlow. For this project I&amp;rsquo;ll need to access NetFlow data with &lt;a href="http://www.djangoproject.com"&gt;Django&lt;/a&gt;, but this is a bit tricky. First, I&amp;rsquo;m sort of lazy when it comes to my own project; maybe not lazy, I just like taking the most direct route. The most up-to-date NetFlow collector I noticed was &lt;a href="http://code.google.com/p/flow-tools/"&gt;flow-tools&lt;/a&gt;, and there is even a switch to export the information into MySQL. Sweet! However, I wanted to insert the flows into MySQL automatically, or at least on a regular basis. I first started writing a python script that would do the job, but after a few minutes noticed flow-capture had a rotate_program switch, and started investigating. Since I somehow couldn&amp;rsquo;t find anywhere instructions how to insert the data automatically, here&amp;rsquo;s what I came up with:&lt;/p&gt;</description></item><item><title>Zenoss Default Password</title><link>https://www.kelvinism.com/2008/12/zenoss-default-password_1357.html</link><pubDate>Sat, 20 Dec 2008 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2008/12/zenoss-default-password_1357.html</guid><description>&lt;p&gt;I&amp;rsquo;ve evaluated Zenoss before, but forgot the default password, and searching for it didn&amp;rsquo;t come up with anything quickly. I tried everything under the sun: password, 1234, admin, God, Sex, but alas, grep to the rescue:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kelvin@monitor:/usr/local/zenoss/zenoss/etc$ grep admin *
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;hubpasswd:admin:zenoss
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Update: it is listed on page 4 of the Admin PDF :)&lt;/p&gt;</description></item><item><title>Install ESX from a USB (no CDROM)</title><link>https://www.kelvinism.com/2008/12/install-esx-from-usb-no-cdrom_3723.html</link><pubDate>Sun, 07 Dec 2008 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2008/12/install-esx-from-usb-no-cdrom_3723.html</guid><description>&lt;p&gt;My little server doesn&amp;rsquo;t have a cdrom, but I didn&amp;rsquo;t want to actually run ESX from a USB (i.e. esx-on-a-stick). Here are my notes of configuring a flash disk to boot the ESX installer (so you can install it onto a local disk). For this demo, my USB is /dev/sdb&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install the syslinux utils to your computer (apt-get install syslinux mboot)&lt;/li&gt;
&lt;li&gt;Install the MBR&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo install-mbr /dev/sdb
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start="3"&gt;
&lt;li&gt;Copy all the files from the ISO to your fat32 formated partition&lt;/li&gt;
&lt;li&gt;Install syslinux&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo syslinux /dev/sdb1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start="5"&gt;
&lt;li&gt;Move isolinux.cfg to syslinux.cfg, and try booting. If it doesn&amp;rsquo;t work, edit syslinux.cfg says something like:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;default menu.c32
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;menu title ESXi Boot
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;timeout &lt;span style="color:#ae81ff"&gt;100&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;label ESXi
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;menu label Boot VMware ESXi
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kernel mboot.c32
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;append vmkernel.gz --- binmod.tgz --- environ.tgz --- cim.tgz
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ipappend &lt;span style="color:#ae81ff"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start="6"&gt;
&lt;li&gt;Unplug your USB, put it in your server, reboot, boot to USB-HDD (or select the USB disk), and install ESX to the local disk. You will likely be greeted with a sign saying &amp;ldquo;MBR FA:&amp;rdquo;, where you need to press &amp;ldquo;A&amp;rdquo; and then &amp;ldquo;1&amp;rdquo;.&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>Integrating OSSEC with Cisco IOS</title><link>https://www.kelvinism.com/2008/11/integrating-ossec-with-cisco-ios_7061.html</link><pubDate>Sat, 15 Nov 2008 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2008/11/integrating-ossec-with-cisco-ios_7061.html</guid><description>&lt;p&gt;I rank OSSEC as one of my favorite pieces of open source software, and finally decided to play around with it more in my own free time. (Yup, I do this sort of stuff for &lt;em&gt;fun&lt;/em&gt;). My goal was quite simple: send syslog packets from my Cisco to my &amp;ldquo;proxy&amp;rdquo; server, running OSSEC. I found that, although OSSEC supports Cisco IOS logging, it didn&amp;rsquo;t really work. In fact, I couldn&amp;rsquo;t find any examples or articles of anybody actually getting it to work.&lt;/p&gt;</description></item><item><title>Using Django with SQL Server and IIS</title><link>https://www.kelvinism.com/2008/11/using-django-with-sql-server-and-iis_4115.html</link><pubDate>Sat, 08 Nov 2008 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2008/11/using-django-with-sql-server-and-iis_4115.html</guid><description>&lt;p&gt;As you can tell from reading some of the other pages, I like Linux and open source. But I also like to answer the question &amp;ldquo;what if&amp;hellip;&amp;rdquo; This post is my [brief] run down of answering &amp;ldquo;what if I could run Django on Server 2003 with SQL Server and IIS.&amp;rdquo; Why, you may ask? To be honest with you, at this point, I don&amp;rsquo;t really know. One of the deciding factors was seeing that the django-mssql project maintains support for inspectdb, which means I could take a stock 2003 server running SQL Server, inspect the DB, and build a web app on top of it. The Django docs offer a lengthy &lt;a href="http://code.djangoproject.com/wiki/DjangoOnWindowsWithIISAndSQLServer"&gt;howto&lt;/a&gt; for using Django with IIS and SQL Server, but the website for PyISAPIe seems to have been down for the last month or so. Without further delay, below are my notes on installing Django with SQL Server and IIS.&lt;/p&gt;</description></item><item><title>Upgrading Cisco Wireless Firmware</title><link>https://www.kelvinism.com/2008/11/upgrading-cisco-wireless-firmware_3066.html</link><pubDate>Mon, 03 Nov 2008 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2008/11/upgrading-cisco-wireless-firmware_3066.html</guid><description>&lt;p&gt;I&amp;rsquo;m always forgetting the exact string to enter at the CLI for updating the IOS on a wireless Cisco AP, so I&amp;rsquo;ll just put it here to end my future searches:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Chimp# archive download-sw /force-reload /overwrite tftp://192.168.83.150/c1100-k9w7-tar.123-8.JEC1.tar
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;192.168.83.150 obviously being your tftp server, and the .tar file sitting in the root of the tftp server.&lt;/p&gt;
&lt;p&gt;I suppose if you wanted to backup your IOS you could do something along the lines of:&lt;/p&gt;</description></item><item><title>Backup OpenFiler to S3</title><link>https://www.kelvinism.com/2008/11/backup-openfiler-to-s3_9140.html</link><pubDate>Sun, 02 Nov 2008 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2008/11/backup-openfiler-to-s3_9140.html</guid><description>&lt;p&gt;Backing up your Openfiler box to S3&lt;/p&gt;
&lt;p&gt;While I don&amp;rsquo;t think most pople would expect to backup their entire NAS/SAN to Amazon&amp;rsquo;s S3, there might be a few very crucial things you need to backup.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve seen an implementation using Ruby and s3sync &amp;ndash; something that I do on my server &amp;ndash; but I&amp;rsquo;m trying to migrate everything to Python. Although there are a lot of great tools out there for S3, many of them Python-based, I wanted to do one thing and do it well: have one complete full backup available, and using as little bandwidth as possible. In these regards Duplicity would work well, except I wanted the ability to browse the S3 store using any other tool.&lt;/p&gt;</description></item><item><title>Configure Timevault to Remote Server</title><link>https://www.kelvinism.com/2008/11/configure-timevault-to-remote-server_2418.html</link><pubDate>Sun, 02 Nov 2008 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2008/11/configure-timevault-to-remote-server_2418.html</guid><description>&lt;p&gt;Using TimeVault with a shared drive as a backend is actually quite easy, but it does require a few special things setup. Note: this is gonna be a brief summary.&lt;/p&gt;
&lt;p&gt;Install samba-tools, smbfs&amp;hellip;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt-get install samba-tools smbfs
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A lot more other stuff may install as well.&lt;/p&gt;
&lt;p&gt;Create a script that mounts your samba share. You could also do this in fstab, but I tend to suspend my laptop when I come home, and I like clicking buttons.&lt;/p&gt;</description></item><item><title>PyGTK + py2exe for Windows</title><link>https://www.kelvinism.com/2008/11/pygtk-py2exe-for-windows_8282.html</link><pubDate>Sun, 02 Nov 2008 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2008/11/pygtk-py2exe-for-windows_8282.html</guid><description>&lt;p&gt;I&amp;rsquo;m writing down these quick notes so I can remember the steps for getting py2exe to work with GTK.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Download the GTK+ runtime&lt;/li&gt;
&lt;li&gt;Download py2exe&lt;/li&gt;
&lt;li&gt;Copy over your project into the windows box&lt;/li&gt;
&lt;li&gt;Create a setup.py file (see below)&lt;/li&gt;
&lt;li&gt;Run &amp;ldquo;c:\Python25\python.exe setup.py py2exe&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Copy over the lib, etc, and share folder from C:\Program Files\GTK2-Runtime into the dist folder&lt;/li&gt;
&lt;li&gt;Run app!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;setup.py:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; distutils.core &lt;span style="color:#f92672"&gt;import&lt;/span&gt; setup
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; py2exe
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;setup(
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; name &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;ploteq&amp;#39;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; description &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;Bunnys Plotting Tool&amp;#39;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; version &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;1.0&amp;#39;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; windows &lt;span style="color:#f92672"&gt;=&lt;/span&gt; [
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;script&amp;#39;&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#39;ploteq.py&amp;#39;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ],
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; options &lt;span style="color:#f92672"&gt;=&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;py2exe&amp;#39;&lt;/span&gt;: {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;packages&amp;#39;&lt;/span&gt;:&lt;span style="color:#e6db74"&gt;&amp;#39;encodings&amp;#39;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;includes&amp;#39;&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#39;cairo, pango, pangocairo, atk, gobject&amp;#39;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; },
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; data_files&lt;span style="color:#f92672"&gt;=&lt;/span&gt;[
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;ploteq.glade&amp;#39;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Revised mod_tile Install HOWTO</title><link>https://www.kelvinism.com/2008/11/revised-modtile-install-howto_1369.html</link><pubDate>Sat, 01 Nov 2008 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2008/11/revised-modtile-install-howto_1369.html</guid><description>&lt;p&gt;This is the laundry list of things I did while creating a mod_tile VMware appliance based on Ubuntu Server 8.04. I&amp;rsquo;ve kept descriptions limited but left all the commands in. Let&amp;rsquo;s start installing things&amp;hellip;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Useful goodies for compiling source&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt-get build-essential
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;More goodies for Mapnik + Friends&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt-get install libboost-dev libboost-filesystem-dev libboost-filesystem1.34.1 libboost-iostreams-dev libboost-iostreams1.34.1 libboost-program-options-dev libboost-program-options1.34.1 libboost-python-dev libboost-python1.34.1 libboost-regex-dev libboost-regex1.34.1 libboost-serialization-dev libboost-serialization1.34.1 libboost-thread-dev libboost-thread1.34.1 libicu-dev libicu38 libstdc++5 libstdc++5-3.3-dev python2.5-dev
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo aptitude install libfreetype6 libfreetype6-dev libjpeg62 libjpeg62-dev libltdl3 libltdl3-dev libpng12-0 libpng12-dev libtiff4 libtiff4-dev libtiffxx0c2 python-imaging python-imaging-dbg proj
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo aptitude install libcairo2 libcairo2-dev python-cairo python-cairo-dev libcairomm-1.0-1 libcairomm-1.0-dev libglib2.0-0 libpixman-1-0 libpixman-1-dev libpthread-stubs0 libpthread-stubs0-dev ttf-dejavu ttf-dejavu-core ttf-dejavu-extra
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo aptitude install libgdal-dev python2.5-gdal postgresql-8.3-postgis postgresql-8.3 postgresql-server-dev-8.3 postgresql-contrib-8.3
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo aptitude install libxslt1.1 libxslt1-dev libxml2-dev libxml2 gdal-bin libgeos-dev libbz2-dev
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo aptitude install apache2 apache2-threaded-dev apache2-mpm-prefork apache2-utils
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo aptitude install subversion
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This checks out the mapnik source:&lt;/p&gt;</description></item><item><title>Using Raw Disks with VMware Server 2</title><link>https://www.kelvinism.com/2008/08/using-raw-disks-with-vmware-server-2_3562.html</link><pubDate>Mon, 11 Aug 2008 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2008/08/using-raw-disks-with-vmware-server-2_3562.html</guid><description>&lt;p&gt;For various reasons I had the need to open a raw disk inside VMware Server 2. The reports from the field say that this just isn&amp;rsquo;t supported. Although I don&amp;rsquo;t need to actually run a raw disk, I needed to get some data off it &amp;ndash; 400GB worth. It turns out &amp;rsquo;not supported&amp;rsquo; really means &amp;rsquo;not in the UI.&amp;rsquo; I don&amp;rsquo;t know the reason why it isn&amp;rsquo;t in the UI, maybe marketing wants people to use ESX, or maybe the UI guys fell behind with their workload.&lt;/p&gt;</description></item><item><title>Ubuntu 8.04 64-Bit and VMware Server 2</title><link>https://www.kelvinism.com/2008/08/ubuntu-804-64-bit-and-vmware-server-2_1451.html</link><pubDate>Fri, 01 Aug 2008 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2008/08/ubuntu-804-64-bit-and-vmware-server-2_1451.html</guid><description>&lt;p&gt;I now have successful installation of VMware Server 2 (Beta RC1) on top of Ubuntu 8.04 64-bit. I have been using various virtualization technologies for years, and VMware is usually the easiest to install and configure. So far, VMware Server 2 RC1, has proven to be the exception to the rule.&lt;/p&gt;
&lt;p&gt;That said, I am very excited by the direction VMware is taking &amp;ndash; this new server version looks to have great potential.&lt;/p&gt;</description></item><item><title>VMware Tools in VMware Server 2</title><link>https://www.kelvinism.com/2008/08/vmware-tools-in-vmware-server-2_6233.html</link><pubDate>Fri, 01 Aug 2008 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2008/08/vmware-tools-in-vmware-server-2_6233.html</guid><description>&lt;p&gt;Installing the tools in VMware Server 2 is a little different than Workstation or the previous versions of VMware Server. Under the Summary tab of your Virtual Machine, look for a link that says &amp;ldquo;Install VMware Tools&amp;rdquo; &amp;ndash; click it.&lt;/p&gt;
&lt;p&gt;Wait for &amp;lsquo;Success&amp;rsquo; to show up on the bottom, and jump into your virtual machine. Mount the tools as so:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mount /dev/cdrom /media/cdrom
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And install as normal (copy the .tar.gz to /usr/src, extract it, install it). Easy peasy.&lt;/p&gt;</description></item><item><title>Setting up Windows 2003 as an NTP Client</title><link>https://www.kelvinism.com/2008/04/setting-up-windows-2003-as-ntp-client_4269.html</link><pubDate>Tue, 29 Apr 2008 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2008/04/setting-up-windows-2003-as-ntp-client_4269.html</guid><description>&lt;p&gt;I have had to search for the commands to setup a Windows 2003 box as an ntp client a few times now, so have decided to finally write them down here for my own good measure. Funny thing is, I&amp;rsquo;m pretty sure there are three ways to setup a 2003 box as an ntp client.&lt;/p&gt;
&lt;h4 id="1-via-the-cli"&gt;1) Via the CLI&lt;/h4&gt;
&lt;p&gt;Open up the cmd prompt and type in:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;w32tm /config /manualpeerlist:&lt;span style="color:#e6db74"&gt;&amp;#34;0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;/syncfromflags:MANUAL /reliable:YES /update
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="2-via-the-cli-option-2"&gt;2) Via the CLI, option 2&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;net time setsntp: &lt;span style="color:#e6db74"&gt;&amp;#34;0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="3-via-gui"&gt;3) Via GUI&lt;/h4&gt;
&lt;p&gt;Type in &lt;strong&gt;gpedit.msc&lt;/strong&gt; and your local GPO editor will pop up. Go to the folder as indicated in the below screenshot and Enable the &amp;ldquo;Enable Windows NTP Client&amp;rdquo; option. Next set the &amp;ldquo;Configure Windows NTP Client&amp;rdquo; option to whatever time servers you so choose. As always, make sure to keep the 0x1 at the end.&lt;/p&gt;</description></item><item><title>Setting up a Mapnik Server on Ubuntu</title><link>https://www.kelvinism.com/2008/04/setting-up-mapnik-server-on-ubuntu_118.html</link><pubDate>Sun, 27 Apr 2008 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2008/04/setting-up-mapnik-server-on-ubuntu_118.html</guid><description>&lt;p&gt;First, we go ahead and install the needed packages. I&amp;rsquo;ve tried to include &amp;ldquo;my&amp;rdquo; list of packages that were needed to get a vanilla 7.10 image up to steam.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;apt-get install build-essential libltdl3-dev autoconf libtool automake &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;postgresql postgresql-8.2-postgis postgresql-server-dev-8.2 &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;wget subversion libboost-python1.34.1 libboost-thread-dev &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;libboost-program-options-dev libboost-regex-dev &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;libboost-python-dev libboost-serialization-dev &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;libboost-filesystem-dev libpng12-dev libjpeg62-dev &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;libtiff4-dev zlib1g-dev libfreetype6-dev libgeos-dev &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;unzip apache2-prefork-dev
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Next we start to download a few components. I did this in my home directory, /home/kelvin&lt;/p&gt;</description></item><item><title>Notes on Installing mod_tile for Mapnik</title><link>https://www.kelvinism.com/2008/04/notes-on-installing-modtile-for-mapnik_168.html</link><pubDate>Tue, 22 Apr 2008 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2008/04/notes-on-installing-modtile-for-mapnik_168.html</guid><description>&lt;p&gt;I have no idea if these notes on how to install mod_tile will be useful for anybody. The current readme states that you need to edit the source code, but never actually where. Well, this is where, at least until the code can either take switches or can auto-configure itself. This is quite brief, so if you need more details, shoot me an email or leave a comment. I have repeated this process on two Ubuntu 7.10 machines.&lt;/p&gt;</description></item><item><title>Installing Mapnik on Ubuntu 7.10</title><link>https://www.kelvinism.com/2008/04/installing-mapnik-on-ubuntu-710_6688.html</link><pubDate>Sat, 19 Apr 2008 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2008/04/installing-mapnik-on-ubuntu-710_6688.html</guid><description>&lt;p&gt;I have managed to install mapnik 0.4, 0.5, 0.5.1 and various SVN releases in-between on Ubuntu. While this isn&amp;rsquo;t in itself exciting, I think I manage to stumble at every installation. I typically forget to add the flags when building, so, to prevent myself from stumbling again, I&amp;rsquo;m going to write them out here.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Build mapnik&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ python scons/scons.py PYTHON&lt;span style="color:#f92672"&gt;=&lt;/span&gt;/usr/bin/python &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;PGSQL_INCLUDES&lt;span style="color:#f92672"&gt;=&lt;/span&gt;/usr/include/postgresql &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;PGSQL_LIBS&lt;span style="color:#f92672"&gt;=&lt;/span&gt;/usr/lib/postgresql BOOST_INCLUDES&lt;span style="color:#f92672"&gt;=&lt;/span&gt;/usr/include/boost BOOST_LIBS&lt;span style="color:#f92672"&gt;=&lt;/span&gt;/usr/lib
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Then install it&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ sudo python scons/scons.py install PYTHON&lt;span style="color:#f92672"&gt;=&lt;/span&gt;/usr/bin/python &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;PGSQL_INCLUDES&lt;span style="color:#f92672"&gt;=&lt;/span&gt;/usr/include/postgresql &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;PGSQL_LIBS&lt;span style="color:#f92672"&gt;=&lt;/span&gt;/usr/lib/postgresql BOOST_INCLUDES&lt;span style="color:#f92672"&gt;=&lt;/span&gt;/usr/include/boost BOOST_LIBS&lt;span style="color:#f92672"&gt;=&lt;/span&gt;/usr/lib
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then proceed as normal.&lt;/p&gt;</description></item><item><title>Zenity GUI to a Shell Script</title><link>https://www.kelvinism.com/2007/10/zenity-gui-to-shell-script_5432.html</link><pubDate>Sun, 21 Oct 2007 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2007/10/zenity-gui-to-shell-script_5432.html</guid><description>&lt;p&gt;&lt;a href="zenityss.jpg"&gt;&lt;img decoding="async" height="224" loading="lazy" sizes="(min-width: 900px) 720px, calc(100vw - 40px)" src="https://www.kelvinism.com/2007/10/zenity-gui-to-shell-script_5432/zenityss.jpg" srcset="https://www.kelvinism.com/2007/10/zenity-gui-to-shell-script_5432/zenityss.jpg 308w" width="308"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I have to admit, I&amp;rsquo;m pretty lazy. I don&amp;rsquo;t (ironically) like to type, and I really don&amp;rsquo;t like typing the same command over and over. I found myself switching between my external monitor and laptop quite frequently, and decided to somewhat automate the task. Although I know there are other programs out there that allow this, they either had too many features, or crashed. Xrandr works just fine, but like I said, I&amp;rsquo;m lazy&amp;hellip;&lt;/p&gt;</description></item><item><title>Tunneling over SSH</title><link>https://www.kelvinism.com/2007/06/tunneling-over-ssh_6040.html</link><pubDate>Thu, 07 Jun 2007 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2007/06/tunneling-over-ssh_6040.html</guid><description>&lt;p&gt;As a rule, whenever I&amp;rsquo;m online I&amp;rsquo;m logged into my server back in the States. I&amp;rsquo;m also usually wireless, which we all know is beyond insecure &amp;ndash; I&amp;rsquo;ve found it &lt;em&gt;especially&lt;/em&gt; useful to tunnel firefox over SSH. I try my best to tunnel stuff over SSH back, and if you want to also, this is how.&lt;/p&gt;
&lt;h4 id="setup-the-sshsocks-tunnel"&gt;Setup the SSH/SOCKS tunnel&lt;/h4&gt;
&lt;p&gt;I&amp;rsquo;m on Linux, so this is pretty darn easy.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ssh user@domain.com -D &lt;span style="color:#ae81ff"&gt;1080&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the SSH daemon runs on a different port, you&amp;rsquo;d do something like this:&lt;/p&gt;</description></item><item><title>Alexa Site Thumbnail And Django</title><link>https://www.kelvinism.com/2007/06/alexa-site-thumbnail-and-django_7479.html</link><pubDate>Wed, 06 Jun 2007 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2007/06/alexa-site-thumbnail-and-django_7479.html</guid><description>&lt;p&gt;So, you&amp;rsquo;ve seen how to look up thumbnails &lt;a href="https://www.kelvinism.com/howtos/alexa-site-thumbnail-python/"&gt;via python&lt;/a&gt;, but wonder how to integrate this with Django? I created a &lt;a href="https://www.kelvinism.com/webthumbs/"&gt;sample app to demonstrate&lt;/a&gt;. One thing to note about this app is it is slightly more complex than just using the &lt;a href="https://www.kelvinism.com/howtos/alexa-site-thumbnail-python/"&gt;previously mentioned&lt;/a&gt; ThumbnailUtility. For starters, the thumbnail is downloaded from Alexa onto the server. Another part is first searching if the thumbnail exists already, and if it does, serving that instead of querying Alexa. Let&amp;rsquo;s just start with some code.&lt;/p&gt;</description></item><item><title>Alexa Site Thumbnail with Python</title><link>https://www.kelvinism.com/2007/06/alexa-site-thumbnail-with-python_803.html</link><pubDate>Wed, 06 Jun 2007 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2007/06/alexa-site-thumbnail-with-python_803.html</guid><description>&lt;p&gt;For one of my sites I needed to get thumbnails, yet &lt;a href="http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=51"&gt;Alexa Site Thumbnail&lt;/a&gt; didn&amp;rsquo;t have any code snippets for Python. Well, no they/you do.&lt;/p&gt;
&lt;h4 id="thumbnailutilitypy"&gt;ThumbnailUtility.py&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; base64
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; datetime
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; hmac
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; sha
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; sys
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; re
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; urllib
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; xml.dom.minidom
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;AWS_ACCESS_KEY_ID &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;your-access-key-id&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;AWS_SECRET_ACCESS_KEY &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;your-super-secret-key&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# This one is for an individual thumbnail...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;create_thumbnail&lt;/span&gt;(site_url, img_size):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;generate_timestamp&lt;/span&gt;(dtime):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; dtime&lt;span style="color:#f92672"&gt;.&lt;/span&gt;strftime(&lt;span style="color:#e6db74"&gt;&amp;#34;%Y-%m-&lt;/span&gt;&lt;span style="color:#e6db74"&gt;%d&lt;/span&gt;&lt;span style="color:#e6db74"&gt;T%H:%M:%SZ&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;generate_signature&lt;/span&gt;(operation, timestamp, secret_access_key):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; my_sha_hmac &lt;span style="color:#f92672"&gt;=&lt;/span&gt; hmac&lt;span style="color:#f92672"&gt;.&lt;/span&gt;new(secret_access_key, operation &lt;span style="color:#f92672"&gt;+&lt;/span&gt; timestamp, sha)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; my_b64_hmac_digest &lt;span style="color:#f92672"&gt;=&lt;/span&gt; base64&lt;span style="color:#f92672"&gt;.&lt;/span&gt;encodestring(my_sha_hmac&lt;span style="color:#f92672"&gt;.&lt;/span&gt;digest())&lt;span style="color:#f92672"&gt;.&lt;/span&gt;strip()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; my_b64_hmac_digest
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; timestamp_datetime &lt;span style="color:#f92672"&gt;=&lt;/span&gt; datetime&lt;span style="color:#f92672"&gt;.&lt;/span&gt;datetime&lt;span style="color:#f92672"&gt;.&lt;/span&gt;utcnow()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; timestamp_list &lt;span style="color:#f92672"&gt;=&lt;/span&gt; list(timestamp_datetime&lt;span style="color:#f92672"&gt;.&lt;/span&gt;timetuple())
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; timestamp_list[&lt;span style="color:#ae81ff"&gt;6&lt;/span&gt;] &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; timestamp_tuple &lt;span style="color:#f92672"&gt;=&lt;/span&gt; tuple(timestamp_list)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; timestamp &lt;span style="color:#f92672"&gt;=&lt;/span&gt; generate_timestamp(timestamp_datetime)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; signature &lt;span style="color:#f92672"&gt;=&lt;/span&gt; generate_signature(&lt;span style="color:#e6db74"&gt;&amp;#39;Thumbnail&amp;#39;&lt;/span&gt;, timestamp, AWS_SECRET_ACCESS_KEY)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; parameters &lt;span style="color:#f92672"&gt;=&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;AWSAccessKeyId&amp;#39;&lt;/span&gt;: AWS_ACCESS_KEY_ID,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;Timestamp&amp;#39;&lt;/span&gt;: timestamp,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;Signature&amp;#39;&lt;/span&gt;: signature,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;Url&amp;#39;&lt;/span&gt;: site_url,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;Action&amp;#39;&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#39;Thumbnail&amp;#39;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;Size&amp;#39;&lt;/span&gt;: img_size,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; url &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;http://ast.amazonaws.com/?&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; result_xmlstr &lt;span style="color:#f92672"&gt;=&lt;/span&gt; urllib&lt;span style="color:#f92672"&gt;.&lt;/span&gt;urlopen(url, urllib&lt;span style="color:#f92672"&gt;.&lt;/span&gt;urlencode(parameters))&lt;span style="color:#f92672"&gt;.&lt;/span&gt;read()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; result_xml &lt;span style="color:#f92672"&gt;=&lt;/span&gt; xml&lt;span style="color:#f92672"&gt;.&lt;/span&gt;dom&lt;span style="color:#f92672"&gt;.&lt;/span&gt;minidom&lt;span style="color:#f92672"&gt;.&lt;/span&gt;parseString(result_xmlstr)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; image_url &lt;span style="color:#f92672"&gt;=&lt;/span&gt; result_xml&lt;span style="color:#f92672"&gt;.&lt;/span&gt;childNodes[&lt;span style="color:#ae81ff"&gt;0&lt;/span&gt;]&lt;span style="color:#f92672"&gt;.&lt;/span&gt;getElementsByTagName(&lt;span style="color:#e6db74"&gt;&amp;#39;aws:Thumbnail&amp;#39;&lt;/span&gt;)[&lt;span style="color:#ae81ff"&gt;0&lt;/span&gt;]&lt;span style="color:#f92672"&gt;.&lt;/span&gt;firstChild&lt;span style="color:#f92672"&gt;.&lt;/span&gt;data
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; image_url
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# And this one is for a list&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;create_thumbnail_list&lt;/span&gt;(all_sites, img_size):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;generate_timestamp&lt;/span&gt;(dtime):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; dtime&lt;span style="color:#f92672"&gt;.&lt;/span&gt;strftime(&lt;span style="color:#e6db74"&gt;&amp;#34;%Y-%m-&lt;/span&gt;&lt;span style="color:#e6db74"&gt;%d&lt;/span&gt;&lt;span style="color:#e6db74"&gt;T%H:%M:%SZ&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;generate_signature&lt;/span&gt;(operation, timestamp, secret_access_key):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; my_sha_hmac &lt;span style="color:#f92672"&gt;=&lt;/span&gt; hmac&lt;span style="color:#f92672"&gt;.&lt;/span&gt;new(secret_access_key, operation &lt;span style="color:#f92672"&gt;+&lt;/span&gt; timestamp, sha)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; my_b64_hmac_digest &lt;span style="color:#f92672"&gt;=&lt;/span&gt; base64&lt;span style="color:#f92672"&gt;.&lt;/span&gt;encodestring(my_sha_hmac&lt;span style="color:#f92672"&gt;.&lt;/span&gt;digest())&lt;span style="color:#f92672"&gt;.&lt;/span&gt;strip()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; my_b64_hmac_digest
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; timestamp_datetime &lt;span style="color:#f92672"&gt;=&lt;/span&gt; datetime&lt;span style="color:#f92672"&gt;.&lt;/span&gt;datetime&lt;span style="color:#f92672"&gt;.&lt;/span&gt;utcnow()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; timestamp_list &lt;span style="color:#f92672"&gt;=&lt;/span&gt; list(timestamp_datetime&lt;span style="color:#f92672"&gt;.&lt;/span&gt;timetuple())
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; timestamp_list[&lt;span style="color:#ae81ff"&gt;6&lt;/span&gt;] &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; timestamp_tuple &lt;span style="color:#f92672"&gt;=&lt;/span&gt; tuple(timestamp_list)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; timestamp &lt;span style="color:#f92672"&gt;=&lt;/span&gt; generate_timestamp(timestamp_datetime)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; signature &lt;span style="color:#f92672"&gt;=&lt;/span&gt; generate_signature(&lt;span style="color:#e6db74"&gt;&amp;#39;Thumbnail&amp;#39;&lt;/span&gt;, timestamp, AWS_SECRET_ACCESS_KEY)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; image_loc &lt;span style="color:#f92672"&gt;=&lt;/span&gt; {}
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; image_num &lt;span style="color:#f92672"&gt;=&lt;/span&gt; []
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; image_size &lt;span style="color:#f92672"&gt;=&lt;/span&gt; {}
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; count &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; s &lt;span style="color:#f92672"&gt;in&lt;/span&gt; all_sites:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; image_num &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;Thumbnail.&lt;/span&gt;&lt;span style="color:#e6db74"&gt;%s&lt;/span&gt;&lt;span style="color:#e6db74"&gt;.Url&amp;#39;&lt;/span&gt; &lt;span style="color:#f92672"&gt;%&lt;/span&gt; count
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; image_loc[image_num] &lt;span style="color:#f92672"&gt;=&lt;/span&gt; s
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; count &lt;span style="color:#f92672"&gt;+=&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; parameters &lt;span style="color:#f92672"&gt;=&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;AWSAccessKeyId&amp;#39;&lt;/span&gt;: AWS_ACCESS_KEY_ID,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;Timestamp&amp;#39;&lt;/span&gt;: timestamp,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;Signature&amp;#39;&lt;/span&gt;: signature,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;Action&amp;#39;&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#39;Thumbnail&amp;#39;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;Thumbnail.Shared.Size&amp;#39;&lt;/span&gt;: img_size,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; parameters&lt;span style="color:#f92672"&gt;.&lt;/span&gt;update(image_loc)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ast_url &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;http://ast.amazonaws.com/?&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; result_xmlstr &lt;span style="color:#f92672"&gt;=&lt;/span&gt; urllib&lt;span style="color:#f92672"&gt;.&lt;/span&gt;urlopen(ast_url, urllib&lt;span style="color:#f92672"&gt;.&lt;/span&gt;urlencode(parameters))&lt;span style="color:#f92672"&gt;.&lt;/span&gt;read()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; result_xml &lt;span style="color:#f92672"&gt;=&lt;/span&gt; xml&lt;span style="color:#f92672"&gt;.&lt;/span&gt;dom&lt;span style="color:#f92672"&gt;.&lt;/span&gt;minidom&lt;span style="color:#f92672"&gt;.&lt;/span&gt;parseString(result_xmlstr)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; image_urls &lt;span style="color:#f92672"&gt;=&lt;/span&gt; []
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; count &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; s &lt;span style="color:#f92672"&gt;in&lt;/span&gt; all_sites:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; image_urls&lt;span style="color:#f92672"&gt;.&lt;/span&gt;append(result_xml&lt;span style="color:#f92672"&gt;.&lt;/span&gt;childNodes[&lt;span style="color:#ae81ff"&gt;0&lt;/span&gt;]&lt;span style="color:#f92672"&gt;.&lt;/span&gt;getElementsByTagName(&lt;span style="color:#e6db74"&gt;&amp;#39;aws:Thumbnail&amp;#39;&lt;/span&gt;)[count]&lt;span style="color:#f92672"&gt;.&lt;/span&gt;firstChild&lt;span style="color:#f92672"&gt;.&lt;/span&gt;data)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; count &lt;span style="color:#f92672"&gt;+=&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; image_urls
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is how you interact with this code for a single thumbnail:&lt;/p&gt;</description></item><item><title>Alexa Site Thumbnail with Python II</title><link>https://www.kelvinism.com/2007/06/alexa-site-thumbnail-with-python-ii_629.html</link><pubDate>Wed, 06 Jun 2007 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2007/06/alexa-site-thumbnail-with-python-ii_629.html</guid><description>&lt;p&gt;This is how I actually use Alexa Site Thumbnail, and since I&amp;rsquo;min a sharing mood, I&amp;rsquo;ll extend the code your way. In short, this takes the url and searches in STORELOC first, then any urls not already in STORELOC are retrieved and named via a slug. You need to pass two variables to either of these: blog_site.url and blot_site.slug &amp;ndash; since I&amp;rsquo;m using Django, this is naturally how sites are returned after I filter a queryset. What I do is place the call to Alexa as high up the page as I can, and because I&amp;rsquo;ve threaded this, the page can continue to load without waiting for Alexa&amp;rsquo;s response. For instance, let&amp;rsquo;s say you have some model with cool sites, and you want to return the sites filtered by owner&amp;hellip;&lt;/p&gt;</description></item><item><title>Adding Search to Django</title><link>https://www.kelvinism.com/2007/06/adding-search-to-django_6300.html</link><pubDate>Sun, 03 Jun 2007 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2007/06/adding-search-to-django_6300.html</guid><description>&lt;p&gt;This is fairly well documented in the Django docs, so I&amp;rsquo;ll be brief. This is the the bit of search code I use in almost all of my Django sites, and it works great:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;search&lt;/span&gt;(request):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.db.models &lt;span style="color:#f92672"&gt;import&lt;/span&gt; Q
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; q &lt;span style="color:#f92672"&gt;=&lt;/span&gt; request&lt;span style="color:#f92672"&gt;.&lt;/span&gt;GET&lt;span style="color:#f92672"&gt;.&lt;/span&gt;get(&lt;span style="color:#e6db74"&gt;&amp;#34;q&amp;#34;&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#34;&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; q &lt;span style="color:#f92672"&gt;and&lt;/span&gt; len(q) &lt;span style="color:#f92672"&gt;&amp;gt;=&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;3&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; clause &lt;span style="color:#f92672"&gt;=&lt;/span&gt; Q(dirtword__icontains&lt;span style="color:#f92672"&gt;=&lt;/span&gt;q) \
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;|&lt;/span&gt; Q(description__icontains&lt;span style="color:#f92672"&gt;=&lt;/span&gt;q) \
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;|&lt;/span&gt; Q(tags__name__icontains&lt;span style="color:#f92672"&gt;=&lt;/span&gt;q)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; site_search &lt;span style="color:#f92672"&gt;=&lt;/span&gt; Dirt&lt;span style="color:#f92672"&gt;.&lt;/span&gt;objects&lt;span style="color:#f92672"&gt;.&lt;/span&gt;filter(clause)&lt;span style="color:#f92672"&gt;.&lt;/span&gt;distinct()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;else&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; site_search &lt;span style="color:#f92672"&gt;=&lt;/span&gt; Dirt&lt;span style="color:#f92672"&gt;.&lt;/span&gt;objects&lt;span style="color:#f92672"&gt;.&lt;/span&gt;order_by(&lt;span style="color:#e6db74"&gt;&amp;#39;?&amp;#39;&lt;/span&gt;)[:&lt;span style="color:#ae81ff"&gt;100&lt;/span&gt;]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; list_detail&lt;span style="color:#f92672"&gt;.&lt;/span&gt;object_list(
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; request &lt;span style="color:#f92672"&gt;=&lt;/span&gt; request,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; queryset &lt;span style="color:#f92672"&gt;=&lt;/span&gt; site_search,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; template_name &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;dirty/search.html&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; template_object_name &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;dirty&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; paginate_by &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;20&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; extra_context &lt;span style="color:#f92672"&gt;=&lt;/span&gt; {&lt;span style="color:#e6db74"&gt;&amp;#34;q&amp;#34;&lt;/span&gt; : q},
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; )
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;While this should be pretty self-explanatory, the process goes like this: q is taken from the GET request and if it is over three characters long, it is searched for in the dirtword column, through the description and also through the m2m relationship of tags__name. Yup, it is pretty nifty to be able to access relationship in this way (tags__name). You will notice that at the end of each search it says &amp;ldquo;__icontains&amp;rdquo; &amp;ndash; this simply does a fuzzy search for the word. Once the queryset is created (the filter) I&amp;rsquo;ve added a .distinct() on the end &amp;ndash;this prevents multiple rows from being returned to the template. If there isn&amp;rsquo;t a search, or it isn&amp;rsquo;t long enough, a random list will be returned.&lt;br&gt;
One thing I like to do is include the search as extra_context &amp;ndash; this allows you to say something like &amp;ldquo;you&amp;rsquo;ve searched for&amp;hellip;&amp;rdquo; at the top of your search. I couldn&amp;rsquo;t imagine implementing a search feature as being any easier.&lt;/p&gt;</description></item><item><title>Django Syndication with Colddirt</title><link>https://www.kelvinism.com/2007/06/django-syndication-with-colddirt_5107.html</link><pubDate>Sun, 03 Jun 2007 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2007/06/django-syndication-with-colddirt_5107.html</guid><description>&lt;p&gt;Creating feeds in Django is freaking simple. I&amp;rsquo;ll start with an example of just updating a feed with the newest objects (for instace, newest blog posts). Similar to the forms.py way of handling our different forms, I&amp;rsquo;ve created a feeds.py to handle the feeds.&lt;/p&gt;
&lt;h4 id="feedspy"&gt;feeds.py&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.contrib.syndication.feeds &lt;span style="color:#f92672"&gt;import&lt;/span&gt; Feed
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; colddirt.dirty.models &lt;span style="color:#f92672"&gt;import&lt;/span&gt; Dirt
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;class&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;LatestDirts&lt;/span&gt;(Feed):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; title &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;Cold Dirt&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; link &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;/&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; description &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;When you have dirt, you&amp;#39;ve got dirt. Right...&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; copyright &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;All Rights Unreserved&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;items&lt;/span&gt;(self):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; Dirt&lt;span style="color:#f92672"&gt;.&lt;/span&gt;objects&lt;span style="color:#f92672"&gt;.&lt;/span&gt;all()[:&lt;span style="color:#ae81ff"&gt;50&lt;/span&gt;]
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;What this will do is query our Dirt DB and return an obj. The fields here are pretty well documented in the Django docs, besides being pretty obvious.&lt;/p&gt;</description></item><item><title>Django Syndication with Colddirt II</title><link>https://www.kelvinism.com/2007/06/django-syndication-with-colddirt-ii_3665.html</link><pubDate>Sun, 03 Jun 2007 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2007/06/django-syndication-with-colddirt-ii_3665.html</guid><description>&lt;p&gt;Since I&amp;rsquo;ve already covered a really simple syndication example, I&amp;rsquo;ll move onto something a little more complex. Let&amp;rsquo;s say you want to offer syndication that is slightly more custom. The Django &lt;a href="http://www.djangoproject.com/documentation/syndication_feeds/"&gt;syndication docs&lt;/a&gt; give an example from &lt;a href="http://www.holovaty.com/"&gt;Adrian&amp;rsquo;s&lt;/a&gt; &lt;a href="http://www.chicagocrime.org/"&gt;Chicagocrime.org&lt;/a&gt; syndication of beats. I had to ponder a minute to get &amp;ldquo;custom&amp;rdquo; syndication to work, so here&amp;rsquo;s my example from start to finish.&lt;br&gt;
First, as usual, feeds.py&lt;/p&gt;
&lt;h4 id="feedspy"&gt;feeds.py&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;class&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;PerDirt&lt;/span&gt;(Feed):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; link &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;/&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; copyright &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;Copyright (c) 2007, Blog Mozaic&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;get_object&lt;/span&gt;(self, bits):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.shortcuts &lt;span style="color:#f92672"&gt;import&lt;/span&gt; get_object_or_404
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; len(bits) &lt;span style="color:#f92672"&gt;!=&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;raise&lt;/span&gt; ObjectDoesNotExist
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; my_dirt &lt;span style="color:#f92672"&gt;=&lt;/span&gt; get_object_or_404(Dirt, slug__exact&lt;span style="color:#f92672"&gt;=&lt;/span&gt;bits[&lt;span style="color:#ae81ff"&gt;0&lt;/span&gt;])
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; my_dirt
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;title&lt;/span&gt;(self, obj):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; obj&lt;span style="color:#f92672"&gt;.&lt;/span&gt;slug
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;description&lt;/span&gt;(self, obj):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; obj&lt;span style="color:#f92672"&gt;.&lt;/span&gt;description
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;items&lt;/span&gt;(self, obj):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.contrib.comments.models &lt;span style="color:#f92672"&gt;import&lt;/span&gt; FreeComment
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; FreeComment&lt;span style="color:#f92672"&gt;.&lt;/span&gt;objects&lt;span style="color:#f92672"&gt;.&lt;/span&gt;filter(object_id&lt;span style="color:#f92672"&gt;=&lt;/span&gt;obj&lt;span style="color:#f92672"&gt;.&lt;/span&gt;id)&lt;span style="color:#f92672"&gt;.&lt;/span&gt;order_by(&lt;span style="color:#e6db74"&gt;&amp;#39;-submit_date&amp;#39;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can see that this differs slightly from the simpler syndication example. I&amp;rsquo;ll not a few things. But first, I need to show urls.py:&lt;/p&gt;</description></item><item><title>Django Newforms Usage in Colddirt</title><link>https://www.kelvinism.com/2007/06/django-newforms-usage-in-colddirt_1103.html</link><pubDate>Fri, 01 Jun 2007 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2007/06/django-newforms-usage-in-colddirt_1103.html</guid><description>&lt;p&gt;I hear many complaints and questions about newforms, but I&amp;rsquo;ve personally found it rather easy and logical to use. There are numerous ways for you to use do forms in Django, and most likely the best way to see them all is to &lt;a href="http://www.djangoproject.com/documentation/newforms/"&gt;read the docs&lt;/a&gt;. On the Colddirt demo site, this is how I used newforms. I&amp;rsquo;ll take the index page as an example.&lt;br&gt;
I&amp;rsquo;ve accessed the newforms module like so:&lt;/p&gt;</description></item><item><title>Simple Ajax with Django</title><link>https://www.kelvinism.com/2007/06/simple-ajax-with-django_1754.html</link><pubDate>Fri, 01 Jun 2007 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2007/06/simple-ajax-with-django_1754.html</guid><description>&lt;p&gt;So, the Django developers, in my opinion, are freaking smart. Instead of bundling Django with a particular library, they have added XML and JSON serialization; us humble users can choose whatever AJAX library we want. &lt;a href="http://www.prototypejs.org/"&gt;Prototype 1.5.1&lt;/a&gt; has been pretty fun to work with, so I&amp;rsquo;ll kick off this demo with a really simple example.&lt;br&gt;
How simple? The intended goal is to have the total number of &amp;lsquo;dirts&amp;rsquo; update without user intervention. &lt;em&gt;Laaaammmeee&lt;/em&gt;. If you are a visual type of person, &lt;a href="http://www.colddirt.com/huh/"&gt;take a look&lt;/a&gt; on the Colddirt &lt;a href="http://www.colddirt.com/huh/"&gt;huh&lt;/a&gt; page. That number automatically increases without user intervention. And this is how.&lt;br&gt;
The process (some pseudocode) will go like this:&lt;/p&gt;</description></item><item><title>Solved: NO PUBKEY</title><link>https://www.kelvinism.com/2007/05/solved-no-pubkey_625.html</link><pubDate>Fri, 25 May 2007 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2007/05/solved-no-pubkey_625.html</guid><description>&lt;p&gt;I&amp;rsquo;ve received this error more than once, so I&amp;rsquo;m finally writing my notes how I solve it.&lt;/p&gt;
&lt;h4 id="error-message"&gt;Error message:&lt;/h4&gt;
&lt;p&gt;W: GPG error: &lt;a href="http://security.debian.org"&gt;http://security.debian.org&lt;/a&gt; stable/updates Release: The following signatures couldn&amp;rsquo;t be verified because the public key is not available: NO_PUBKEY A70DAF536070D3A1&lt;/p&gt;
&lt;p&gt;This really is just your standard don&amp;rsquo;t-have-the-gpg-keys error. So, get&amp;rsquo;em &amp;ndash; take the last eight digits from the long NO_PUBKEY string &lt;strong&gt;that is displayed on your computer&lt;/strong&gt;. If you are using Debian 4.0, the above key is likely correct; if you are using Ubuntu or another version of Debian, it will be wrong. (The last eight digits are used as an identifier at the keyservers). Then:&lt;/p&gt;</description></item><item><title>Postfix/Dovecot + MySQL</title><link>https://www.kelvinism.com/2007/05/postfixdovecot-mysql_1687.html</link><pubDate>Thu, 24 May 2007 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2007/05/postfixdovecot-mysql_1687.html</guid><description>&lt;p&gt;As you can see by &lt;a href="http://www.blogger.com/tech-blog/gentoo-test/"&gt;another post&lt;/a&gt;, I decided to reinstall the server. This isn&amp;rsquo;t really a problem, I have pretty good backups. I&amp;rsquo;ve installed apache and friends a bagillion times. However, Postfix(chroot)+Dovecot authenticating from MySQl, that doesn&amp;rsquo;t install quite so smoothly.&lt;br&gt;
Just for my future reference, and maybe helpful for somebody, someday. Clearly not a tutorial. The postfix chroot = /var/spool/postfix&lt;/p&gt;
&lt;h4 id="cannot-connect-to-saslauthd-server-no-such-file-or-directory"&gt;cannot connect to saslauthd server: No such file or directory&lt;/h4&gt;
&lt;p&gt;First, get the saslauthd files into the postfix chroot. Edit /etc/conf.d/saslauthd (or /etc/default/saslauthd), and add this:&lt;/p&gt;</description></item><item><title>Generating a Self-Signed SSL Cert</title><link>https://www.kelvinism.com/2007/05/generating-self-signed-ssl-cert_2490.html</link><pubDate>Fri, 11 May 2007 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2007/05/generating-self-signed-ssl-cert_2490.html</guid><description>&lt;p&gt;I have the need to generate an SSL cert (Apache2) about once every 3 months. And since I&amp;rsquo;m cheap, I don&amp;rsquo;t ever actually &lt;em&gt;buy&lt;/em&gt; one, I just self-sign it. And every time I forget the commands needed. So, here they are, for my reference only.&lt;br&gt;
&lt;strong&gt;1) Generate Private Key&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl genrsa -des3 -out server.key &lt;span style="color:#ae81ff"&gt;1024&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;2) Generate a CSR&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl req -new -key server.key -out server.csr
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;3) Remove passphrase&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cp server.key server.key.org
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl rsa -in server.key.org -out server.key
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;4) Generate Self-Signed Cert&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>PNG Transparency and IE</title><link>https://www.kelvinism.com/2007/05/png-transparency-and-ie_2740.html</link><pubDate>Mon, 07 May 2007 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2007/05/png-transparency-and-ie_2740.html</guid><description>&lt;p&gt;I&amp;rsquo;ve vowed to not use transparent PNGs until almost everybody has switched to IE7, where they are actually supported (despite being supported by every other major browser). I&amp;rsquo;ve done the hacks, and have had good results. I like using PNGs, I&amp;rsquo;ll admit it. &lt;a href="http://www.inkscape.org/"&gt;Inkscape&lt;/a&gt; exports them directly, however one slight problem: transparency still exists. This isn&amp;rsquo;t really a problem since I&amp;rsquo;m not layering images, or is it?&lt;br&gt;
My initial assumption is that IE would simple pull the white background and everything would be dandy. Well, we all know what they say about assumptions.&lt;/p&gt;</description></item><item><title>Simple Chrooted SSH</title><link>https://www.kelvinism.com/2007/03/simple-chrooted-ssh_6907.html</link><pubDate>Thu, 29 Mar 2007 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2007/03/simple-chrooted-ssh_6907.html</guid><description>&lt;p&gt;You might be asking: why would you want to chroot ssh? Why use ssh anyways? Here are the quick answers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;FTP usually isn&amp;rsquo;t great&lt;/strong&gt;. Unless sent over SSL, all information is sent &lt;em&gt;cleartext&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SSH usually is much better&lt;/strong&gt;. SSH sends all data over an encrypted channel &amp;ndash; the main drawback is: you can often browse around the system, and if permissions aren&amp;rsquo;t set right, read things you shouldn&amp;rsquo;t be able to.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Chroot&amp;rsquo;d SSH rocks&lt;/strong&gt;. The solution to both the above problems.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So, let me tell a quick story.&lt;br&gt;
When I started uni in 2001 I was a nerd. Still a nerd, I guess. I was cramped in my apartment on campus with like 5 boxes, most of them old p100s running Linux or OpenBSD. Life was good.&lt;br&gt;
I started a CS degree (shifted into Business with a focus on IT), and we were told to use the school&amp;rsquo;s main servers to compile our programs. The other interesting thing is that &lt;em&gt;all&lt;/em&gt; user accounts were visible when logged in via ssh &amp;ndash; but hey, that is just the nature of Linux. I knew this, but asked the head I.T. person &amp;ldquo;why don&amp;rsquo;t you jail the connections?&amp;rdquo; He responded quickly telling me to go away.&lt;br&gt;
Well, shortly after making the comment (although solutions existed at the time being), pam-chroot was released. This is right about the time students figured they could spam everybody in the school, some 25,000 emails, quickly and easily &amp;ndash; &amp;lsquo;cause all the accounts were displayed. Sweet &amp;ndash; now we can chroot individual ssh connections.&lt;br&gt;
This quick demo will be on Debian, we&amp;rsquo;ll create a pretend user named &amp;ldquo;karl.&amp;rdquo; (I&amp;rsquo;ll assume you&amp;rsquo;ve already added the user before beginning these steps). Also, the jails will be in /var/chroot/{username}&lt;/p&gt;</description></item><item><title>Layer Images Using ImageMagick</title><link>https://www.kelvinism.com/2007/03/layer-images-using-imagemagick_25.html</link><pubDate>Thu, 22 Mar 2007 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2007/03/layer-images-using-imagemagick_25.html</guid><description>&lt;p&gt;For one of my &lt;a href="http://www.brokebutnot.com/"&gt;webapp projects&lt;/a&gt; I&amp;rsquo;m needing to layer two images. This isn&amp;rsquo;t a problem on my laptop &amp;ndash; I just fire up GIMP, do some copy &amp;rsquo;n pasting, and I&amp;rsquo;m done. However, since everything needs to be automated (scripted), and on a server &amp;ndash; well, you get the point.&lt;br&gt;
The great &lt;a href="http://www.imagemagick.org/"&gt;ImageMagick&lt;/a&gt; toolkit comes to the rescue. This is highly documented elsewhere, so I&amp;rsquo;m going to be brief.&lt;/p&gt;
&lt;h4 id="take-this"&gt;Take this:&lt;/h4&gt;
&lt;p&gt;&lt;a href="world.jpg"&gt;&lt;img decoding="async" height="677" loading="lazy" sizes="(min-width: 900px) 720px, calc(100vw - 40px)" src="https://www.kelvinism.com/2007/03/layer-images-using-imagemagick_25/world.jpg" srcset="https://www.kelvinism.com/2007/03/layer-images-using-imagemagick_25/world_hu_d9422bda9cf12bc0.jpg 360w, https://www.kelvinism.com/2007/03/layer-images-using-imagemagick_25/world_hu_7da57d343ce00ecb.jpg 540w, https://www.kelvinism.com/2007/03/layer-images-using-imagemagick_25/world_hu_6406ea157e1bb82b.jpg 720w, https://www.kelvinism.com/2007/03/layer-images-using-imagemagick_25/world_hu_1720e8bbf49378b2.jpg 960w, https://www.kelvinism.com/2007/03/layer-images-using-imagemagick_25/world.jpg 1019w" width="1019"&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Python, AST and SOAP</title><link>https://www.kelvinism.com/2007/03/python-ast-and-soap_3058.html</link><pubDate>Wed, 07 Mar 2007 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2007/03/python-ast-and-soap_3058.html</guid><description>&lt;p&gt;For one of my projects I need to generate thumbnails for a page. And lots and lots and lots of them. Even though I can generate them via a python script and a very light &amp;ldquo;gtk browser&amp;rdquo;, I would prefer to mitigate the server load. To do this I&amp;rsquo;ve decided to tap into the Alexa Thumbnail Service. They allow two methods: REST and SOAP. After several hours of testing things out, I&amp;rsquo;ve decided to toss in the towel and settle on REST. If you can spot the error with my SOAP setup, I owe you a beer.&lt;br&gt;
I&amp;rsquo;m using the ZSI module for python.&lt;/p&gt;</description></item><item><title>AWS in Python (REST)</title><link>https://www.kelvinism.com/2007/03/aws-in-python-rest_5343.html</link><pubDate>Sat, 03 Mar 2007 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2007/03/aws-in-python-rest_5343.html</guid><description>&lt;p&gt;As some of you may know, I have some projects cooked up. I don&amp;rsquo;t expect to make a million bucks (wish me luck!), but a few extra bills in the pocket wouldn&amp;rsquo;t hurt. Plus, I&amp;rsquo;m highly considering further education, which will set me back a few-thirty grand. That said, one of my projects will rely heavily on &lt;a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;amp;location=http%3A%2F%2Fwww.amazon.com%2FAWS-home-page-Money%2Fb%3Fie%3DUTF8%26node%3D3435361&amp;amp;tag=kelvinismcom-20&amp;amp;linkCode=ur2&amp;amp;camp=1789&amp;amp;creative=9325"&gt;Amazon Web Services&lt;/a&gt;&lt;img decoding="async" loading="lazy" src="http://www.assoc-amazon.com/e/ir?t=kelvinismcom-20&amp;l=ur2&amp;o=1"&gt;. Amazon has, for quite some time now, opened up their information via REST and SOAP. I&amp;rsquo;ve been trying (virtually the entire day) to get SOAP to work, but seem to get snagged on a few issues. Stay tuned.&lt;br&gt;
However, in my quest to read every RTFM I stumbled upon a post regarding Python+REST to access &lt;a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;amp;location=http%3A%2F%2Fwww.amazon.com%2Fb%3Fie%3DUTF8%26node%3D269962011%26no%3D239513011%26me%3DA36L942TSJ2AJA&amp;amp;tag=kelvinismcom-20&amp;amp;linkCode=ur2&amp;amp;camp=1789&amp;amp;creative=9325"&gt;Alexa Web Search&lt;/a&gt;&lt;img decoding="async" loading="lazy" src="http://www.assoc-amazon.com/e/ir?t=kelvinismcom-20&amp;l=ur2&amp;o=1"&gt;. After staring at Python code, especially trying to grapple why SOAP isn&amp;rsquo;t working, updating the outdated REST code was a 5 minute hack. So, if you are interested in using Alexa Web Search with Python via Rest, look below:&lt;/p&gt;</description></item><item><title>Resize a VMWare Image of Windows XP</title><link>https://www.kelvinism.com/2007/01/resize-vmware-image-of-windows-xp_4908.html</link><pubDate>Sat, 27 Jan 2007 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2007/01/resize-vmware-image-of-windows-xp_4908.html</guid><description>&lt;p&gt;Over the years I have been shrinking the number of computers I own.  At one point my dorm was littered with old P100s, running whatever OS I felt like playing with at the time.  &lt;/p&gt;
&lt;p&gt;VMWare comes to help.  In this recent oops, an image I made (for Windows XP), was slightly too small.  I didn&amp;rsquo;t feel like reinstalling XP + cruft, so just resized the image.  This is the process:&lt;/p&gt;</description></item><item><title>Lighttpd As Apache Sidekick</title><link>https://www.kelvinism.com/2006/12/lighttpd-as-apache-sidekick_4400.html</link><pubDate>Tue, 12 Dec 2006 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2006/12/lighttpd-as-apache-sidekick_4400.html</guid><description>&lt;p&gt;So, you have a web server. So, you have PHP. So, you want to make it a little quicker? The following are a few ideas to let you do that. First, let me share my experiences.&lt;br&gt;
I have always been wondering &amp;ldquo;what would a digg do to my site.&amp;rdquo; I mean, I don&amp;rsquo;t run a commenting system, so I&amp;rsquo;m refering to just some article. Because I prefer to manage my own server, I have decided to use a VPS (Virtual Private Server) from &lt;a href="http://www.vpslink.com/"&gt;VPSLink&lt;/a&gt;. Before purchasing I searched around, read reviews, and finally tested it out. Liking what I tested, I stayed. However, since I just host a few &amp;lsquo;play&amp;rsquo; sites (http/email/ftp), and a few sites for friends, I am not going to spend much money on a high-end plan. That leaves me with a little problem: how can I maximize what I&amp;rsquo;ve got?&lt;br&gt;
I&amp;rsquo;ve tried quite a few things. I finally ended up using Apache to handle php and &lt;a href="http://www.lighttpd.net/"&gt;Lighttpd&lt;/a&gt; to serve all static stuff. So, how?&lt;/p&gt;</description></item><item><title>Make Dynamic Sites Static</title><link>https://www.kelvinism.com/2006/12/make-dynamic-sites-static_7513.html</link><pubDate>Thu, 07 Dec 2006 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2006/12/make-dynamic-sites-static_7513.html</guid><description>&lt;p&gt;Let&amp;rsquo;s say one page on your site is getting hit hard. And I mean, it was digg&amp;rsquo;d or something. If the page resides on some CMS or blog, and each request is being processed by PHP and resulting in requests to your database, which, as they say, crap is gonna hit the fan. Well, at least if you&amp;rsquo;re cheap like me, you&amp;rsquo;ll try to squeeze every penny out of what you&amp;rsquo;ve got.&lt;br&gt;
That said, mod_rewrite comes to the rescue.&lt;br&gt;
There are only a few modifications that you need to do. The first is to ensure that mod_rewrite is enabled. If you have apache installed on debian, this might do:&lt;/p&gt;</description></item><item><title>Resize a Xen Image</title><link>https://www.kelvinism.com/2006/11/resize-xen-image_3704.html</link><pubDate>Wed, 08 Nov 2006 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2006/11/resize-xen-image_3704.html</guid><description>&lt;p&gt;So, you&amp;rsquo;ve got a few Xen images around, and they are starting to fill up. How do you add a few more gigs to &amp;rsquo;em?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; root@tpe:/# xm shutdown vm01
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; root@tpe:/# cd /xenimages
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; root@tpe:/xenimages# dd &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;/dev/zero bs&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;1024&lt;/span&gt; count&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;1000000&lt;/span&gt; &amp;gt;&amp;gt; vm01.img
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; root@tpe:/path/to/images# resize2fs -f vm01.img
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;rsquo;s it, you just added a gig to your image called &amp;lsquo;vm01.img&amp;rsquo;.&lt;/p&gt;</description></item><item><title>Lighttpd+Rewrite+OpenSEF+Joomla</title><link>https://www.kelvinism.com/2006/10/lighttpdrewriteopensefjoomla_4861.html</link><pubDate>Sat, 14 Oct 2006 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2006/10/lighttpdrewriteopensefjoomla_4861.html</guid><description>&lt;p&gt;For those of you not needing Apache and the whole kitchen sink, [insert reason here], Lighttpd is a very attractive contender. For me, it has a small memory footprint, which is highly appealing. However, getting SEO urls to work (i.e. utilizing rewrite), isn&amp;rsquo;t too straightforward.&lt;br&gt;
Tada! A little research yields two helpful links: one at lighttpd.net regarding how to &lt;a href="http://trac.lighttpd.net/trac/wiki/Docs:ModRewrite"&gt;use ModRewrite&lt;/a&gt; and &lt;a href="http://forum.j-prosolution.com/opensef-documentation/1484-opensef-lighttpd.html?highlight=lighttpd"&gt;another&lt;/a&gt; showing how to slightly modify the .htaccess file used by OpenSEF and Apache.&lt;br&gt;
So&amp;hellip;&lt;/p&gt;</description></item><item><title>Convert VMWare Movie to FLV</title><link>https://www.kelvinism.com/2006/09/convert-vmware-movie-to-flv_2236.html</link><pubDate>Sat, 30 Sep 2006 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2006/09/convert-vmware-movie-to-flv_2236.html</guid><description>&lt;p&gt;This little process, a total of two lines, took way to long to figure out.&lt;/p&gt;
&lt;p&gt;First, we convert the VMware avi (VMnc format) to the Microsoft avi format.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; mencoder -of avi -ovc lavc movie.avi -o movie2.avi
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Next, we convert the Microsoft avi format to FLV format.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ffmpeg -i movie2.avi -r &lt;span style="color:#ae81ff"&gt;12&lt;/span&gt; -b &lt;span style="color:#ae81ff"&gt;100&lt;/span&gt; movie.flv
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can play around with the -r switch (rate per second) and the -b switch (bitrate). But, if those get larger, so does your FLV file.&lt;/p&gt;</description></item><item><title>Quick and Dirty Firewall</title><link>https://www.kelvinism.com/2006/08/quick-n-dirty-firewall_8747.html</link><pubDate>Tue, 15 Aug 2006 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2006/08/quick-n-dirty-firewall_8747.html</guid><description>&lt;h4 id="abstract"&gt;Abstract&lt;/h4&gt;
&lt;p&gt;The following is a Quick n&amp;rsquo; Dirty method at implementing a very simple firewall.&lt;/p&gt;
&lt;h4 id="locate-iptables"&gt;Locate IPTables&lt;/h4&gt;
&lt;p&gt;Depending on your server, first locate iptables:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;[&lt;/span&gt;root@vps /&lt;span style="color:#f92672"&gt;]&lt;/span&gt;&lt;span style="color:#75715e"&gt;# which iptables &lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="create-ip-based-acceptdeny"&gt;Create IP Based Accept/Deny&lt;/h4&gt;
&lt;p&gt;Create a whitelist (ignored by firewall) or blacklist (packet dropped) if you wish:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;[&lt;/span&gt;root@vps /&lt;span style="color:#f92672"&gt;]&lt;/span&gt;&lt;span style="color:#75715e"&gt;# vi /usr/local/etc/whitelist.txt &lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And/Or&amp;hellip;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;[&lt;/span&gt;root@vps /&lt;span style="color:#f92672"&gt;]&lt;/span&gt;&lt;span style="color:#75715e"&gt;# vi /usr/local/etc/blacklist.txt &lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In each file, add each IP per line, for instance:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; 4.2.2.2 66.35.15.20
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="firewallsh-script"&gt;firewall.sh Script&lt;/h4&gt;
&lt;p&gt;Then put the following in /etc/init.d/firewall.sh, and edit to fit your needs:&lt;/p&gt;</description></item><item><title>Tips for Passing the MCSE 70-291</title><link>https://www.kelvinism.com/2006/07/tips-for-passing-mcse-70-291_6981.html</link><pubDate>Wed, 19 Jul 2006 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2006/07/tips-for-passing-mcse-70-291_6981.html</guid><description>&lt;p&gt;As you may know, I&amp;rsquo;ve been taking a few of the MCSE:Security tests when I have time.  This afternoon I passed the 70-291, which is claimed to be the hardest of all the tests (and of the one&amp;rsquo;s I&amp;rsquo;ve taken so far, I would concur).&lt;/p&gt;
&lt;p&gt; I&amp;rsquo;m taking my tests at the &lt;a href="http://www.geego.com/"&gt;Geego Systems&lt;/a&gt; center.  If you are in Taipei for some reason, and needing a place to take some tests, this place is a safe bet.  Their staff is pretty darn cool, and they let me drink as much tea as I want.&lt;/p&gt;</description></item><item><title>Cisco IPSec Tutorial</title><link>https://www.kelvinism.com/2006/04/cisco-ipsec-tutorial_5224.html</link><pubDate>Wed, 05 Apr 2006 20:30:00 +1000</pubDate><guid>https://www.kelvinism.com/2006/04/cisco-ipsec-tutorial_5224.html</guid><description>&lt;p&gt;The following sites might be helpful to configure IPSec again, or on a more complex basis:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.cisco.com/univercd/cc/td/doc/product/iaabu/pix/pix_60/ipsec/conipsec.htm"&gt;http://www.cisco.com/univercd/cc/td/doc/product/iaabu/pix/pix_60/ipsec/conipsec.htm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.cisco.com/warp/public/707/overload_private.shtml"&gt;http://www.cisco.com/warp/public/707/overload_private.shtml&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Linux as a TFTP Server</title><link>https://www.kelvinism.com/2006/01/linux-as-tftp-server_570.html</link><pubDate>Mon, 16 Jan 2006 21:30:00 +1100</pubDate><guid>https://www.kelvinism.com/2006/01/linux-as-tftp-server_570.html</guid><description>&lt;p&gt;So, you need a TFTP server for something? Cool, you must be doing something fun. I need a TFTP server to copy Cisco IOS images onto the routers; hopefully you are doing something cooler.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Enable TFTP in inetd.conf&lt;br&gt;
Open up /etc/inetd.conf and look for the following line:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kelvin@pluto:~$ vi /etc/inetd.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;#tftp dgram udp wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot -r blksize&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is on line 72 for me (hint: in vi press ctrl+c, then :set number). Uncomment it. If you don&amp;rsquo;t have this line, bummer. Search for in.tftpd and use that as a substitute.&lt;/p&gt;</description></item></channel></rss>