<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>shocksolution.com</title><link>https://shocksolution.com/</link><description>Recent content on shocksolution.com</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 23 May 2025 20:40:15 +0000</lastBuildDate><atom:link href="https://shocksolution.com/index.xml" rel="self" type="application/rss+xml"/><item><title>Accessing a Mulesoft API mock with curl</title><link>https://shocksolution.com/posts/accessing-a-mulesoft-api-mock-with-curl/</link><pubDate>Fri, 23 May 2025 20:40:15 +0000</pubDate><guid>https://shocksolution.com/posts/accessing-a-mulesoft-api-mock-with-curl/</guid><description>&lt;p&gt;Using curl to access a Mulesoft API mock requires a little trick. Mulesoft gives you the ability to test out a mock of your API design. The easiest way to try the API is to click on the Documentation button on the right side of the API Designer, select an endpoint, and click &amp;ldquo;Try it.&amp;rdquo; If you have made the mock public, you can also use curl to test, but there is a little trick to using curl.&lt;/p&gt;</description></item><item><title>Contact Craig</title><link>https://shocksolution.com/posts/contact-craig__trashed/</link><pubDate>Mon, 05 Sep 2022 03:39:21 +0000</pubDate><guid>https://shocksolution.com/posts/contact-craig__trashed/</guid><description/></item><item><title>Google Apps Script: Spreadsheet to Document</title><link>https://shocksolution.com/posts/google-apps-script-spreadsheet-to-document/</link><pubDate>Thu, 19 May 2022 02:38:02 +0000</pubDate><guid>https://shocksolution.com/posts/google-apps-script-spreadsheet-to-document/</guid><description>&lt;p&gt;For an explanation of this script, see &lt;a href="https://jeffreyeverhart.com/2020/09/29/auto-fill-a-google-doc-template-from-google-sheet-data/"&gt;Jeffrey Everhart&amp;rsquo;s excellent introduction to Apps Script&lt;/a&gt;.&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;function onOpen() {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; const ui = SpreadsheetApp.getUi();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; const menu = ui.createMenu(&amp;#39;AutoFill Docs&amp;#39;);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; menu.addItem(&amp;#39;Create New Docs&amp;#39;, &amp;#39;createNewGoogleDocs&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; menu.addToUi();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;function createNewGoogleDocs() {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; //This value should be the id of your document template that we created in the last step&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; const googleDocTemplate = DriveApp.getFileById(&amp;#39;1It9mTOqk0dVyPVaxmjRXa5tXdWMzgsaDxvb4Nm11nsM&amp;#39;);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; //This value should be the id of the folder where you want your completed documents stored&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; const destinationFolder = DriveApp.getFolderById(&amp;#39;1jeg1V6q1ZJ6OWz-A4LNS5f8GtE9x4SQ4&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; //Here we store the sheet as a variable&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; const sheet = SpreadsheetApp&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; .getActiveSpreadsheet()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; .getSheetByName(&amp;#39;Data&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; //Now we get all of the values as a 2D array&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; const rows = sheet.getDataRange().getValues();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; //Start processing each spreadsheet row&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; rows.forEach(function(row, index){&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; //Here we check if this row is the headers, if so we skip it&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; if (index === 0) return;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; //Here we check if a document has already been generated by looking at &amp;#39;Document Link&amp;#39;, if so we skip it&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; if (row[5]) return;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; //Using the row data in a template literal, we make a copy of our template document in our destinationFolder&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; const copy = googleDocTemplate.makeCopy(`${row[1]}, ${row[0]} Employee Details` , destinationFolder)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; //Once we have the copy, we then open it using the DocumentApp&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; const doc = DocumentApp.openById(copy.getId())&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; //All of the content lives in the body, so we get that for editing&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; const body = doc.getBody();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; //In this line we do some friendly date formatting, that may or may not work for you locale&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; const friendlyDate = new Date(row[3]).toLocaleDateString();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; //In these lines, we replace our replacement tokens with values from our spreadsheet row&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; body.replaceText(&amp;#39;{{First Name}}&amp;#39;, row[0]);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; body.replaceText(&amp;#39;{{Last Name}}&amp;#39;, row[1]);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; body.replaceText(&amp;#39;{{Hours}}&amp;#39;, row[2]);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; body.replaceText(&amp;#39;{{Date Completed}}&amp;#39;, friendlyDate);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; //We make our changes permanent by saving and closing the document&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; doc.saveAndClose();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; //Store the url of our new document in a variable&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; const url = doc.getUrl();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; //Write that value back to the &amp;#39;Document Link&amp;#39; column in the spreadsheet. &#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; sheet.getRange(index + 1, 6).setValue(url)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; })&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&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;&#10; &lt;/div&gt;</description></item><item><title>Google Cloud Build for Cloud Functions</title><link>https://shocksolution.com/posts/google-cloud-build-for-cloud-functions/</link><pubDate>Fri, 29 Apr 2022 18:57:01 +0000</pubDate><guid>https://shocksolution.com/posts/google-cloud-build-for-cloud-functions/</guid><description>&lt;p&gt;This post aims to add some missing information to Google&amp;rsquo;s docs about setting up CI/CD for Cloud Functions with Cloud Build.&lt;/p&gt;&#10;&lt;h2 id="global-vs-regional"&gt;Global vs Regional&lt;/h2&gt;&#10;&lt;p&gt;Cloud Build triggers are &lt;strong&gt;global&lt;/strong&gt;by default. You can create a regional trigger in the Cloud Console by changing the location when editing or creating a trigger.&lt;strong&gt;NOTE:&lt;/strong&gt; I can&amp;rsquo;t find any way at all to create a regional trigger with Terraform.&lt;/p&gt;&#10;&lt;p&gt;However, functions must be &lt;strong&gt;regional&lt;/strong&gt;. The &lt;a href="https://cloud.google.com/build/docs/deploying-builds/deploy-functions"&gt;Google docs&lt;/a&gt; indicate that you must specify a region in your cloud build config file. If you&amp;rsquo;re using a global trigger, the &lt;code&gt;`$LOCATION`&lt;/code&gt; &lt;a href="https://cloud.google.com/build/docs/configuring-builds/substitute-variable-values"&gt;substitution variable&lt;/a&gt; is set to &lt;code&gt;global&lt;/code&gt;, and you&amp;rsquo;ll get a permission error when trying to deploy to a regional function. There are two options that I know of, and neither is great:&lt;/p&gt;</description></item><item><title>Terraform: for_each on a list of resources</title><link>https://shocksolution.com/posts/terraform-for_each-on-a-list-of-resources/</link><pubDate>Thu, 10 Mar 2022 18:25:02 +0000</pubDate><guid>https://shocksolution.com/posts/terraform-for_each-on-a-list-of-resources/</guid><description>&lt;p&gt;Terraform provides a very simply way to use for_each to iterate over a list of resources. If you have a list of strings, use the toset() function to convert the list to a set of strings.&lt;/p&gt;&#10;&lt;h2 id="example-assign-a-unique-role-on-each-resource"&gt;Example: assign a unique role on each resource&lt;/h2&gt;&#10;&lt;p&gt;My use case is setting up a number of dev environments in Google Cloud Platform. The number may change as the size of the dev team increases, so I don&amp;rsquo;t want to hard-code the number of resources anywhere in my Terraform code. The number of environments is stored in the &lt;code&gt;num_envs&lt;/code&gt; variable. For this example, I want to create a group of resources (Google Cloud Storage buckets). Each environment has its own service account, and I want each environment&amp;rsquo;s service account to have a specific role on that environment&amp;rsquo;s bucket. I also want to leverage official Google-supported Terraform modules whenever possible.&lt;/p&gt;</description></item><item><title>Using SSL Certificates with the Apache Tomcat Web Server</title><link>https://shocksolution.com/posts/using-ssl-certificates-with-the-apache-tomcat-web-server/</link><pubDate>Tue, 30 Nov 2021 03:20:26 +0000</pubDate><guid>https://shocksolution.com/posts/using-ssl-certificates-with-the-apache-tomcat-web-server/</guid><description>&lt;h2 id="creating-pkcs12-files"&gt;Creating PKCS12 Files&lt;/h2&gt;&#10;&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/PKCS_12"&gt;PKCS #12&lt;/a&gt; is a format for storing multiple cryptography objects in a single archive file. You can store arbitrarily complex objects within a PKCS #12 archive, but the most common use is to store a single private key and its certificate chain. Create a PKCS12 file from PEM files:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl pkcs12 -export -in ssl_cert.pem -inkey key.pem -certfile bundle.crt -name &amp;#34;*.example.com&amp;#34; -out example.com.p12&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;Depending on the product you&amp;rsquo;re working with, the documentation may call for a .pfx file instead of a .p12 file. PFX is an older format that was a predecessor to PKCS #12. In most modern systems, A PFX FILE AND A P12 FILE ARE EXACTLY THE SAME THING! You can just change the extension if needed and that will generally work. For example, the &lt;a href="https://shocksolution.com/2020/11/11/use-an-ssl-tls-certificate-with-eset-security-management-center-appliance/" title="Use%20an%20SSL/TLS%20Certificate%20with%20ESET%20Security%20Management%20Center%20Appliance"&gt;docs for ESET Security Management Center call for a pfx file, but a PKCS12 file will work just fine&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Auto-Create Multiple Blocks in a Terraform Resource</title><link>https://shocksolution.com/posts/auto-create-multiple-blocks-in-a-terraform-resource/</link><pubDate>Fri, 12 Nov 2021 16:35:50 +0000</pubDate><guid>https://shocksolution.com/posts/auto-create-multiple-blocks-in-a-terraform-resource/</guid><description>&lt;p&gt;Learn how to automatically create multiple Terraform resources, and multiple blocks within one Terraform resource, using the for_each meta-argument and dynamic blocks.&lt;/p&gt;&#10;&lt;h2 id="creating-multiple-resources"&gt;Creating Multiple Resources&lt;/h2&gt;&#10;&lt;p&gt;When using Terraform in a realistic environment (e.g. not a lab or tutorial), you often need to create automatically create multiple resources based on a list or map of data. This article reviews the options for creating resources based on data.There are two general methods to choose from when creating multiple resources:&lt;/p&gt;</description></item><item><title>The Best Mental Model for Writing Terraform Code</title><link>https://shocksolution.com/posts/the-best-mental-model-for-writing-terraform-code/</link><pubDate>Tue, 19 Oct 2021 03:48:29 +0000</pubDate><guid>https://shocksolution.com/posts/the-best-mental-model-for-writing-terraform-code/</guid><description>&lt;p&gt;This article explains my current mental model of Terraform, in the hope that it will save you some time in your learning process. The foundation of using any programming language or software tool correctly is to develop a valid mental model for it, and refine your model as you learn more. There isn&amp;rsquo;t one correct mental model, and your mental model must evolve as your understanding grows.&lt;/p&gt;&#10;&lt;p&gt;Your introduction to writing Terraform code is usually through a very simple example. Unfortunately, simple examples can obscure some of the fundamental concepts of the language. For example, when I first started with Terraform, I did not understand the difference between a variable and a local. Variables need to be declared in a .tf file and defined (assigned a value) in a .tfstate file (or through other means). Variables seem complicated compared to locals. You can just assign a variable to a local and start using it, like a variable in Python. Why use variables when locals seem so much easier?&lt;/p&gt;</description></item><item><title>Define a Google Load Balancer and Cloud Storage bucket with Terraform</title><link>https://shocksolution.com/posts/define-a-google-load-balancer-and-cloud-storage-bucket-with-terraform/</link><pubDate>Thu, 30 Sep 2021 18:11:54 +0000</pubDate><guid>https://shocksolution.com/posts/define-a-google-load-balancer-and-cloud-storage-bucket-with-terraform/</guid><description>&lt;p&gt;Here&amp;rsquo;s an example of using Terraform to define resources to host static content in a Google Cloud Storage bucket, fronted by a Cloud Load Balancer with a custom URL and SSL certificate. This example uses some other advanced features, such as Google Secrets and a map variable to define the SSL certificates. It&amp;rsquo;s pulled from a larger project, so this block of code isn&amp;rsquo;t guaranteed to run as-is. At a minimum, you&amp;rsquo;ll need to define the variables and set values.&lt;/p&gt;</description></item><item><title>How to Enable Multi Factor Authentication (MFA) on your IEEE Email Account</title><link>https://shocksolution.com/posts/how-to-enable-multi-factor-authentication-mfa-on-your-ieee-email-account/</link><pubDate>Wed, 08 Sep 2021 04:03:20 +0000</pubDate><guid>https://shocksolution.com/posts/how-to-enable-multi-factor-authentication-mfa-on-your-ieee-email-account/</guid><description>&lt;p&gt;If you&amp;rsquo;ve been around IEEE for a long time, you remember when your email address ____@ieee.org was just an alias that forwarded all email to your actual email provider. However, in 2013 the IEEE partnered with Google to create an actual Gmail account for your IEEE email address. While the intent behind this benefit is certainly appreciated, it was actually an inconvenience for many of us who were already established with an email provider. We didn&amp;rsquo;t want to migrate our entire digital live to IEEE&amp;rsquo;s new Gmail account. I wrote a popular blog post back in 2013 about &lt;a href="https://shocksolution.com/2013/10/16/how-to-fix-your-ieee-email-alias-so-that-it-delivers-all-messages/"&gt;how to configure your IEEE Gmail account to forward 100% of all email to your actual email provider&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Multi-Page Blueprints for Confluence</title><link>https://shocksolution.com/posts/multi-page-blueprints-for-confluence/</link><pubDate>Wed, 05 May 2021 20:37:05 +0000</pubDate><guid>https://shocksolution.com/posts/multi-page-blueprints-for-confluence/</guid><description>&lt;p&gt;A free demo app is available in the Atlassian Marketplace which supports multi-page blueprints for Confluence. This app works around numerous bugs in the official Atlassian blueprint tutorials and a key Atlassian API bug.&lt;/p&gt;&#10;&lt;h2 id="background-on-confluence"&gt;Background on Confluence&lt;/h2&gt;&#10;&lt;p&gt;&lt;a href="https://%3Cwww.atlassian.com/software/confluence%3E"&gt;Confluence&lt;/a&gt; is one of the leading enterprise wiki products. Its built-in feature set is already very powerful, and it can be extended with &lt;a href="https://marketplace.atlassian.com/addons/app/confluence"&gt;applications available in the Atlassian Marketplace&lt;/a&gt;. You can also write your own applications for private, internal use. Atlassian provides the &lt;a href="https://bitbucket.org/atlassian/atlassian-connect-express/src/master/"&gt;atlassian-connect-express toolkit for building apps with Node.js&lt;/a&gt;, which reduces development time and effort. They also provide a number of &lt;a href="https://bitbucket.org/atlassianlabs/workspace/projects/ATL"&gt;sample projects for Jira and Confluence apps&lt;/a&gt; on Bitbucket. Unfortunately, many of these examples are obsolete or deprecated, and do not function correctly with the latest version of atlassian-connect-express or the latest release of Confluence and Jira.&lt;/p&gt;</description></item><item><title>Node.js: Connecting to MySQL on a socket with Sequelize</title><link>https://shocksolution.com/posts/node-js-connecting-to-mysql-on-a-socket-with-sequelize/</link><pubDate>Thu, 22 Apr 2021 18:54:25 +0000</pubDate><guid>https://shocksolution.com/posts/node-js-connecting-to-mysql-on-a-socket-with-sequelize/</guid><description>&lt;p&gt;According to its official description, &amp;ldquo;&lt;a href="https://sequelize.org/master/index.html"&gt;Sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server.&lt;/a&gt;&amp;rdquo; Sequelize is widely used in Node.js web applications to abstract the database layer. I recently found a &amp;ldquo;corner case&amp;rdquo; for Sequelize which is possible to accomplish, but is not well documented anywhere on the web. I need to use Sequelize to connect to a MySQL server via a UNIX socket. I&amp;rsquo;m developing some plugins for Confluence that use the &lt;a href="https://bitbucket.org/atlassian/atlassian-connect-express/src/master/"&gt;atlassian-connect-express&lt;/a&gt; toolkit, which has a datastore that wraps Sequelize. The way Atlassian has chosen to wrap Sequelize is rather unfortunate, probably because they are trying to maintain backwards compatibility with JugglingDB. Essentially, the Atlassian Connect Express only looks at the URL, and ignores any option passed to Sequelize. Therefore, you have to pass everything you need via the URL, and this is where it&amp;rsquo;s tricky. Here&amp;rsquo;s the form of the URL that you need to connect to MySQL via a UNIX socket with Sequelize:&lt;/p&gt;</description></item><item><title>Enable Port Statistics on a Netgear M4200/M4300 Switch</title><link>https://shocksolution.com/posts/enable-port-statistics-on-netgear-m4200-m4300-switch/</link><pubDate>Mon, 18 Jan 2021 20:12:08 +0000</pubDate><guid>https://shocksolution.com/posts/enable-port-statistics-on-netgear-m4200-m4300-switch/</guid><description>&lt;p&gt;You can enable detailed port statistics via the command-line interface (CLI) on switches in the Netgear M4200/M4300 family. I will explain how to set up a time range and port group, and apply them to a port or range of ports to gather throughput data. This post will make up for some shortcomings in &lt;a href="https://%3Cwww.downloads.netgear.com/files/GDC/M4200/M4200-M4300_CLI_EN.pdf%3E"&gt;Netgear&amp;rsquo;s CLI documentation&lt;/a&gt; about enabling and gathering switching statistics.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;NOTE: you must enter commands &lt;code&gt;enable&lt;/code&gt; and &lt;code&gt;configure&lt;/code&gt; to enter administrative configuration mode prior to setting a time range or port statistics.&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Use an SSL/TLS Certificate with ESET Security Management Center Appliance</title><link>https://shocksolution.com/posts/use-an-ssl-tls-certificate-with-eset-security-management-center-appliance/</link><pubDate>Wed, 11 Nov 2020 21:19:29 +0000</pubDate><guid>https://shocksolution.com/posts/use-an-ssl-tls-certificate-with-eset-security-management-center-appliance/</guid><description>&lt;p&gt;ESET Security Management Center (ESMC) is the replacement for the ESET Remote Administrator (ERA) Server. You can install ESMC as a &amp;ldquo;virtual appliance&amp;rdquo; which will run on hosts such as VMWare or Linux/KVM/QEMU. Under the hood, this appliance is a CentOS 7 server running the Apache Tomcat web server. ESMC is implemented as a Java application that runs as a systemd service. In my experience, ESET is a solid security product, and the free ERA/ESMC provides some rudimentary endpoint management capabilities. Unfortunately, everything about ESET is confusing, from the naming of their products to their documentation. The documentation is thorough&amp;hellip;it&amp;rsquo;s just hard to find what you&amp;rsquo;re looking for, which is usually in multiple overlapping documents that each contain part of the puzzle.&lt;/p&gt;</description></item><item><title>Alert Policies for Log Metrics on Google Stackdriver Monitoring</title><link>https://shocksolution.com/posts/alert-policies-for-log-metrics-on-google-stackdriver-monitoring/</link><pubDate>Tue, 08 Sep 2020 16:31:08 +0000</pubDate><guid>https://shocksolution.com/posts/alert-policies-for-log-metrics-on-google-stackdriver-monitoring/</guid><description>&lt;p&gt;Google Cloud Operations, formerly known as Stackdriver Logging and Monitoring, can be very confusing to set up. It&amp;rsquo;s easy to monitor something simple, but more complex cases quickly get confusing. One of the more flexible but confusing types of alert policies in Stackdriver Monitoring is a Logs-Based Metrics policy, which gives you the ability to monitor entries in Stackdriver Logging.&lt;/p&gt;&#10;&lt;h2 id="create-a-logs-based-metric"&gt;Create a Logs-Based Metric&lt;/h2&gt;&#10;&lt;p&gt;The first step is to go to Stackdriver (Operations) Logging and create a user-defined metric. Go to the Logs Viewer and build a query to return the subset of log entries that you want to monitor (the details of query building are beyond the scope of this article). As of Sept. 2020, I highly recommend enabling the Preview Mode of the Logs Viewer interface, which is much better at guiding you through the process of building the query. If you must use the Classic interface, click the little black arrow at the right side of the filter box, near the top of the Logs Viewer screen. Select &amp;ldquo;Convert to advanced filter&amp;rdquo; from the drop-down menu, and &lt;a href="https://cloud.google.com/logging/docs/view/advanced-queries"&gt;create an advanced filter using the query language&lt;/a&gt;. Once you have created the right filter (query) that selects the log entries that you want to monitor, proceed to the next step:&lt;/p&gt;</description></item><item><title>Testing Access to Google Bigtable</title><link>https://shocksolution.com/posts/testing-access-to-google-bigtable/</link><pubDate>Fri, 05 Jun 2020 20:14:15 +0000</pubDate><guid>https://shocksolution.com/posts/testing-access-to-google-bigtable/</guid><description>&lt;p&gt;This is a minimal PHP script that&amp;rsquo;s useful for verifying connectivity and permissions to read data from a Google Bigtable instance. Unlike some of the sparse examples in Google&amp;rsquo;s PHP SDK, this script will work for any table, and you don&amp;rsquo;t need to know anything about the structure of the table. This script tests the critical elements that need to work together to enable Bigtable access:&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;Credential file&lt;/em&gt; GRPC extension for PHP&#10;&lt;em&gt;Protobuf extension for PHP&lt;/em&gt; Scopes enabled on Compute Engine instances&lt;/p&gt;</description></item><item><title>Dynamic node groups with Salt</title><link>https://shocksolution.com/posts/dynamic-node-groups-with-salt/</link><pubDate>Mon, 13 Apr 2020 12:53:00 +0000</pubDate><guid>https://shocksolution.com/posts/dynamic-node-groups-with-salt/</guid><description>&lt;p&gt;Salt is a great choice for a configuration management system. I have found that it scales well, both in terms of number of nodes, and complexity of configurations. However, I have found one aspect of Salt that remains under-developed: Salt doesn&amp;rsquo;t have great support for custom groupings of minions. Minion groups (which could also be called node groups, host groups, instance groups, etc.) allow you to target a predefined group of minions.&lt;/p&gt;</description></item><item><title>How to use SSL/TLS certificates on a Netgear M4200/4300 switch</title><link>https://shocksolution.com/posts/ssl-tls-certificates-netgear-m4200-4300-switch/</link><pubDate>Fri, 03 Apr 2020 03:50:18 +0000</pubDate><guid>https://shocksolution.com/posts/ssl-tls-certificates-netgear-m4200-4300-switch/</guid><description>&lt;p&gt;If you operate a Netgear switch in an environment that is subject to compliance requirements such as PCI or HIPAA, you are probably doing vulnerability scans, and the HTTP management interface of your switches will generate medium vulnerabilities (at least from Nessus):&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;SSL Self-Signed Certificate&lt;/em&gt;SSL Certificate Cannot Be Trusted* SSL Certificate Expiry&lt;/p&gt;&#10;&lt;p&gt;It &lt;strong&gt;IS&lt;/strong&gt; possible to use signed certificates to secure the HTTPS interface on a Netgear switch, but the process to do so is insanely obscure. I do not know how someone had time to figure this out! Apparently, even Netgear tech support didn&amp;rsquo;t have any idea.&lt;/p&gt;</description></item><item><title>curl or libcurl: SSL certificate problem: unable to get local issuer certificate</title><link>https://shocksolution.com/posts/curl-or-libcurl-ssl-unable-to-get-local-issuer-certificate/</link><pubDate>Tue, 10 Mar 2020 17:00:17 +0000</pubDate><guid>https://shocksolution.com/posts/curl-or-libcurl-ssl-unable-to-get-local-issuer-certificate/</guid><description>&lt;p&gt;curl, or an application that uses libcurl, may have a problem with an SSL certificate that works fine when using a web browser to access the same URL. Typical error output from curl looks like this:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ curl -v https://my-subdomain.mysecuresite.com&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Trying xxx.xxx.xxx.xxx:443…&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; TCP_NODELAY set&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Connected to my-subdomain.mysecuresite.com (xxx.xxx.xxx.xxx) port 443 (#0)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ALPN, offering h2&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ALPN, offering http/1.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; successfully set certificate verify locations:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; CAfile: /etc/ssl/certs/ca-certificates.crt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; CApath: none&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; TLSv1.3 (OUT), TLS handshake, Client hello (1):&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; TLSv1.3 (IN), TLS handshake, Server hello (2):&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; TLSv1.2 (IN), TLS handshake, Certificate (11):&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; TLSv1.2 (OUT), TLS alert, unknown CA (560):&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; SSL certificate problem: unable to get local issuer certificate&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Closing connection 0&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; curl: (60) SSL certificate problem: unable to get local issuer certificate&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; More details here: https://curl.haxx.se/docs/sslcerts.html &#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; curl failed to verify the legitimacy of the server and therefore could not&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; establish a secure connection to it. To learn more about this situation and&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; how to fix it, please visit the web page mentioned above.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;h2 id="troubleshooting-strategy"&gt;Troubleshooting Strategy&lt;/h2&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;A good starting point for any SSL error on a public-facing URL is to &lt;a href="https://%3Cwww.ssllabs.com/ssltest/%3E"&gt;analyze the URL at SSL Labs&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;Does the error happen for all certificates issued by a specific Certificate Authority (CA)? If so, the system running curl may need to have a root certificate for that CA added or updated in its certificate repository. That&amp;rsquo;s a relatively rare problem, but might occur if the system running curl is very old. There&amp;rsquo;s a &lt;a href="https://stackoverflow.com/questions/24611640/curl-60-ssl-certificate-unable-to-get-local-issuer-certificate"&gt;comprehensive thread about this issue on Stack Overflow&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;If the error only happens for one specific site, it&amp;rsquo;s likely that the site is missing an intermediate certificate. The command to diagnose this issue is also found in that Stack Overflow thread:&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl s_client -connect myhost.com:443 -servername myhost.com -showcerts&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;The output should show a series of certificates, starting with the site certificate, and ending with the root certificate for the Certification Authority. If this chain only shows the site certificate, that&amp;rsquo;s the problem.&lt;/p&gt;</description></item><item><title>2020 Ubiquiti Wireless Access Point (WAP) Roundup</title><link>https://shocksolution.com/posts/2020-ubiquiti-wireless-access-point-wap-roundup/</link><pubDate>Tue, 21 Jan 2020 18:05:28 +0000</pubDate><guid>https://shocksolution.com/posts/2020-ubiquiti-wireless-access-point-wap-roundup/</guid><description>&lt;p&gt;Ubiquiti publishes detailed data sheets for all of their products, but it&amp;rsquo;s hard to find all the information you need in one place for comparison purposes. That&amp;rsquo;s the purpose of this article.&lt;/p&gt;&#10;&lt;h2 id="first-generation-access-points"&gt;First Generation Access Points&lt;/h2&gt;&#10;&lt;p&gt;It can be confusing to distinguish between the &lt;a href="https://help.ubnt.com/hc/en-us/articles/360012192813#3"&gt;generations of UniFi access points&lt;/a&gt;; you have to look at the access point label, or access it via the UniFi software to see the version. The performance difference between generations are significant. The &lt;a href="https://dl.ubnt.com/datasheets/unifi/UniFi_AP_DS.pdf"&gt;datasheet for first generation Ubiquiti UAP wireless access points&lt;/a&gt; is still available.&lt;/p&gt;</description></item><item><title>Monitoring a switch or router port via SNMP</title><link>https://shocksolution.com/posts/monitoring-a-switch-or-router-port-via-snmp/</link><pubDate>Mon, 16 Dec 2019 20:19:52 +0000</pubDate><guid>https://shocksolution.com/posts/monitoring-a-switch-or-router-port-via-snmp/</guid><description>&lt;p&gt;Most business-class switches and routers support monitoring via SNMP. The main barrier to implementing SNMP monitoring is that so many parameters can be monitored, and it can be very hard to isolate the most important parameters. This example shows how to monitor the status of a specific port. Note that the term &amp;ldquo;port&amp;rdquo; includes link aggregation groups (LAGs) or other logical groups of ports like VLANs.&lt;/p&gt;&#10;&lt;h2 id="use-case"&gt;Use Case&lt;/h2&gt;&#10;&lt;p&gt;A top-of-rack switch has several important link aggregation groups (LAGs). For example, one LAG has connections to two identical routers in a VRRP cluster. Other LAGs provide redundant network paths to independent NICs on the same server. I want to be alerted if the port status changes on any critical LAG. The ISP delivers Internet to a single port on the switch, which I also want to monitor.&lt;/p&gt;</description></item><item><title>openssl unable to read/load/import SSL private key from GoDaddy</title><link>https://shocksolution.com/posts/openssl-unable-to-read-load-import-ssl-private-key-from-godaddy/</link><pubDate>Mon, 02 Dec 2019 13:24:00 +0000</pubDate><guid>https://shocksolution.com/posts/openssl-unable-to-read-load-import-ssl-private-key-from-godaddy/</guid><description>&lt;p&gt;&lt;a href="https://%3C%3Cwww.openssl.org/&amp;amp;gt%3E;"&gt;openssl&lt;/a&gt; is the standard open-source, command-line tool for manipulating SSL/TLS certificates on Linux, MacOS, and other UNIX-like systems. I recently ran into an interesting problem using openssl to convert a private key obtained from GoDaddy. Someone else used GoDaddy&amp;rsquo;s &amp;ldquo;wizard&amp;rdquo; interface to generate a certificate signing request (CSR) and private key, and saved the files on their Windows workstation. They purchased an SSL cert from GoDaddy, and shared all the files with me for installation on servers. GoDaddy saved the private key in the newer &lt;a href="https://en.wikipedia.org/wiki/PKCS_8"&gt;PKCS #8 format (pkcs8)&lt;/a&gt;, and one system required the key in the older &lt;a href="https://en.wikipedia.org/wiki/PKCS_1"&gt;PKCS #1 (pkcs1) format&lt;/a&gt;. It&amp;rsquo;s easy to tell the difference.&lt;/p&gt;</description></item><item><title>Nginx default user changed in RedHat/CentOS package nginx-1.16.1-1.el7</title><link>https://shocksolution.com/posts/nginx-default-user-changed-in-redhat-centoos-package/</link><pubDate>Tue, 12 Nov 2019 02:58:34 +0000</pubDate><guid>https://shocksolution.com/posts/nginx-default-user-changed-in-redhat-centoos-package/</guid><description>&lt;p&gt;The &lt;a href="https://centos.pkgs.org/7/epel-x86_64/nginx-1.16.1-1.el7.x86_64.rpm.html"&gt;latest Nginx rpm (nginx-1.16.1-1.el7) from EPEL&lt;/a&gt; for CentOS/Redhat is a &lt;a href="https://bugzilla.redhat.com/show_bug.cgi?id=1750857"&gt;fairly major update, from version 1.12 to 1.16, and includes some very important fixes to address multiple CVE&lt;/a&gt;s. There is another small but critical change in the latest RPM that isn&amp;rsquo;t mentioned in the bug report. RedHat had configured nginx to run as user &amp;ldquo;apache&amp;rdquo; in past releases, but in the EPEL release on 19 October 2019, the configuration was changed to run as user &amp;ldquo;nginx&amp;rdquo;. If you ran &amp;ldquo;yum upgrade&amp;rdquo; recently (which you really need to do on a regular basis) on any system with nginx installed, you probably have a system that is affected.&lt;/p&gt;</description></item><item><title>mount.cifs error 13 after update (CentOS/RedHat Linux 7.6)</title><link>https://shocksolution.com/posts/mount-cifs-error-13-after-update-centos-redhat-linux-7-6/</link><pubDate>Wed, 23 Oct 2019 16:23:48 +0000</pubDate><guid>https://shocksolution.com/posts/mount-cifs-error-13-after-update-centos-redhat-linux-7-6/</guid><description>&lt;figure class="ma0 w-75"&gt;&lt;img src="https://shocksolution.com/images/hidde-van-esch-m4N7onAg1oE-unsplash.jpg"&#10;&#9;&#9;&#9;alt="PERMISSION DENIED"&gt;&lt;figcaption&gt;&#10;&#9;&#9;&#9;&lt;p&gt;PERMISSION DENIED&lt;/p&gt;&#10;&#9;&#9;&lt;/figcaption&gt;&#10;&lt;/figure&gt;&#10;&#10;&lt;p&gt;PERMISSION DENIED (Photo by &lt;a href="https://unsplash.com/@holoz?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Hidde van Esch&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/denied?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;)&lt;/p&gt;&#10;&lt;p&gt;If you recently updated your RedHat or CentOS 7.6 system, you may suddenly start getting &amp;ldquo;Permission Denied&amp;rdquo; errors when attempting to mount SMB shares via CIFS. Typical error messages in syslog look like this:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kernel: Status code returned 0xc000006d STATUS_LOGON_FAILURE&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kernel: CIFS VFS: Send error in SessSetup = -13&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kernel: CIFS VFS: cifs_mount failed w/return code = -13&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;h2 id="configuration-that-triggered-the-problem"&gt;Configuration that triggered the problem&lt;/h2&gt;&#10;&lt;p&gt;&lt;em&gt;Synology NAS with latest operating system shares a volume via SMB&lt;/em&gt;CentOS 7 Linux server mounts SMB share using a local username and password (NOT domain credentials)&lt;em&gt;cifs-utils version 6.2 installed in May of 2019 (this by itself worked fine)&lt;em&gt;libsmbclient just updated to 4.9.1-6&lt;/em&gt;libmount just updated to 2.23.2-61&lt;/em&gt;CIFS mount options: vers=3.0,credentials=/root/credentials.txt,sec=ntlmsspi* File /root/credentials.txt contained a username and password that are LOCAL to the SMB server&lt;/p&gt;</description></item><item><title>Secure, Automated Network Device Backups</title><link>https://shocksolution.com/posts/secure-automated-network-device-backups/</link><pubDate>Tue, 03 Sep 2019 16:38:30 +0000</pubDate><guid>https://shocksolution.com/posts/secure-automated-network-device-backups/</guid><description>&lt;p&gt;You probably have at least a few business-class switches and routers silently do their job, year after year. Network devices can be so reliable that we configure them once, and then forget that they exist. However, forgetting them is a really bad idea, since they require regular OS or firmware updates to patch vulnerabilities, and at some point, they will become unreliable and fail. If your device fails, do you have the configuration available to apply to its replacement? Are you sure the configuration that&amp;rsquo;s in your archive or documentation is up to date? This post deals with automating backups from Netgear switches and Ubiquiti EdgeRouters (and possibly switches, if they run EdgeOS). Please check out the accompanying repo at &lt;a href="https://github.com/craigafinch/network-backup-scripts"&gt;&lt;a href="https://github.com/craigafinch/network-backup-scripts"&gt;https://github.com/craigafinch/network-backup-scripts&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Another Reason to Enable Private IP Addresses on Google Cloud SQL</title><link>https://shocksolution.com/posts/another-reason-to-enable-private-ip-addresses-on-google-cloud-sql/</link><pubDate>Wed, 26 Jun 2019 18:16:22 +0000</pubDate><guid>https://shocksolution.com/posts/another-reason-to-enable-private-ip-addresses-on-google-cloud-sql/</guid><description>&lt;p&gt;Google Cloud SQL recently introduced the capability for an instance to have an IP address within the private address space of your VPC network. Previously, all Cloud SQL instances had IP addresses within the address space of the public Internet. Obviously, the public IP was a security and privacy concern, as well as a potential violation of some compliance and governance frameworks. Now, each instance may have a public IP, private IP, or both. There&amp;rsquo;s another potential benefit to using a private IP address: performance!&lt;/p&gt;</description></item><item><title>QNAP NAS: Backup &amp; Sync to Google Cloud Storage</title><link>https://shocksolution.com/posts/qnap-nas-backup-sync-to-google-cloud-storage/</link><pubDate>Sat, 01 Jun 2019 21:17:40 +0000</pubDate><guid>https://shocksolution.com/posts/qnap-nas-backup-sync-to-google-cloud-storage/</guid><description>&lt;p&gt;I have a QNAP NAS at home which I use for file storage. It shares several folders with the family&amp;rsquo;s Mac, Linux, and Windows computers. Many of these files are are irreplaceable, especially our digital photos, so I back them up to the cloud. &lt;a href="https://%3C%3Cwww.qnap.com/solution/hbs3/en/&amp;amp;gt%3E;"&gt;QNAP provides the Hybrid Backup and Sync application&lt;/a&gt;, which supports multiple cloud storage endpoints. QNAP also provides specific documentation for &lt;a href="https://%3C%3Cwww.qnap.com/en/how-to/tutorial/article/how-to-connect-to-google-cloud-storage-with-cloud-backup-sync/&amp;amp;gt%3E;"&gt;backing up and syncing to Google Cloud Storage&lt;/a&gt;. However, QNAP&amp;rsquo;s instructions don&amp;rsquo;t explain how to set up a Google Cloud Storage bucket destination, so here is the procedure I used to set up Google Cloud Storage to back up my QNAP NAS.&lt;/p&gt;</description></item><item><title>Disk space utilization monitoring in Google StackDriver</title><link>https://shocksolution.com/posts/disk-space-utilization-monitoring-in-google-stackdriver/</link><pubDate>Tue, 28 May 2019 18:22:43 +0000</pubDate><guid>https://shocksolution.com/posts/disk-space-utilization-monitoring-in-google-stackdriver/</guid><description>&lt;p&gt;Setting up disk space utilization alerts in Google Stackdriver is almost unbelievably tricky. It&amp;rsquo;s easy to think that you can just choose the metric &amp;ldquo;Disk Utilization&amp;rdquo; and add a condition to alert when disk utilization crosses some threshold for some length of time (such as over 55% for 1 hour).&lt;/p&gt;&#10;&lt;h2 id="file-system-type-filter"&gt;File System Type Filter&lt;/h2&gt;&#10;&lt;p&gt;Your first problem is that a Linux system has many types of file systems, even if it only has one disk. You probably want to alert when your root disk is running out of space; therefore, you need to filter out non-disk filesystems like &lt;a href="https://en.wikipedia.org/wiki/Procfs"&gt;procfs&lt;/a&gt; or tmpfs. Add a device filter to select exactly which devices you want to alert on; in my case, with only one disk per server, I match only on device rootfs.&lt;/p&gt;</description></item><item><title>Managing remote servers with salt-ssh</title><link>https://shocksolution.com/posts/managing-remote-servers-with-salt-ssh/</link><pubDate>Mon, 13 May 2019 21:20:37 +0000</pubDate><guid>https://shocksolution.com/posts/managing-remote-servers-with-salt-ssh/</guid><description>&lt;p&gt;I love using &lt;a href="https://docs.saltstack.com/en/latest/"&gt;Salt&lt;/a&gt; to configure and manage servers at scale. Typically, a Salt master server manages an army of servers which are on the same private network. A salt-minion daemon runs on each client server and communicates with the master. Sometimes you need to manage a server which is outside of your internal network, such as a marketing web server running on a service like AWS LightSail, Linode, or Digital Ocean. That&amp;rsquo;s when salt-ssh comes in handy.&lt;/p&gt;</description></item><item><title>Find Last Login Time for Wordpress Users in the SQL Database</title><link>https://shocksolution.com/posts/find-last-login-time-for-wordpress-users-in-the-sql-database/</link><pubDate>Tue, 16 Apr 2019 16:49:21 +0000</pubDate><guid>https://shocksolution.com/posts/find-last-login-time-for-wordpress-users-in-the-sql-database/</guid><description>&lt;h2 id="question-what-are-the-timestamps-for-the-last-login-for-every-wordpress-user-in-this-wordpress-site"&gt;Question: What are the timestamps for the last login for every Wordpress user in this Wordpress site?&lt;/h2&gt;&#10;&lt;p&gt;Most answers say to install some plugin, and there are dozens that will show the date and time when each Wordpress user last logged in. However, plugins are a problem, because they always need to be kept up to date, and many plugins get abandoned. Now, you have a potential security problem. Also, this approach assumes that your Wordpress front-end is up and running; if your site has been hacked or accidentally broken, you need to go into the database to do some forensics.&lt;/p&gt;</description></item><item><title>MySQL replication fails with WSREP error after restart</title><link>https://shocksolution.com/posts/mysql-replication-fails-with-wsrep-error-after-restart/</link><pubDate>Mon, 11 Mar 2019 12:16:20 +0000</pubDate><guid>https://shocksolution.com/posts/mysql-replication-fails-with-wsrep-error-after-restart/</guid><description>&lt;h2 id="scenario"&gt;Scenario&lt;/h2&gt;&#10;&lt;p&gt;A single Percona MySQL 5.7 server replicates asynchronously with a cluster of Percona MySQL 5.7 servers. After rebooting the single server, replication failed with the following symptoms:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mysql&amp;gt; show slave status \G**************************** 1. row ************** Slave_IO_State: Waiting to reconnect after a failed registration on master Master_Host: my-replication-partner Master_User: repl Master_Port: 3306 Connect_Retry: 60 Master_Log_File: mysql-bin.000120 Read_Master_Log_Pos: 3848512 Relay_Log_File: my-host-hame-relay-bin.000012 Relay_Log_Pos: 4 Relay_Master_Log_File: mysql-bin.000120 Slave_IO_Running: Connecting Slave_SQL_Running: Yes&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;I checked my MySQL text log (/var/log/mysql.log in my case, but the path may vary, or messages may go to syslog) and found the following error:&lt;/p&gt;</description></item><item><title>Updating to Wordpress 5 on a Linux Host: Requesting FTP Credentials</title><link>https://shocksolution.com/posts/updating-wordpress-5-linux-host-ftp-credentials/</link><pubDate>Mon, 14 Jan 2019 17:10:43 +0000</pubDate><guid>https://shocksolution.com/posts/updating-wordpress-5-linux-host-ftp-credentials/</guid><description>&lt;p&gt;Wordpress 5 didn&amp;rsquo;t install automatically on sites hosted on my CentOS 7 Wordpress hosting server. That&amp;rsquo;s by design, because I&amp;rsquo;m selfish and I&amp;rsquo;d rather wait for a few bug-fix releases before making a major upgrade. When I chose to upgrade manually on a test site, Wordpress asked for my FTP credentials:&lt;/p&gt;&#10;&lt;figure class="ma0 w-75"&gt;&lt;img src="https://shocksolution.com/images/Wordpress-permission-problem-300x178.png"&#10;&#9;&#9;&#9;alt="Connection Information"&gt;&lt;figcaption&gt;&#10;&#9;&#9;&#9;&lt;p&gt;Connection Information: FTP credentials&lt;/p&gt;&#10;&#9;&#9;&lt;/figcaption&gt;&#10;&lt;/figure&gt;&#10;&#10;&lt;p&gt;If you&amp;rsquo;re hosting Wordpress on your own server, it &lt;strong&gt;does not need FTP credentials&lt;/strong&gt;. This page is a symptom of a permissions issue with the underlying server.  The web server (typically Apache) is unable to write the updated files to the Wordpress directory. From a security standpoint, this is actually a good thing. You generally don&amp;rsquo;t want to allow a public-facing service to make changes on your server. This problem occurs in other situations, such as configuring the WordFence plugin, so I&amp;rsquo;ve written a page devoted to &lt;a href="https://shocksolution.com/troubleshooting-wordpress-permissions-errors-on-linux-hosts/"&gt;troubleshooting Wordpress permissions on Linux hosts&lt;/a&gt;. That page describes how to fix the permissions issue without compromising the general security of your Wordpress host.&lt;/p&gt;</description></item><item><title>Troubleshooting Wordpress permissions errors on Linux hosts</title><link>https://shocksolution.com/posts/troubleshooting-wordpress-permissions-errors-on-linux-hosts/</link><pubDate>Mon, 14 Jan 2019 16:59:21 +0000</pubDate><guid>https://shocksolution.com/posts/troubleshooting-wordpress-permissions-errors-on-linux-hosts/</guid><description>&lt;p&gt;Wordpress permission errors usually manifest as a request for FTP credentials with the error message, &amp;ldquo;Connection Information: To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.&amp;rdquo; You generally do &lt;strong&gt;not&lt;/strong&gt; need to enter these credentials. If you&amp;rsquo;re hosting Wordpress on your own Linux server, read on to see what might be causing the problem, and how to fix it.&lt;/p&gt;</description></item><item><title>Netgear GS728TS, GS728TPS, GS752TS, and GS752TPS Switch Configuration Guide</title><link>https://shocksolution.com/posts/netgear-gs728ts-gs728tps-gs752ts-and-gs752tps-switch-configuration-guide/</link><pubDate>Sun, 30 Dec 2018 20:05:41 +0000</pubDate><guid>https://shocksolution.com/posts/netgear-gs728ts-gs728tps-gs752ts-and-gs752tps-switch-configuration-guide/</guid><description>&lt;h2 id="overview-of-the-netgear-gs-switch-series"&gt;Overview of the Netgear GS Switch Series&lt;/h2&gt;&#10;&lt;p&gt;Netgear switch models GS728TS, GS728TPS, GS752TS, and GS752TPS (Gigabit Smart Switches) are value-priced edge switches (about $1000 on Amazon for the GS752TPS 48-port model with PoE) with limited Layer 3 routing capabilities. These switches are best deployed as edge switches in a small office environment with a limited budget. The fan noise is annoying but not deafening, so they should be located in a network closet or noise-insulated rack. In the case of budget constraints, the GS7 series could be used as core switches. They can be stacked for high availability, and they support LAGs and bonding to allow equipment with multiple NICs to run one cable to each switch, allowing the equipment to stay up even if one switch unit dies. However, these switches are not really designed for &amp;ldquo;enterprise&amp;rdquo; use as core switches.&lt;/p&gt;</description></item><item><title>Creating Kubernetes Secrets Using TLS/SSL as an Example</title><link>https://shocksolution.com/posts/creating-kubernetes-secrets-using-tls-ssl-as-an-example/</link><pubDate>Fri, 14 Dec 2018 16:15:11 +0000</pubDate><guid>https://shocksolution.com/posts/creating-kubernetes-secrets-using-tls-ssl-as-an-example/</guid><description>&lt;p&gt;Creating Kubernetes secrets isn&amp;rsquo;t intuitive the first time you do it. A common reason to use a secret is to add a SSL/TLS certificate to a cluster. Kubernetes provides two ways to add a secret: directly on the command line, and from a YAML source file. First, let&amp;rsquo;s generate a test certificate to work with and select our cluster.&lt;/p&gt;&#10;&lt;h2 id="prerequisites"&gt;Prerequisites&lt;/h2&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout tls.key -out tls.crt -subj &amp;#34;/CN=foo.bar.com&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;This command produces two files: tls.key and tls.cert. In production, you&amp;rsquo;d generate a key file and use it to obtain a certificate from a certificate authority.&lt;/p&gt;</description></item><item><title>Yum/RPM Package Signing Key Fingerprints</title><link>https://shocksolution.com/posts/rpm-signing-public-key-fingerprints/</link><pubDate>Fri, 19 Oct 2018 21:44:41 +0000</pubDate><guid>https://shocksolution.com/posts/rpm-signing-public-key-fingerprints/</guid><description>&lt;h2 id="the-importance-of-checking-keys"&gt;The Importance of Checking Keys&lt;/h2&gt;&#10;&lt;p&gt;RPM packages are signed using public-key cryptography. A package maintainer uses their private key to sign a package when they create it, and they make the corresponding public key available to the world. When you install a package with Yum or RPM, RPM uses the public key to verify the integrity of the package. If this process weren&amp;rsquo;t in place, it would be very easy to tamper with packages to install malware. When you install a package and you haven&amp;rsquo;t used that package&amp;rsquo;s public key before, yum or RPM prompts you to accept the public key by showing you the public key&amp;rsquo;s &lt;strong&gt;fingerprint&lt;/strong&gt;. The &lt;a href="https://en.wikipedia.org/wiki/Public_key_fingerprint"&gt;fingerprint is a short sequence of bytes used to identify a longer public key&lt;/a&gt;. You should check the fingerprint presented by rpm or yum against a trusted fingerprint (usually published on the package maintainer&amp;rsquo;s web site). If you don&amp;rsquo;t check the fingerprint, you could be importing a public key from a malicious actor, and then yum will happily install whatever malicious payload that actor has inserted into RPM files.&lt;/p&gt;</description></item><item><title>Blog</title><link>https://shocksolution.com/posts/blog/</link><pubDate>Tue, 28 Aug 2018 01:42:00 +0000</pubDate><guid>https://shocksolution.com/posts/blog/</guid><description/></item><item><title>Home</title><link>https://shocksolution.com/posts/home/</link><pubDate>Tue, 28 Aug 2018 01:42:00 +0000</pubDate><guid>https://shocksolution.com/posts/home/</guid><description>&lt;p&gt;Welcome to your site! This is your homepage, which is what most visitors will see when they come to your site for the first time.&lt;/p&gt;</description></item><item><title>Optimize the Wordfence Firewall: Needs FTP Credentials</title><link>https://shocksolution.com/posts/optimize-the-wordfence-firewall/</link><pubDate>Sun, 26 Aug 2018 20:17:21 +0000</pubDate><guid>https://shocksolution.com/posts/optimize-the-wordfence-firewall/</guid><description>&lt;p&gt;I use Wordfence as a Wordpress security solution. Even the free version has a comprehensive set of features, and the premium version is even better. It&amp;rsquo;s very easy to install and configure Wordfence as a regular plugin. However, the step to &amp;ldquo;Optimize the Wordfence firewall&amp;rdquo; fails for many people. This is not the fault of Wordfence, since different steps may be required depending on how your web server is configured. My solution is for those who are hosting their own Wordpress, but may be helpful to other situations. Please note that these instructions affect the security of your system, and are aimed at users with intermediate to advanced Linux knowledge.&lt;/p&gt;</description></item><item><title>How to run Shadowrun: Dragonfall on Ubuntu Linux</title><link>https://shocksolution.com/posts/how-to-run-shadowrun-dragonfall-on-ubuntu-linux/</link><pubDate>Sat, 16 Jun 2018 15:55:16 +0000</pubDate><guid>https://shocksolution.com/posts/how-to-run-shadowrun-dragonfall-on-ubuntu-linux/</guid><description>&lt;p&gt;I&amp;rsquo;m very happy that Harebrained Schemes chose to release its Shadowrun game series (Shadowrun Returns, Shadowrun: Dragonfall, and Shadowrun: Hong Kong) for Linux. It can be a little difficult to get this stuff running on Linux. In this post, I will explain the errors you may see when trying to run Shadowrun on Linux.&lt;/p&gt;&#10;&lt;h2 id="installation-procedure"&gt;Installation Procedure&lt;/h2&gt;&#10;&lt;p&gt;I purchased and downloaded Shadowrun:Dragonfall on sale from &lt;a href="https://%3C%3Cwww.humblebundle.com/&amp;amp;gt%3E;"&gt;Humble Bundle&lt;/a&gt;. 1. Verify file integrity. The md5 checksum is provided on Humble&amp;rsquo;s download page-check the output from this command against what Humble provides. This is how you make sure that you aren&amp;rsquo;t installing a corrupted or infected application on your system: [code language=&amp;ldquo;bash&amp;rdquo;] md5sum shadowrun-dragonfall-linux.tar.gz_2.0.9.zip [/code] 2. Unzip the downloaded file: [code language=&amp;ldquo;bash&amp;rdquo;] unzip shadowrun-dragonfall-linux.tar.gz_2.0.9.zip [/code] 3. Move the unzipped file (shadowrun-dragonfall-linux.tar.gz) to wherever you want to install it. I put it in a subdirectory called &amp;ldquo;Games&amp;rdquo; in my home directory: [code language=&amp;ldquo;bash&amp;rdquo;] mv ~/Downloads/shadowrun-dragonfall-linux.tar.gz ~/Games/ [/code] 4. Unpack the TAR archive. Note that there is a minor error on the part of the developers or Humble; the file you get after unzipping has the wrong file extension, so you have to use a different command than you normally would. The file should be called &amp;ldquo;shadowrun-dragonfall-linux.tar&amp;rdquo; because it&amp;rsquo;s not compressed with gzip. [code language=&amp;ldquo;bash&amp;rdquo;] tar xf shadowrun-dragonfall-linux.tar.gz [/code] 5. Run the game. This probably won&amp;rsquo;t work the first time; see the appropriate section below to install required packages on your system. [code language=&amp;ldquo;bash&amp;rdquo;] ~/Games/Shadowrun\ Dragonfall/Dragonfall Dragonfall: error while loading shared libraries: libGLU.so.1: cannot open shared object file: No such file or directory It seems Shadowrun Dragonfall has exited unsuccessfully (error = 127). Please verify that you have the latest drivers installed before filing a bug report here: &lt;a href="http://harebrained-schemes.com/shadowrun/bug-reports"&gt;http://harebrained-schemes.com/shadowrun/bug-reports&lt;/a&gt; [/code] 6. Install required packages on Ubuntu 16.04 (Xenial) 64-bit (x86_64). Shadowrun is a 32-bit game, but it runs on 64-bit Ubuntu because of Ubuntu/Debian&amp;rsquo;s multilib feature. You just need to install two specific 32-bit libraries that probably aren&amp;rsquo;t on your system by default: [code language=&amp;ldquo;bash&amp;rdquo;] sudo apt-get install libxcursor1:i386 libglu1-mesa:i386 [/code] You also need the appropriate graphics card drivers for your hardware. I have an Nvidia card and I use the proprietary drivers available directly from Nvidia (not the open-source version, which has caused problems for me with other games). If you had to do something differently on another version of Ubuntu, please leave a comment below.&lt;/p&gt;</description></item><item><title>New Relic APM on Fedora/CentOS/RedHat with SELinux Enforcing: Solved</title><link>https://shocksolution.com/posts/new-relic-apm-on-fedora-centos-redhat-with-selinux-enforcing-solved/</link><pubDate>Thu, 14 Jun 2018 03:27:28 +0000</pubDate><guid>https://shocksolution.com/posts/new-relic-apm-on-fedora-centos-redhat-with-selinux-enforcing-solved/</guid><description>&lt;p&gt;I found the solution for getting the New Relic APM Agent to run on a CentOS 7 system with SELinux Enforcing. The only SELinux modification you have to make is to change the context of the log file directory &lt;strong&gt;/var/log/newrelic&lt;/strong&gt;. You can temporarily make these changes with the chcon command: [code lang=&amp;ldquo;bash&amp;rdquo;] chcon -R -t httpd_log_t /var/log/newrelic/ [/code] Kill any running instances of newrelic-daemon. If you&amp;rsquo;re using New Relic&amp;rsquo;s recommended default setup, make sure that the file /etc/newrelic/newrelic.cfg does &lt;strong&gt;not&lt;/strong&gt; exist. Verify that all required values in /etc/php.d/newrelic.ini are correct (especially the license key and the application name). Finally, restart httpd: [code lang=&amp;ldquo;bash&amp;rdquo;] systemctl restart httpd [/code] If that works, you should see output in both /var/log/newrelic/newrelic-daemon.log and /var/log/newrelic/php_agent.log. Now, make this file context change persistent, and verify the result: [code lang=&amp;ldquo;bash&amp;rdquo;] semanage fcontext &amp;ndash;add &amp;ndash;type httpd_log_t &amp;ldquo;/var/log/newrelic(/.*)?&amp;rdquo; restorecon -RF /var/log/newrelic/ ls -laZ /var/log/newrelic/ [/code] When you restart Apache, it spawns the newrelic-daemon processes, which communicate with APM via the socket file /tmp/.newrelic.sock. You really don&amp;rsquo;t want to run the newrelic-daemon processes via systemd if you can avoid it. The resulting process tree should look like this:&lt;/p&gt;</description></item><item><title>Internet Service Comparison: Spectrum Cable Modem vs AT&amp;amp;T Fiber</title><link>https://shocksolution.com/posts/internet-service-comparison-spectrum-cable-modem-vs-att-fiber/</link><pubDate>Tue, 05 Jun 2018 13:24:10 +0000</pubDate><guid>https://shocksolution.com/posts/internet-service-comparison-spectrum-cable-modem-vs-att-fiber/</guid><description>&lt;p&gt;I&amp;rsquo;m moving to a new address in Central Florida which has multiple Internet Service Providers (ISPs) available. Spectrum (formerly BrightHouse) provides speeds up to 100Mbps via cable modem. AT&amp;amp;T just installed fiber in the neighborhood, so I was excited to find out what they would offer.&lt;/p&gt;&#10;&lt;h2 id="spectrum-cable-internet"&gt;Spectrum Cable Internet&lt;/h2&gt;&#10;&lt;p&gt;Here&amp;rsquo;s a cost breakdown by service:&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;Lightning Internet (200Mbps download data rate, 30Mbps upload): $90/month&lt;/em&gt; Static IP address: $10/month&#10;&lt;em&gt;Modem rental: $4/month  (you &lt;em&gt;must&lt;/em&gt; rent a modem to get a static IP)&lt;/em&gt; Taxes: $0.26&lt;/p&gt;</description></item><item><title>Running Unity games via Steam in Linux</title><link>https://shocksolution.com/posts/running-unity-games-via-steam-in-linux/</link><pubDate>Mon, 28 May 2018 19:15:33 +0000</pubDate><guid>https://shocksolution.com/posts/running-unity-games-via-steam-in-linux/</guid><description>&lt;p&gt;There seems to be a lot of confusion about how to run games built on the &lt;a href="https://unity3d.com/"&gt;Unity engine&lt;/a&gt; distributed by Steam on a Linux system. I recently solved this problem after backing the promising &lt;a href="https://%3Cwww.planet-nomads.com/%3E"&gt;survival sandbox game Planet Nomads&lt;/a&gt; on Kickstarter. Here is how to configure an Ubuntu Linux system and launch Planet Nomads successfully.&lt;/p&gt;&#10;&lt;h2 id="prerequisites"&gt;Prerequisites&lt;/h2&gt;&#10;&lt;p&gt;If you have an Nvidia card, you must download and install the &lt;a href="http://%3Cwww.nvidia.com/Download/driverResults.aspx/114708/en-us%3E"&gt;official proprietary drivers provided by Nvidia.&lt;/a&gt; I could not get Unity to launch with the open-source drivers. Once I installed the proprietary (closed source) drivers, I was able to launch Planet Nomads from the Steam application.&lt;/p&gt;</description></item><item><title>Audit terminology: SAS 70, SSAE 16, SSAE 18, SOC1, SOC2, Type 1, Type 2</title><link>https://shocksolution.com/posts/audit-terminology-sas-70-ssae-16-ssae-18-soc1-soc2-type-1-type-2/</link><pubDate>Mon, 21 May 2018 22:08:17 +0000</pubDate><guid>https://shocksolution.com/posts/audit-terminology-sas-70-ssae-16-ssae-18-soc1-soc2-type-1-type-2/</guid><description>&lt;p&gt;If you are involved in information technology and compliance in a heavily regulated industry,  or work with larger organizations, you have probably run across the terms SAS 70, SSAE 16, SSAE 18, SOC 1 report, SOC 2 report, Type 1 Report, and Type 2 Report. These terms are frequently abused and misunderstood, even by compliance &amp;ldquo;experts,&amp;rdquo; so I&amp;rsquo;ve written this brief one-page summary. Everything I state below has a direct reference on the AICPA site; I have learned not to trust third-party sources in regards to compliance.&lt;/p&gt;</description></item><item><title>Configuring Laravel/Lumen applications to connect to SQL database sockets</title><link>https://shocksolution.com/posts/configuring-laravel-lumen-applications-to-connect-to-sql-database-sockets/</link><pubDate>Mon, 14 May 2018 18:58:47 +0000</pubDate><guid>https://shocksolution.com/posts/configuring-laravel-lumen-applications-to-connect-to-sql-database-sockets/</guid><description>&lt;p&gt;The Laravel/Lumen framework documentation does not explain how to connect an application to a database using UNIX sockets instead of a TCP-based network connection. I recently had to configure the &lt;a href="https://polrproject.org/"&gt;Polr URL shortener&lt;/a&gt; (built on the &lt;a href="https://lumen.laravel.com/"&gt;Lumen microframework&lt;/a&gt; by &lt;a href="https://laravel.com/"&gt;Laravel&lt;/a&gt;) to connect to Google Cloud SQL with a UNIX socket. Since all of Polr&amp;rsquo;s configuration takes place in the &lt;strong&gt;.env&lt;/strong&gt; file, and there is no environment variable that&amp;rsquo;s specific to database sockets, this took some research. I finally found the answer in an &lt;a href="https://stackoverflow.com/questions/29305502/php-artisan-migrate-with-mamp-and-unix-socket/39509268#39509268"&gt;obscure StackOverflow response&lt;/a&gt;. Previous TCP connection: [code] DB_HOST=some-server-name DB_PORT=3306 [/code] Socket-based SQL connection: [code] DB_HOST=localhost;unix_socket=/cloudsql/cloud-project-name:us-east1:sql-instance-name [/code] This approach will work with any UNIX socket; you just need to give it the absolute path to the socket.&lt;/p&gt;</description></item><item><title>Configure CentOS/RedHat VMs with Kickstart files on Virtualbox</title><link>https://shocksolution.com/posts/configure-centos-redhat-vms-with-kickstart-files-on-virtualbox/</link><pubDate>Sat, 05 May 2018 18:54:50 +0000</pubDate><guid>https://shocksolution.com/posts/configure-centos-redhat-vms-with-kickstart-files-on-virtualbox/</guid><description>&lt;p&gt;&lt;a href="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/chap-kickstart-installations"&gt;Kickstart&lt;/a&gt; is a type of file that&amp;rsquo;s used to automatically install RedHat or CentOS Linux on a physical or virtual server. If you are managing more than a few servers, it&amp;rsquo;s a good idea to configure the servers via kickstart files instead of logging in and configuring each one manually. However, some unfortunate choices were made when defining the &lt;a href="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/sect-kickstart-syntax"&gt;Kickstart file format&lt;/a&gt;, and it&amp;rsquo;s not the easiest thing to use. When creating a new Kickstart or making major changes, it&amp;rsquo;s good to have way to quickly iterate and test your changes. Iterating on a Kickstart file is slow and inconvenient in an enterprise environment in which a freshly booted server obtains an image and Kickstarter file via PXEboot. To speed up Kickstart testing and debugging, I&amp;rsquo;ve developed a simple way to use Kickstart files with CentOS/RedHat guest virtual machines that run in VirtualBox on my Mac. This process should also work with Windows or Linux hosts. When the RedHat installer is booting, it looks for a file called ks.cfg on a volume with label OEMDRV. First, we will create this volume as a small virtual disk image. On a Mac, you can create this image with Disk Utility as shown below. Note that the Name needs to be OEMDRV (though you can make the filename anything you want). &lt;figure class="ma0 w-75"&gt;&lt;img src="https://shocksolution.com/images/create-oemdrv-disk-image-osx-disk-utility.png"&#10;&#9;&#9;&#9;alt="Create OEMDRV disk image OSX Disk Utility"&gt;&lt;figcaption&gt;&#10;&#9;&#9;&#9;&lt;p&gt;Create OEMDRV disk image OSX Disk Utility&lt;/p&gt;</description></item><item><title>Service account credentials with the Python client for the Google Drive API (v3)</title><link>https://shocksolution.com/posts/service-account-credentials-python-client-google-drive-api-v3/</link><pubDate>Mon, 23 Apr 2018 12:23:29 +0000</pubDate><guid>https://shocksolution.com/posts/service-account-credentials-python-client-google-drive-api-v3/</guid><description>&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; &lt;a href="https://github.com/cfinch/Shocksolution_Examples/blob/master/GoogleCloudPlatform/driveAPIexample.py"&gt;Get the full code for this post on Github&lt;/a&gt;. This article only contains important snippets of code that require explanation.&lt;/p&gt;&#10;&lt;p&gt;There are numerous ways to authenticate against the Google Drive API. If you have an application running on Google Compute Engine that needs to access Drive, a Service Account is probably the easiest way to do it. One use case is for an application to write reports or log files to Drive so that users can see them without logging into a server. Before you try this example, go through all of the steps in Google&amp;rsquo;s &lt;a href="https://developers.google.com/identity/protocols/OAuth2ServiceAccount"&gt;Using OAuth 2.0 for Server to Server Applications&lt;/a&gt; guide and save your service account&amp;rsquo;s private key locally in JSON format. Getting credentials from a service account file is easy:&lt;/p&gt;</description></item><item><title>General error: 2006 MySQL server has gone away</title><link>https://shocksolution.com/posts/general-error-2006-mysql-server-has-gone-away/</link><pubDate>Tue, 10 Apr 2018 03:19:57 +0000</pubDate><guid>https://shocksolution.com/posts/general-error-2006-mysql-server-has-gone-away/</guid><description>&lt;p&gt;&amp;ldquo;MySQL Server has gone away&amp;rdquo; is a cryptic error that can be hard to troubleshoot (look at all the various responses on Stack Overflow!) Many problems can cause this error; I would like to document one specific case. In this example, the client is a PHP app using the Phalcon framework:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[Mon, 09 Apr 18 03:34:08 -0400][ERROR] SQLSTATE[HY000]: General error: 2006 MySQL server has gone away&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;exception &amp;#39;PDOException&amp;#39; with message &amp;#39;SQLSTATE[HY000]: General error: 2006 MySQL server has gone away&amp;#39; in /path/to/ModelBase.php:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Stack trace:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;#0 [internal function]: PDOStatement-&amp;gt;execute()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;...&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;#17 {main}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;This error can be tricky to troubleshoot. I looked in three logs:&lt;/p&gt;</description></item><item><title>Viewing logs for a cluster of instances on Google Stackdriver Logging</title><link>https://shocksolution.com/posts/viewing-logs-for-a-cluster-of-instances-on-google-stackdriver-logging/</link><pubDate>Tue, 27 Mar 2018 14:01:51 +0000</pubDate><guid>https://shocksolution.com/posts/viewing-logs-for-a-cluster-of-instances-on-google-stackdriver-logging/</guid><description>&lt;p&gt;StackDriver Logging is a great feature of Google Compute Engine (GCE). You pretty much need a centralized logging solution if you are taking maximum advantage of the features offered by GCE. For example, most production applications will run on a cluster of web servers. If you set up the cluster as a managed instance group on GCE, Google can auto-scale the size of the cluster based on traffic. The challenge is that it&amp;rsquo;s much  harder to troubleshoot errors across a cluster. The requests that caused the error could be spread across any number of servers, with randomly assigned names. If load drops and the server pool contracts, you will entirely lose any log data on a server that&amp;rsquo;s auto-deleted. StackDriver Logging is the answer to this problem. Configure all servers to send all logs to StackDriver, and you can view all of your web server logs in one interface, with the entries in chronological order. &lt;a href="https://gist.github.com/craigafinch/a2025a867eae1dfc236c6162072024a5"&gt;View StackDriver Advanced Filter as a Gist on GitHub&lt;/a&gt; The problem is that the Stackdriver docs only explain how to select an instance by the instance ID, which is a random-looking string that is not visible in the Console. Further, if you have a large cluster of disposable servers, you would have to look up the ID for every instance. If an instance was deleted when the cluster was auto-scaled, you won&amp;rsquo;t even know what to look up. Therefore, it&amp;rsquo;s much better to search for the logs based on a human-readable server name. For example, assume that your servers are Google Compute Engine instances that are named [region]-[zone]-web-[id]. Here&amp;rsquo;s a filter to match on that naming convention: [sourcecode language=&amp;ldquo;plain&amp;rdquo;] resource.type=&amp;ldquo;gce_instance&amp;rdquo; logName=&amp;ldquo;projects/my-project-name/logs/apache-error&amp;rdquo; labels.&amp;ldquo;compute.googleapis.com/resource_name&amp;rdquo;:&amp;quot;-web-&amp;quot; textPayload:&amp;ldquo;execution time&amp;rdquo; [/sourcecode]&lt;/p&gt;</description></item><item><title>Protecting a RESTful JSON API from a CSRF attack</title><link>https://shocksolution.com/posts/protecting-a-restful-json-api-from-a-csrf-attack/</link><pubDate>Sun, 07 Jan 2018 13:40:57 +0000</pubDate><guid>https://shocksolution.com/posts/protecting-a-restful-json-api-from-a-csrf-attack/</guid><description>&lt;p&gt;&amp;ldquo;Cross-Site Request Forgery (CSRF) is an attack that forces an end user to execute unwanted actions on a web application in which they&amp;rsquo;re currently authenticated&amp;rdquo; (&lt;a href="https://%3Cwww.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF%3E)"&gt;OWASP definition&lt;/a&gt;)&lt;/p&gt;&#10;&lt;p&gt;CSRF is related to Cross-Site Scripting (XSS), but does not require the execution of Javascript or any other front-end code. In fact, APIs are increasingly vulnerable to CSRF attacks due to the emergence of single-page web applications. A single-page web application is a Javascript &amp;ldquo;client&amp;rdquo; application that executes in the user&amp;rsquo;s browser. The client application interchanges data with the server via API calls. There are many advantages to this architecture, but it does increase the attack surface for CSRF attacks. When the user authenticates, they receive a unique token with a limited lifetime, which is usually stored as a cookie. The token is passed to the server as a header on every API call, and the server may return a new token with an updated expiration time with every response.&lt;/p&gt;</description></item><item><title>Upgrade Ubiquiti UniFi Access Points (WAP) now to avoid KrackAttack</title><link>https://shocksolution.com/posts/upgrade-ubiquiti-unifi-access-points-wap-now-to-avoid-krackattack/</link><pubDate>Tue, 17 Oct 2017 15:39:10 +0000</pubDate><guid>https://shocksolution.com/posts/upgrade-ubiquiti-unifi-access-points-wap-now-to-avoid-krackattack/</guid><description>&lt;p&gt;On October 15, 2017, &lt;a href="https://%3Cwww.krackattacks.com/%3E"&gt;security researcher Mathy Vanhoef announced the discovery of KrackAttacks&lt;/a&gt;, a serious flaw in the WPA2 encryption protocol that encrypts most WiFi connections. Using this method, an attacker can decrypt traffic from almost any wireless access point (WAP) and clients. Every WiFi access point will need to be upgraded with patch that prevents this attack. &lt;a href="https://%3Cwww.ubnt.com/%3E"&gt;Ubiquiti&lt;/a&gt; has already &lt;a href="https://community.ubnt.com/t5/UniFi-Updates-Blog/FIRMWARE-3-9-3-7537-for-UAP-USW-has-been-released/ba-p/2099365"&gt;released a patch for UniFi access points&lt;/a&gt; that addresses this vulnerability. However, the upgrade process may not be straightforward, depending on the age of your access points. The following process will ensure that you are running a safe version of the firmware (3.9.3.7537 or later). Note that any upgrade will result in downtime for each access point as it is upgraded, so you will want to perform a rolling upgrade if you have multiple devices that will be upgraded while people are using them.&lt;/p&gt;</description></item><item><title>Warning: CentOS/RedHat 7.4 installs FreeRADIUS 3 with breaking changes</title><link>https://shocksolution.com/posts/warning-centosredhat-7-4-installs-freeradius-3-with-breaking-changes/</link><pubDate>Sun, 01 Oct 2017 17:24:01 +0000</pubDate><guid>https://shocksolution.com/posts/warning-centosredhat-7-4-installs-freeradius-3-with-breaking-changes/</guid><description>&lt;p&gt;When you run yum upgrade on a CentOS/RedHat 7 instance, you will be upgraded to 7.4. If you have a &lt;a href="https://freeradius.org/"&gt;FreeRADIUS&lt;/a&gt; server, you will be upgraded from version 2 to 3, and &lt;strong&gt;your server will likely stop authenticating!&lt;/strong&gt; Good times! Fortunately, the solution was not complicated for us, because we had good documentation.&lt;/p&gt;&#10;&lt;h2 id="symptoms"&gt;Symptoms&lt;/h2&gt;&#10;&lt;p&gt;Your radius server suddenly starts denying logins.&lt;/p&gt;&#10;&lt;h3 id="diagnosis"&gt;Diagnosis&lt;/h3&gt;&#10;&lt;p&gt;The configuration file &lt;code&gt;/etc/raddb/radiusd.conf&lt;/code&gt; has changed enough between versions 2 and 3 that you cannot re-use the old version. To get radius debugging output, stop the radiusd service, and run (as root):&lt;/p&gt;</description></item><item><title>Managing persistent disks on Google Compute Engine</title><link>https://shocksolution.com/posts/managing-persistent-disks-on-google-compute-engine/</link><pubDate>Tue, 19 Sep 2017 12:19:24 +0000</pubDate><guid>https://shocksolution.com/posts/managing-persistent-disks-on-google-compute-engine/</guid><description>&lt;p&gt;It can confusing when you have multiple persistent disks on an instance running on Google Compute Engine. For example, a server may have separate disks for the filesystem root, MySQL data, logs, and /tmp. Once you&amp;rsquo;ve created the Compute Engine disks and attached each one to the instance, how do you know which Compute Engine disk maps to each volume on the instance? First, describe the instance to see a list of the attached disks:&lt;/p&gt;</description></item><item><title>Migration from GoDaddy to Wordpress.com hosting</title><link>https://shocksolution.com/posts/migration-from-godaddy-to-wordpress-com-hosting/</link><pubDate>Thu, 14 Sep 2017 18:42:54 +0000</pubDate><guid>https://shocksolution.com/posts/migration-from-godaddy-to-wordpress-com-hosting/</guid><description>&lt;p&gt;I&amp;rsquo;ve migrated my blog from GoDaddy to a paid plan with &lt;a href="https://refer.wordpress.com/r/2411/wordpress-com/"&gt;Wordpress.com&lt;/a&gt;. I decided to trade flexibility for simplicity, since I don&amp;rsquo;t want to spend time fiddling around with the administration of this site. When I spend all day on IT, doing IT for a blog is no longer on my list of hobbies. With GoDaddy, you are responsible for all aspects of security, including updating Wordpress, updating themes and plugins, and installing a security plugin to block the thousands of known attacks against Wordpress. I have two major security concerns with GoDaddy. I had to allow insecure ciphers in order to connect to the shell on my site via SSH (or SCP). Why on earth haven&amp;rsquo;t they updated to a recent version of SSH?!? GoDaddy also requires you to purchase an SSL certificate from them to enable TLS on your domain. There&amp;rsquo;s no way to install a free certificate from Let&amp;rsquo;s Encrypt. I looked into enabling two-factor auth, but you have to manage it yourself with a plugin. With a Premium plan from Wordpress.com, SSL is enabled automatically with a certificate from Let&amp;rsquo;s Encrypt. I can use my domain name, and security is mostly handled for me. I can enable two-factor authentication. The downside is that I&amp;rsquo;ve lost some flexility; I can&amp;rsquo;t use my own theme or install my own plugins unless I upgrade to a Business plan. Also, I have to set up ads through Wordads.com to try to cover the cost of the site. I was fairly successful in covering the cost of hosting with Google AdSense; I&amp;rsquo;m not sure how effective WordAds will be.&lt;/p&gt;</description></item><item><title>About</title><link>https://shocksolution.com/posts/about-2/</link><pubDate>Wed, 30 Aug 2017 14:57:56 +0000</pubDate><guid>https://shocksolution.com/posts/about-2/</guid><description>&lt;p&gt;This is an example of an about page. Unlike posts, pages are better suited for more timeless content that you want to be easily accessible, like your About or Contact information. Click the Edit link to make changes to this page or &lt;a href="https://wordpress.com/page"&gt;add another page&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Contact</title><link>https://shocksolution.com/posts/contact-2/</link><pubDate>Wed, 30 Aug 2017 14:57:55 +0000</pubDate><guid>https://shocksolution.com/posts/contact-2/</guid><description>&lt;p&gt;Contact me on LinkedIn: &lt;a href="https://%3Cwww.linkedin.com/in/craigafinch%3E"&gt;&lt;a href="https://www.linkedin.com/in/craigafinch"&gt;https://www.linkedin.com/in/craigafinch&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Is there a "Primary Domain Controller" in Active Directory?</title><link>https://shocksolution.com/posts/is-there-a-primary-domain-controller-in-active-directory/</link><pubDate>Thu, 29 Jun 2017 14:08:52 +0000</pubDate><guid>https://shocksolution.com/posts/is-there-a-primary-domain-controller-in-active-directory/</guid><description>&lt;h2 id="the-historical-answer"&gt;The Historical Answer&lt;/h2&gt;&#10;&lt;p&gt;With Windows NT, prior to the advent of Active Directory, there was one Primary Domain Controller (DC) per domain, and every other DC was a Backup.&lt;/p&gt;&#10;&lt;h2 id="the-modern-answer"&gt;The Modern Answer&lt;/h2&gt;&#10;&lt;p&gt;When Active Directory was introduced with Windows 2000, domain controllers became fully multi-master. There is no primary domain controller. However, there are two caveats that may confuse you.&lt;/p&gt;&#10;&lt;h3 id="fsmo-operations-masters"&gt;FSMO Operations Masters&lt;/h3&gt;&#10;&lt;p&gt;Though Active Directory is multi-master, certain operations must take place in a way that ensure consistency across the domain controllers. For this reason, one DC will be designated as the Operations Master for each role. This is &lt;strong&gt;not&lt;/strong&gt;the same thing as a Primary Domain Controller, because there are currently 5 master roles, and a different DC could hold each role. To view the current Operations Masters, run the following at a Windows command prompt: &lt;code&gt;NetDOM /query FSMO&lt;/code&gt; In Powershell, you have to run two commands: &lt;code&gt;Get-ADDomain | Select-Object InfrastructureMaster, RIDMaster, PDCEmulator&lt;/code&gt; &lt;code&gt;Get-ADForest | Select-Object DomainNamingMaster, SchemaMaster&lt;/code&gt;&lt;strong&gt;References:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>MySQL/MariaDB, logrotate, and SELinux</title><link>https://shocksolution.com/posts/mysqlmariadb-logrotate-and-selinux/</link><pubDate>Tue, 17 Jan 2017 03:30:14 +0000</pubDate><guid>https://shocksolution.com/posts/mysqlmariadb-logrotate-and-selinux/</guid><description>&lt;p&gt;&lt;strong&gt;Assumption:&lt;/strong&gt; You have SELinux Enforcing on your database server. If you&amp;rsquo;re still solving problems by permanently setting SELinux to Permissive, I don&amp;rsquo;t think you can really call yourself an IT professional. Here are the commands to set the SELinux context of &lt;a href="https://dev.mysql.com/doc/refman/5.7/en/server-logs.html"&gt;all text MySQL log files&lt;/a&gt; to var_log_t so that they can be rotated by logrotate:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;semanage fcontext -a -t var_log_t &amp;#34;/var/lib/mysql(/.*.log(-[0-9]+(.gz)*)*)+&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;restorecon -R -v -F /var/lib/mysql&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; This expression will also match the file /var/lib/mysql/tc.log and change its context, which will prevent MySQL from starting. If your version of MySQL uses tc.log, here is one possibility:&lt;/p&gt;</description></item><item><title>Synology DiskStation DS1515+ Review</title><link>https://shocksolution.com/posts/synology-diskstation-ds1515-review/</link><pubDate>Sun, 18 Dec 2016 20:19:48 +0000</pubDate><guid>https://shocksolution.com/posts/synology-diskstation-ds1515-review/</guid><description>&lt;p&gt;Summary: The &lt;a href="https://%3Cwww.synology.com/en-us/products/DS1515+%3E"&gt;Synology DS 1515+&lt;/a&gt; is a capable little NAS with a large feature set, but it has some software reliability issues and limited technical support.&lt;/p&gt;&#10;&lt;h2 id="hardware"&gt;Hardware&lt;/h2&gt;&#10;&lt;p&gt;The DS1515+ is a compact unit that feels sturdy. It holds five 2.5&amp;quot; or 3.5&amp;quot; drives, and 3.5&amp;quot; drives can be installed without any tools. You will need a Phillips-head screwdriver to install an additional RAM module, but that&amp;rsquo;s also a very simple process. The fans are also easily replaceable.&lt;/p&gt;</description></item><item><title>anacron run-parts generates invalid or malformed syslog messages</title><link>https://shocksolution.com/posts/anacron-run-parts-generates-invalid-or-malformed-syslog-messages/</link><pubDate>Sun, 06 Nov 2016 02:43:43 +0000</pubDate><guid>https://shocksolution.com/posts/anacron-run-parts-generates-invalid-or-malformed-syslog-messages/</guid><description>&lt;p&gt;On RedHat and CentOS 6 and 7, anacron generates syslog messages that are mangled when they are forwarded by rsyslog. I found &lt;a href="https://bugzilla.redhat.com/show_bug.cgi?id=923111"&gt;the cause and a solution in a comment by Tomas Heinrich on this old Fedora bug&lt;/a&gt;. Sadly, that bug was closed instead of getting fixed, probably because Fedora is oriented toward desktop users who are not generally forwarding syslog messages! Syslog uses the following default template for messages: &lt;code&gt;&amp;quot;%TIMESTAMP% %HOSTNAME% %syslogtag:1:32%%msg:::sp-if-no-1st-sp%%msg%&amp;quot;&lt;/code&gt; The syslogtag field is truncated to 32 characters, but cronie-anacron includes a lot of data in its tag. The tag gets truncated to 32 characters, resulting in invalid syslog. If you try to send them to Logstash, you&amp;rsquo;ll get errors like this: &lt;code&gt;{&amp;quot;message&amp;quot;:&amp;quot;Nov 4 19:01:01 my-web-03 run-parts(/etc/cron.hourly)[1858 starting 0anacron&amp;quot;,&amp;quot;@version&amp;quot;:&amp;quot;1&amp;quot;,&amp;quot;@timestamp&amp;quot;:&amp;quot;2016-11-05T00:01:01.146Z&amp;quot;,&amp;quot;port&amp;quot;:55456,&amp;quot;type&amp;quot;:&amp;quot;syslog&amp;quot;,&amp;quot;tags&amp;quot;:[&amp;quot;_grokparsefailure&amp;quot;],&amp;quot;host_ip&amp;quot;:&amp;quot;192.168.17.23&amp;quot;}&lt;/code&gt; Unfortunately, the problem is with the sending host, not Logstash, so you have to update the rsyslog config on &lt;em&gt;every&lt;/em&gt; host that generates anacron messages. I prefer to do this in /etc/rsyslog.d to keep the configs more manageable. Add these two lines, which add a template that has no restriction on the length of the tag field, and activate the template when forwarding: &lt;code&gt;$Template fwd,&amp;quot;%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg%&amp;quot; $ActionForwardDefaultTemplate fwd&lt;/code&gt; I placed these lines in /etc/rsyslog.d/logstash.conf along with my other Logstash-specific rsyslog configs.&lt;/p&gt;</description></item><item><title>Failed to schedule Software Protection service for re-start: Error Code: 0x80041316</title><link>https://shocksolution.com/posts/failed-to-schedule-software-protection-service-for-re-start-error-code-0x80041316/</link><pubDate>Sat, 08 Oct 2016 17:35:20 +0000</pubDate><guid>https://shocksolution.com/posts/failed-to-schedule-software-protection-service-for-re-start-error-code-0x80041316/</guid><description>&lt;p&gt;This post documents how to resolve the following error message, which may appear for no particular reason, and flood the Windows event log: &lt;code&gt;Failed to schedule Software Protection service for re-start at 2116-09-14T16:54:27Z. Error Code: 0x80041316.&lt;/code&gt; The following steps will resolve the error on Windows Server 2012r2, but based on other links, similar steps should work for Windows 8, 8.1, or Server 2012.&lt;/p&gt;&#10;&lt;h2 id="root-cause"&gt;Root Cause&lt;/h2&gt;&#10;&lt;p&gt;The root cause, in my case, was a corruption in the XML files that control task scheduling for the Software Protection service. I am not sure what caused this error, but it appeared to start after a domain controller was not shut down cleanly. &lt;a href="https://support.microsoft.com/en-us/kb/3033200"&gt;Microsoft&amp;rsquo;s official documentation reports that another cause may be a mismatch between the permissions used to run the task and the permissions on the files that control the task&lt;/a&gt;. However, most people have reported that the problem is caused by corrupted XML files. Also, note that the Microsoft documentation is inaccurate when it states that the task must run as the &lt;strong&gt;NETWORK SERVICE&lt;/strong&gt;account. If the task is triggered by an interactive user logon, it should run as account&lt;strong&gt;Interactive&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Making Windows work for Linux and OS X admins</title><link>https://shocksolution.com/posts/making-windows-work-for-linux-and-os-x-admins/</link><pubDate>Wed, 25 May 2016 04:10:17 +0000</pubDate><guid>https://shocksolution.com/posts/making-windows-work-for-linux-and-os-x-admins/</guid><description>&lt;p&gt;If you are a Linux or OS X power user, then you&amp;rsquo;re used to having all the necessary tools built into your OS. When you log into a Windows system (What! No command line?) you may feel lost. These tools and shortcuts will help you be productive on Windows systems.&lt;/p&gt;&#10;&lt;h2 id="windows-shortcuts"&gt;Windows Shortcuts&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Alt-x is a magic shortcut key on Windows 8 and Server 2012. It pops up a little menu in the lower right corner of the screen which contains just the items that an admin needs. Try it!&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="windows-programs"&gt;Windows Programs&lt;/h3&gt;&#10;&lt;p&gt;If you want Windows to work a little bit like Linux or OS X, you need to install a few of these free programs. Some are &lt;em&gt;gratis&lt;/em&gt;, and some are &lt;em&gt;libre&lt;/em&gt;.&lt;/p&gt;</description></item><item><title>Microsoft Baseline Security Analyzer Troubleshooting</title><link>https://shocksolution.com/posts/microsoft-baseline-security-analyzer-troubleshooting/</link><pubDate>Fri, 25 Mar 2016 03:30:36 +0000</pubDate><guid>https://shocksolution.com/posts/microsoft-baseline-security-analyzer-troubleshooting/</guid><description>&lt;p&gt;&lt;a href="https://%3Cwww.microsoft.com/en-us/download/details.aspx?id=7558%3E"&gt;Microsoft Baseline Security Analyzer (MBSA)&lt;/a&gt; is a useful tool for auditing the configuration and update status of Windows computers. Most of the time, its reports are useful and easy to understand. However, some of its responses are baffling, and some of its suggested solutions haven&amp;rsquo;t been updated since Server 2003. Here is my collection of odd MBSA reports, and how to resolve them.&lt;/p&gt;&#10;&lt;h2 id="internet-explorer"&gt;Internet Explorer&lt;/h2&gt;&#10;&lt;p&gt;MBSA Reports:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;The use of Internet Explorer is not restricted for administrators on this server&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;Solution: &lt;a href="https://social.technet.microsoft.com/Forums/security/en-US/d6834f77-32c3-40e7-897f-c5d7f601d6b1/mbsa-23-internet-explorer-is-not-restricted-server-core"&gt;Enable IE Enhanced Security Configuration in the Server Manager&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Troubleshooting SSSD, realm, kerberos, and SSH</title><link>https://shocksolution.com/posts/troubleshooting-sssd-realm-kerberos-and-ssh/</link><pubDate>Thu, 10 Mar 2016 19:51:20 +0000</pubDate><guid>https://shocksolution.com/posts/troubleshooting-sssd-realm-kerberos-and-ssh/</guid><description>&lt;p&gt;&lt;a href="https://fedorahosted.org/sssd/"&gt;SSSD (System Security Services Daemon)&lt;/a&gt; allows Linux systems (specifically, Red Hat, CentOS, and Fedora) to verify identity and authenticate against remote resources. If you have a CentOS or Red Hat enterprise system, and you need to authenticate against a domain controller such as FreeIPA or Active Directory, SSSD is the way to go. I use SSSD on CentOS 7 systems, but it is now &lt;a href="https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html-single/Deployment_Guide/index.html#SSSD-Introduction"&gt;available on CentOS 6&lt;/a&gt; as well. A few years ago, adclient (an open-source project from &lt;a href="https://%3C%3Cwww.centrify.com/&amp;amp;gt%3E;"&gt;Centrify&lt;/a&gt;) was your only option to make a CentOS 6 server authenticate against Active Directory. adclient seems to have reached end of life, so SSSD is definitely the path forward. I won&amp;rsquo;t repeat the &lt;a href="https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Windows_Integration_Guide/SSSD-AD.html"&gt;procedure for using Active Directory as an identity provider on a Red Hat 7 system&lt;/a&gt;. Instead, I want to provide a few troubleshooting tips, since limited information is available on SSSD and related tools.&lt;/p&gt;</description></item><item><title>ODEPACK: Numerical Solutions to ODEs</title><link>https://shocksolution.com/posts/odepack-numerical-solutions-to-odes/</link><pubDate>Wed, 22 Jul 2015 23:52:21 +0000</pubDate><guid>https://shocksolution.com/posts/odepack-numerical-solutions-to-odes/</guid><description>&lt;p&gt;ODEPACK is a library for the numerical solution of systems of ordinary differential equations. It is written in Fortran 77, but can be accessed from C and C++ with only a little effort. The &lt;a href="http://%3C%3Cwww.netlib.org/odepack/&amp;amp;gt%3E;"&gt;permanent home of ODEPACK is in the ODEPACK directory at netlib&lt;/a&gt;. Surprisingly, there are very few open-source libraries that perform the functions of ODEPACK.&lt;/p&gt;&#10;&lt;h2 id="a-friendlier-distribution-of-odepack"&gt;A friendlier distribution of ODEPACK&lt;/h2&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/cfinch/odepack"&gt;&lt;a href="https://github.com/cfinch/odepack"&gt;https://github.com/cfinch/odepack&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;ODEPACK is distributed as fixed-format Fortran 77 source with plain text files offering documentation and examples. It is not the friendliest distribution, because there are no makefiles and even the examples are buried in commented-out sections of the solver source code. It seems that ODEPACK was designed to be used in source form, perhaps by copying relevant functions and pasting them into your own Fortran program, or compiling ODEPACK right into your program. In an effort to get ODEPACK running for my own use, I have developed a friendlier distribution. I created a Makefile that will compile ODEPACK as a shared library, using the Gnu compiler collection (gcc), and separated the demonstration code into a directory of standalone programs. I intended to make it publicly available&amp;hellip;but I never did. Ask me if you want it!&lt;/p&gt;</description></item><item><title>LVM device-mapper: reload ioctl failed: Invalid argument</title><link>https://shocksolution.com/posts/lvm-device-mapper-reload-ioctl-failed-invalid-argument/</link><pubDate>Fri, 19 Dec 2014 17:23:19 +0000</pubDate><guid>https://shocksolution.com/posts/lvm-device-mapper-reload-ioctl-failed-invalid-argument/</guid><description>&lt;p&gt;&lt;a href="https://%3C%3Cwww.sourceware.org/lvm2/&amp;amp;gt%3E;" title="LVM2"&gt;LVM2 (Logical Volume Management)&lt;/a&gt; is pretty amazing, but when something goes wrong, it&amp;rsquo;s not easy to troubleshoot. This is not the fault of the tools, but a reflection that LVM is relatively new in Linux, and not widely understood.&lt;/p&gt;&#10;&lt;h2 id="what-i-tried-to-do"&gt;What I Tried to Do&lt;/h2&gt;&#10;&lt;p&gt;I tried to &lt;a href="http://manpages.ubuntu.com/manpages/utopic/en/man8/lvextend.8.html" title="man%20lvextend%20Ubuntu"&gt;increase the size of a logical volume with the lvextend command&lt;/a&gt;:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;lvextend --extents 100%FREE /dev/VolumeGroup1/var&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;This form of the command is supposed to use all of the free space in the volume group.&lt;/p&gt;</description></item><item><title>GPG Public Key</title><link>https://shocksolution.com/posts/pgp-public-key/</link><pubDate>Fri, 12 Dec 2014 02:55:06 +0000</pubDate><guid>https://shocksolution.com/posts/pgp-public-key/</guid><description>&lt;p&gt;For secure communication, please use this public key with a program such as &lt;a href="https://%3Cwww.gnupg.org/%3E" title="GPG:%20GNU%20Privacy%20Guard"&gt;GPG&lt;/a&gt;.&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;-----BEGIN PGP PUBLIC KEY BLOCK-----&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mQENBFG/wr8BCADEHyfWlnkXWhpce55iWxx8ho7TyqKqOm0+ozc2Skq16asN/2+m&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;KsOAfFEM24+dTYO0QLcmuC6gUDLGibqWHO86zEtL8LCh7wUu0M+i5JTm76etWrDB&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;J2RgI1A/B+F93yJ7pvOEdL3FCUZYhdWrQrPwWqR/eHE5Y/O/WZyyGV7K8sf6p0Na&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;if6J+CsiI36LZlxN32+vdqimZXJRaLG58Dl/EGxbfuQSzwxUpHRXXYDwQCeZb1A3&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;p42Ona6Ls5V61CfN2OTazNJi8wVG3r5fb9OrfXQRpC9v17YHNnw/zIn7Em6ITsN/&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;wuDQpB3wYEvtDXUvd88D24Dzp5DZC5c2uQ2lABEBAAG0HUNyYWlnIEZpbmNoIDxj&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ZmluY2hAaWVlZS5vcmc+iQE3BBMBCgAhBQJRv8K/AhsvBQsJCAcDBRUKCQgLBRYC&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;AwEAAh4BAheAAAoJEEMumm9LZ5ofLpMH/1IL/xmv2IzyKosA2ItQxoQRU2CCV5Iv&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;VmU8qGulTNLZ1bcuVfIuu3nCsUWPpSTQD9iNjjyMVW4U9c4DGkVAD33z7na9oesQ&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ApWMPYV/PygzgGK0TYwpl5r9DC154A9xfeFhEizgPWRnRvMNWNrOrZWMDSJkArYf&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tWGsDSfK3xfbRq8rmT4CtSaB/+oY5ELwyJioqqaapYXjbCIDe9uXv/3WrfZ2j1/8&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mS/JU+rT6YmLLywAjkRbcBtzIQ8TvzWR36U2+iDGLFDnrRBkEjqMn28aNLuEE6rh&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;WoY8Z3j7G/i1uX471ZtHuikJgRaYyMvTgvftQNXm2jahpF+hV8Z/DfW5AQ0EUb/C&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;vwEIAOME/hg3s6hYyX2C71rcrM3Ww1hA+DugSMyAeJjA+0b/mRRL2+gD00eMspKz&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;z5H+U/K702uoxZqwpJB2KPTd9GK560Aq9KCXmrAlykDHZ1d3yE/U42wdcCo4mxyF&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;vqE+xH81WFxQTqt3JQm1XD+v38e0uFmXXUNp1Pk7i7xJwWyhYX4PIfGL967475Sl&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;9Zbx6kSXM43qM6awXeIm91uM0fG1kMVo46hK+YalwNdS1E8IoKDKVFd0xE76vDwG&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;LVZGhyobt81v8aFt0M+YqRUGvyt4pcJj53bfLQF2vK/mafTFiz+2mra4iWz4qsOC&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cgOjxRl+qs2MDgmcZJyovZcJYfMAEQEAAYkCPgQYAQoACQUCUb/CvwIbLgEpCRBD&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;LppvS2eaH8BdIAQZAQoABgUCUb/CvwAKCRBXsWWtFiBEh/y5B/46B/8FtVRu3TW5&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mLaZ0uI1L/GH1CbwnMWrGSoV6duzNio35ERrXLcjoEpyRyrjzR0RabicOedoBXA1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;s0Jo9QqZipVIwd3EOpUEOB7eeEtyeEHrqmv9MrCNw/ikWCATrSDamt338TnxzFxs&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;rTEjL8N6/v61U9vfwwsxenyVXijMpBJMHpA8SkWs2O734FtMeHyvteSlqrVa6B+0&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;g9qNJegoqWGWIJeT01zElVY+JSaR+/ddv7Qg7DNA3M1X+lvgAa9/tqjcXfDsumDJ&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;TGaTOZPdLBLlV7JUu0FB9hKGOtKfClm0kX4+n5JXvFClw02wE+/Jvw57EhCiCs56&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;/upV7LVm+QsH/R2GOxEL1NUzWbRprl65o3siWiDQpDR9x9drJftwpMuHXGeZ5j9j&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;beBl4gXMqmfNHBg9xOD3Mdq0YpC/BE+LMytHleXNG6oQ9aYzmExcCfRMy9fF3pgJ&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;hkcHrv4LMUvfh7eRQ/24DO9TJKwFKEKged6VPFzd1AZRWq6VA7oBVVjaQ0dBnPv8&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;P3NeeizEkswQJ2eiL6nS5iXlxDKt4pTXLmiVIFaJpKM3wn0ynVM+5UKvTpIsQosk&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ce77x7fVQvNFkeXKFMLcofKIOxIPSwp0b9f+t7YsDW9Fef7A6J9e1jseUabt2pqq&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;joE4qHsXUV2ZsL7kIKGg4vJMO1yeUntRsqk=&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;=Tl2n&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;-----END PGP PUBLIC KEY BLOCK-----&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;</description></item><item><title>Is it worthwhile to embed structured data in Web content?</title><link>https://shocksolution.com/posts/is-it-worthwhile-to-embed-structured-data-in-web-content/</link><pubDate>Sun, 09 Nov 2014 18:03:16 +0000</pubDate><guid>https://shocksolution.com/posts/is-it-worthwhile-to-embed-structured-data-in-web-content/</guid><description>&lt;p&gt;Short answer: not really! A few years ago, I was fascinated with the idea of &lt;a href="http://microformats.org/" title="Microformats"&gt;microformats&lt;/a&gt;. The concept is to add structural data to common HTML tags so that certain types of data on a web page can be clearly identified. Adding structural information makes it easier to automate the parsing and indexing of web content. The original microformats included common data sets that contain well-defined data, such as contact information or a calendar event. In the intervening years, microformats were replaced by &lt;a href="http://microformats.org/wiki/microformats2" title="microformats2"&gt;microformats2&lt;/a&gt;, with additional draft standards for more items such as recipes, resumes, etc. I decided to use &lt;a href="https://shocksolution.com/files/microdata_resume_Craig_Finch.html" title="Craig Finch's Resume as structured microdata"&gt;my resume&lt;/a&gt; as a &amp;ldquo;use case&amp;rdquo; for structured HTML data. My original plan was to use the &lt;a href="http://microformats.org/wiki/h-resume" title="h-resume%20microformats2"&gt;h-resume&lt;/a&gt; draft specification from microformats2. I modified my plan when I realized that major search engines (Bing, Google, Yahoo! and Yandex) have decided to parse another semantic technology, &lt;a href="https://support.google.com/webmasters/topic/4598337" title="Microdata"&gt;microdata&lt;/a&gt; (&lt;a href="http://%3C%3Cwww.w3.org/TR/microdata/&amp;amp;gt%3E;" title="Microdata%20spec%20at%20W3C"&gt;microdata W3C spec&lt;/a&gt;). There is no point in creating semantic web pages if nobody is going to parse them, so I used the &lt;a href="http://schema.org/" title="microdata%20specifications"&gt;microdata specifications that are available at schema.org&lt;/a&gt; and placed them into an h-resume framework.  I used the &lt;a href="https://support.google.com/webmasters/answer/164506" title="microdata%20event%20class%20at%20Google"&gt;event class&lt;/a&gt; to represent each position I held or educational achievement, because the event class is the only one with start and end dates. Is it worth the effort to add structured data to HTML pages? Generally, no. Here&amp;rsquo;s why:&lt;/p&gt;</description></item><item><title>Monitoring with SNMP, Part 3: Automate active monitoring with Nagios</title><link>https://shocksolution.com/posts/monitoring-with-snmp-part-3-automate-active-monitoring-with-nagios/</link><pubDate>Mon, 12 May 2014 12:29:08 +0000</pubDate><guid>https://shocksolution.com/posts/monitoring-with-snmp-part-3-automate-active-monitoring-with-nagios/</guid><description>&lt;p&gt;My last post showed &lt;a href="https://shocksolution.com/2014/05/monitoring-with-snmp-part-2-command-line-tools-for-active-snmp/" title="Monitoring%20with%20SNMP,%20Part%202:%20Command-line%20tools%20for%20active%20SNMP"&gt;how to monitor networked devices with SNMP&lt;/a&gt;. You could try to remember to manually check the status of things periodically, but that would be missing the point of computers. Instead, &lt;a href="http://%3Cwww.nagios.com/%3E" title="Nagios"&gt;automate your monitoring with Nagios, a web-based monitoring tool for Linux&lt;/a&gt; that automates the process of actively querying devices and doing something with the information. Nagios is available as free open source software (Nagios Core), and the company offers additional non-free products with premium features. The open-source version is fine for getting started and setting up basic monitoring. Nagios does a lot more than just SNMP monitoring. I&amp;rsquo;ll refer you to the &lt;a href="http://nagios.sourceforge.net/docs/nagioscore/" title="Nagios%20Core%20Documentation"&gt;Nagios Core documentation&lt;/a&gt; to get Nagios up and running, and I&amp;rsquo;ll focus on how to set up Nagios to actively monitor devices with SNMP.&lt;/p&gt;</description></item><item><title>Monitoring with SNMP, Part 2: Command-line tools for active SNMP</title><link>https://shocksolution.com/posts/monitoring-with-snmp-part-2-command-line-tools-for-active-snmp/</link><pubDate>Fri, 02 May 2014 18:27:02 +0000</pubDate><guid>https://shocksolution.com/posts/monitoring-with-snmp-part-2-command-line-tools-for-active-snmp/</guid><description>&lt;p&gt;&lt;a href="https://shocksolution.com/2014/03/monitoring-with-snmp-part-1-fundamentals-of-snmp/" title="Monitor%20with%20SNMP:%20Fundamentals%20of%20SNMP"&gt;In Part 1, I summarized the basic concepts of SNMP&lt;/a&gt; and defined the terms and acronyms used in this post. Now, I will show how to use SNMP to monitor actual devices. As an example, I will monitor an enterprise-grade uninterruptible power supply (UPS) and power distribution unit (PDUs) from &lt;a href="http://%3Cwww.tripplite.com/%3E" title="Tripp-Lite"&gt;Tripp-Lite&lt;/a&gt;. These devices have an &lt;a href="http://%3Cwww.tripplite.com/sku/SNMPWEBCARD/%3E" title="Tripp-Lite%20SNMPWEBCARD"&gt;SNMPWEBCARD&lt;/a&gt; installed to support communication over Ethernet. Command-line tools for SNMP communication should be available for any Linux distribution (or any other UNIX-derived OS). &lt;a href="http://%3Cwww.net-snmp.org/docs/man/%3E" title="SNMP%20Tool%20Documentation"&gt;Documentation for the basic SNMP tools is available online&lt;/a&gt;. The challenge with SNMP is figuring out what parameters are supported by a particular device. Most devices support a set of standard OIDs that return basic information such as device name, uptime, etc.&lt;/p&gt;</description></item><item><title>Monitoring with SNMP, Part 1: Fundamentals of SNMP</title><link>https://shocksolution.com/posts/monitoring-with-snmp-part-1-fundamentals-of-snmp/</link><pubDate>Wed, 05 Mar 2014 16:14:49 +0000</pubDate><guid>https://shocksolution.com/posts/monitoring-with-snmp-part-1-fundamentals-of-snmp/</guid><description>&lt;p&gt;SNMP is a protocol for conveying information and controlling devices over a network. SNMP can be used in two ways:&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;Active: a device sends a command to set a parameter or request information for another device&lt;/em&gt; Passive: a device sends an alert (called a trap) to another device, which is configured to receive traps and do something with the information.&lt;/p&gt;&#10;&lt;p&gt;The &amp;ldquo;payload&amp;rdquo; of an SNMP message is called an Object Identifier, or OID. An OID is an ordered list of non-negative numbers, such as:&lt;/p&gt;</description></item><item><title>"Exporting" a project from a Git repository</title><link>https://shocksolution.com/posts/exporting-a-project-from-a-git-repository/</link><pubDate>Fri, 24 Jan 2014 18:48:31 +0000</pubDate><guid>https://shocksolution.com/posts/exporting-a-project-from-a-git-repository/</guid><description>&lt;p&gt;What do you do when you want to distribute or release source code that is stored in a Git repository? Obviously, if your target audience is using Git, you can just compress the directory that contains the repository and distribute the copies, or give the users a way to clone your repository (such as &lt;a href="https://github.com/" title="GitHub"&gt;GitHub&lt;/a&gt;). However, your audience may not be Git users, or the hidden .git directory may be very large and you don&amp;rsquo;t want to distribute it. The solution is the &lt;strong&gt;git archive&lt;/strong&gt; command, which packs the files from a tree-ish into an achive (ZIP or TAR). By &amp;ldquo;tree-ish&amp;rdquo;, they mean that you can specify a branch, commit, HEAD, etc. &lt;code&gt;git archive&lt;/code&gt; is somewhat analagous to the &lt;code&gt;svn export&lt;/code&gt; command. I find the most useful form of this command to be: &lt;code&gt;cd example git archive --output ~/example.zip --format=zip --prefix=example/ HEAD&lt;/code&gt; Do not forget the trailing slash after the directory that you specify with the &lt;code&gt;--prefix&lt;/code&gt; flag! REFERENCE: &lt;a href="http://stackoverflow.com/questions/160608/how-to-do-a-git-export-like-svn-export"&gt;How to do a &amp;ldquo;git export&amp;rdquo; (like svn export)&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Running network experiments on the GENI project</title><link>https://shocksolution.com/posts/running-network-experiments-on-the-geni-project/</link><pubDate>Fri, 17 Jan 2014 20:50:04 +0000</pubDate><guid>https://shocksolution.com/posts/running-network-experiments-on-the-geni-project/</guid><description>&lt;p&gt;&lt;a href="http://%3Cwww.geni.net/%3E" title="GENI%20Project"&gt;The GENI Project&lt;/a&gt; is a networking testbed that is used by researchers studying novel networking technologies. While the technology is fascinating, the web site is, unfortunately, a confusing mess. Here are some pointers to get you started (or refresh your memory). This post will be updated as I learn more.&lt;/p&gt;&#10;&lt;h2 id="key-geni-links"&gt;Key GENI Links&lt;/h2&gt;&#10;&lt;h3 id="geni-portal"&gt;GENI Portal&lt;/h3&gt;&#10;&lt;p&gt;This is where you &lt;a href="https://portal.geni.net" title="GENI%20Portal"&gt;log into the GENI Project&lt;/a&gt;. Your institution must have Shibboleth enabled and be part of the InCommon Federation. Click on the &amp;ldquo;Use GENI&amp;rdquo; button, enter the name of your institution into the search box, and you will be redirected to your institution&amp;rsquo;s login page.&lt;/p&gt;</description></item><item><title>Collaborative Git workflow: Shared Repository on a File Server</title><link>https://shocksolution.com/posts/collaborative-git-workflow-shared-repository-on-a-file-server/</link><pubDate>Fri, 10 Jan 2014 20:55:26 +0000</pubDate><guid>https://shocksolution.com/posts/collaborative-git-workflow-shared-repository-on-a-file-server/</guid><description>&lt;p&gt;GitHub is a great tool for collaborating on projects. However, sometimes it is necessary to mimic the &amp;ldquo;GitHub workflow&amp;rdquo; using a shared repository on a local Linux server. The following example shows how I shared an example repository with multiple users.  We are also using the &lt;a href="http://nvie.com/posts/a-successful-git-branching-model/" title="Git%20Flow%20branching%20model"&gt;Git flow model for branching&lt;/a&gt;, aided by the handy &lt;a href="https://github.com/nvie/gitflow" title="Git%20Flow%20plugin"&gt;git flow plugin&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="on-my-workstation"&gt;On my workstation&lt;/h2&gt;&#10;&lt;p&gt;I started by creating a repo on my local workstation and setting it up to use the git flow plugin.&lt;/p&gt;</description></item><item><title>Linux configuration management roundup</title><link>https://shocksolution.com/posts/linux-configuration-management-roundup/</link><pubDate>Mon, 09 Dec 2013 19:52:20 +0000</pubDate><guid>https://shocksolution.com/posts/linux-configuration-management-roundup/</guid><description>&lt;p&gt;Our high performance compute cluster (HPCC) has fairly primitive tools for managing the deployment of the operating system on the compute nodes. Our current tools are &amp;ldquo;aspencopy,&amp;rdquo; which takes an &amp;ldquo;image&amp;rdquo; of a the filesystem of a running server and saves it as a .tar.gz file (NOT a disk image).  &amp;ldquo;aspenrestore&amp;rdquo; is its counterpart, which  deploys an &amp;ldquo;image&amp;rdquo; to another server.  The utility is smart enough to update things like the host name, IP address, host SSH keys, etc.  However, the images are essentially &amp;ldquo;black boxes,&amp;rdquo; in the sense that there is no system for keeping track of which configuration changes have been applied to which image, and no way to know which image is running on each server.  The next cluster that I am responsible for purchasing must include a configuration management/data center automation system, such as:&lt;/p&gt;</description></item><item><title>Configuring GRUB2 on Ubuntu to boot from another Linux partition</title><link>https://shocksolution.com/posts/configuring-grub2-on-ubuntu-to-boot-from-another-linux-partition/</link><pubDate>Mon, 02 Dec 2013 13:28:30 +0000</pubDate><guid>https://shocksolution.com/posts/configuring-grub2-on-ubuntu-to-boot-from-another-linux-partition/</guid><description>&lt;p&gt;My recent Ubuntu installation was my first experience with the new &lt;a href="http://%3C%3Cwww.gnu.org/software/grub/manual/&amp;amp;gt%3E;" title="GRUB2%20Documentation"&gt;GRUB 2.x series of bootloaders&lt;/a&gt;. Unforunately, the process of manually configuring GRUB2 on Ubuntu is &lt;a href="https://help.ubuntu.com/community/Grub2" title="GRUB2%20Docs%20for%20Ubuntu"&gt;not well documented&lt;/a&gt; in the case that everything doesn&amp;rsquo;t work &amp;ldquo;automagically.&amp;rdquo; I had to solve two problems: the blank screen at boot, and getting GRUB to boot to an existing partition with CentOS 5 installed.&lt;/p&gt;&#10;&lt;h2 id="blank-screen-at-boot"&gt;Blank screen at boot&lt;/h2&gt;&#10;&lt;p&gt;I got a blank screen after selecting an OS from the GRUB menu. GRUB seemed to work fine: it presented a menu of OS selections and allowed me to select one. Some text would then scroll by quickly, and then the monitor would then go blank and go into power-saving mode. This PC has an old NVIDIA card (I did not install any NVIDIA drivers). I found that I need to edit the file /etc/default/grub and set the &lt;strong&gt;nomodeset&lt;/strong&gt;option: &lt;code&gt;GRUB_CMDLINE_LINUX=&amp;quot;nomodeset&amp;quot;&lt;/code&gt; I then ran the command&lt;strong&gt;update-grub&lt;/strong&gt; to create the file /boot/grub/grub.cfg. You don&amp;rsquo;t want to edit this file by hand, since it gets over-written by configuration scripts.&lt;/p&gt;</description></item><item><title>Configuring XFCE4 and LightDM on a minimal Ubuntu installation</title><link>https://shocksolution.com/posts/configuring-xfce4-and-lightdm-on-a-minimal-ubuntu-installation/</link><pubDate>Mon, 25 Nov 2013 03:07:43 +0000</pubDate><guid>https://shocksolution.com/posts/configuring-xfce4-and-lightdm-on-a-minimal-ubuntu-installation/</guid><description>&lt;p&gt;I recently installed Ubuntu on an older PC with 1GB of RAM and 80GB of hard drive space, so I wanted a lightweight desktop interface. I chose &lt;a href="http://%3Cwww.xfce.org/%3E" title="XFCE"&gt;XFCE&lt;/a&gt;, since it is both lightweight and usable, and I have used it extensively. You can get Ubuntu pre-made with XFCE (xubuntu), but there are some disadvantages. The ISO is slightly too large to fit on a CD, and it comes with a lot of applications that I don&amp;rsquo;t need. Instead, I installed Ubuntu from a minimal CD and then used apt-get to install XFCE and the &lt;a href="http://%3Cwww.freedesktop.org/wiki/Software/LightDM/%3E" title="LightDM%20display%20manager"&gt;LightDM display manager&lt;/a&gt;. I learned that a couple of extra steps must be taken to get XFCE to play with lightdm. I got the error &amp;ldquo;can&amp;rsquo;t find session ubuntu&amp;rdquo;. Don&amp;rsquo;t bother changing the .dmrc file in your home directory; this file is overwritten every time lightdm starts! I configured lightdm to use an XFCE session with the command:&lt;/p&gt;</description></item><item><title>Preventing "soft" failures due to memory fragmentation in Linux</title><link>https://shocksolution.com/posts/preventing-soft-failures-due-to-memory-fragmentation-in-linux/</link><pubDate>Wed, 20 Nov 2013 13:27:41 +0000</pubDate><guid>https://shocksolution.com/posts/preventing-soft-failures-due-to-memory-fragmentation-in-linux/</guid><description>&lt;p&gt;A previous post documented that a Linux server running a pre-2.6.24 kernel can fail to allocate large chunks of memory after its memory has been fragmented by a &amp;ldquo;thrashing&amp;rdquo; incident. In this post, I will point out some ways to prevent this problem.&lt;/p&gt;&#10;&lt;h2 id="use-a-newer-kernel"&gt;Use a Newer Kernel&lt;/h2&gt;&#10;&lt;p&gt;We have some servers running RHEL 5.9 with the kernel updated to 2.6.34.14. After a thrashing incident, these servers do not experience the same problem with allocating large blocks of memory. I think the fix is &lt;a href="http://kernelnewbies.org/Linux_2_6_24#head-eacf0c267f25660d4fe1bbeb3216d0d1d7400d1b" title="Kernel%202.6.24%20release%20notes"&gt;documented in the release notes for kernel 2.6.24&lt;/a&gt;. Section 2.4 talks about &amp;ldquo;anti-fragmentation patches&amp;rdquo; and includes a link to &lt;a href="http://lwn.net/Articles/224829/" title="Linux%20memory%20management"&gt;this article about Linux memory management&lt;/a&gt;, which links to this &lt;a href="http://lwn.net/Articles/224835/" title="The%20performance%20and%20behaviour%20of%20the%20anti-fragmentation%20related%20patches"&gt;thorough documentation of the anti-fragmentation patches&lt;/a&gt;.(BTW, here is &lt;a href="https://%3Cwww.kernel.org/pub/linux/kernel/v2.6/%3E" title="Linux%20kernel%202.6%20changelogs"&gt;the full list of 2.6 kernel changelogs&lt;/a&gt;) My plan is to deploy RHEL 5.9 with the updated kernel to all the compute nodes in our cluster. However, this still doesn&amp;rsquo;t solve the problem of a user who requests some portion of the RAM on a node and then proceeds to consume more memory than requested. This is unfair to another user whose job is running on the same node.&lt;/p&gt;</description></item><item><title>Memory fragmentation degrades performance in Linux kernels &amp;lt; 2.6.24 (RHEL 5.4)</title><link>https://shocksolution.com/posts/memory-fragmentation-degrades-performance-in-linux-kernels-2-6-24-rhel-5-4/</link><pubDate>Fri, 15 Nov 2013 21:30:38 +0000</pubDate><guid>https://shocksolution.com/posts/memory-fragmentation-degrades-performance-in-linux-kernels-2-6-24-rhel-5-4/</guid><description>&lt;p&gt;I have data from the &lt;a href="http://webstokes.ist.ucf.edu/" title="STOKES%20Advanced%20Research%20Computing%20Center"&gt;STOKES High Performance Compute Cluster&lt;/a&gt; which definitively shows that kernel versions prior to 2.6.24 can suffer significant performance degradation due to memory fragmentation. I noticed the problem on servers running Red Hat Enterprise Linux (RHEL) 5.4 with kernel version 2.6.18-164.el5. This post will document my findings. The graphs were taken from our &lt;a href="http://ganglia.sourceforge.net/" title="Ganglia%20Monitoring%20System"&gt;Ganglia monitoring system&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;This node has 24GB of RAM. As long as processes do not request more than 23GB of RAM, the node operates normally. Processes can use 23GB of RAM all day long:&lt;/p&gt;</description></item><item><title>Insert an EPS file into an Asymptote Vector Graphics document</title><link>https://shocksolution.com/posts/insert-an-eps-file-into-an-asymptote-vector-graphics-document/</link><pubDate>Wed, 23 Oct 2013 13:08:06 +0000</pubDate><guid>https://shocksolution.com/posts/insert-an-eps-file-into-an-asymptote-vector-graphics-document/</guid><description>&lt;p&gt;It&amp;rsquo;s surprisingly difficult to find out whether it is possible to include an image from an Encapsulated PostScript (EPS) file into an Asymptote vector graphics document. It turns out that it &lt;em&gt;is&lt;/em&gt; easy, but difficult to find in the Asymptote docs (I finally found the answer, via Google, &lt;a href="http://asymptote.sourceforge.net/FAQ/section9.html" title="Asymptote%20FAQ"&gt;in the FAQ&lt;/a&gt;). It turns out that you use the &lt;a href="http://asymptote.sourceforge.net/doc/label.html" title="Asymptote%20label%20function"&gt;label&lt;/a&gt; function to insert an image into an Asymptote document. Here is a snippet of code that I used to assemble a multi-part figure from several EPS documents:&lt;/p&gt;</description></item><item><title>How to fix your IEEE email alias so that it delivers all messages</title><link>https://shocksolution.com/posts/how-to-fix-your-ieee-email-alias-so-that-it-delivers-all-messages/</link><pubDate>Wed, 16 Oct 2013 18:18:11 +0000</pubDate><guid>https://shocksolution.com/posts/how-to-fix-your-ieee-email-alias-so-that-it-delivers-all-messages/</guid><description>&lt;p&gt;I and others who use ___@ieee.org email addresses have a serious problem in which we occasionally fail to receive certain email messages that are sent our ieee.org addresses. This is a serious problem, and I&amp;rsquo;ve finally found a solution.&lt;/p&gt;&#10;&lt;p&gt;First, some background. Before the summer of 2013, the IEEE email address was simply an alias, which forwarded email to an actual email account. Some &amp;ldquo;spam&amp;rdquo; filtering was provided by IEEE, which could be modified or disabled through the IEEE web portal. In the summer of 2013, IEEE moved to Google Apps. Your ieee.org email now points to a Google Apps account. If you were previously using the alias service, the Google Apps account is configured to simply forward all email to the other account. However, the Google Apps account is also performing spam filtering on your email! When I finally logged in to my IEEE Google Apps account, I found several non-spam messages which had never been delivered because they were mistakenly sent to the spam folder in the Google Apps account (which I never check). Here is how to disable this dangerous and irritating &amp;ldquo;feature&amp;rdquo; that may be causing you to lose valuable email messages.&lt;/p&gt;</description></item><item><title>Using the MATLAB Distributed/Parallel Computing Toolbox without modifying your cluster</title><link>https://shocksolution.com/posts/using-the-matlab-distributedparallel-computing-toolbox-without-modifying-your-cluster/</link><pubDate>Wed, 02 Oct 2013 19:44:53 +0000</pubDate><guid>https://shocksolution.com/posts/using-the-matlab-distributedparallel-computing-toolbox-without-modifying-your-cluster/</guid><description>&lt;p&gt;This post shows how I set up MATLAB to perform parallel calculations on a multi-core server which is part of an existing cluster that is managed using Torque and Moab. I did this without making any changes to the cluster submission system. The &lt;a href="http://%3C%3Cwww.mathworks.com/support/product/DM/installation/oldversions.html&amp;amp;gt%3E;" title="MATLAB%20Parallel%20Computing%20Toolbox/Distributed%20Computing%20Server%20"&gt;installation documentation for the MATLAB Parallel Computing Toolbox and Distributed Computing Server&lt;/a&gt; is poor. The instructions make a lot of assumptions that don&amp;rsquo;t fit into an existing &amp;ldquo;production&amp;rdquo; cluster environment. For example, they assume that a GUI is available to configure the cluster (this step is not required for my method!) Further, the instructions give the impression that MATLAB components must be &amp;ldquo;installed&amp;rdquo; on both the head node and compute nodes by an administrator. THIS IS FALSE! Ordinary users can run concurrent (multicore) MATLAB jobs without administrative privileges!&lt;/p&gt;</description></item><item><title>PHPUnit on CentOS 6</title><link>https://shocksolution.com/posts/phpunit-on-centos-6/</link><pubDate>Wed, 28 Aug 2013 13:09:16 +0000</pubDate><guid>https://shocksolution.com/posts/phpunit-on-centos-6/</guid><description>&lt;p&gt;In my last post, I showed &lt;a href="https://shocksolution.com/2013/08/installing-phpunit-on-centos-5-9/" title="Install%20PHPUnit%20on%20a%20CentOS%205.9%20system"&gt;how to install PHPUnit with PHP 5.3 on a CentOS 5.9 system&lt;/a&gt;. Today, I will tackle the much simpler task of installing &lt;a href="http://phpunit.de/manual/current/en/index.html" title="PHPUnit"&gt;PHPUnit&lt;/a&gt; on a CentOS 6.4 system. The task is easier since PHP5.3 is standard on CentOS 6. On my system, PEAR was already installed. Steps: 1. Install the PHPUnit channel for PEAR:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;yum install php-channel-phpunit&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;2. Set channel to auto-discover:&lt;/p&gt;</description></item><item><title>Installing PHPUnit on CentOS 5.9</title><link>https://shocksolution.com/posts/installing-phpunit-on-centos-5-9/</link><pubDate>Tue, 20 Aug 2013 02:13:21 +0000</pubDate><guid>https://shocksolution.com/posts/installing-phpunit-on-centos-5-9/</guid><description>&lt;p&gt;I recently had to install &lt;a href="http://phpunit.de/manual/current/en/index.html" title="PHPUnit"&gt;PHPUnit&lt;/a&gt; on a CentOS 5.9 system.  This turned out to be a little more complicated than I had anticipated, so I wrote down the procedure in case I had to do it again. Here are my notes: 1. Install php53 packages, not php (php packages install the old 4.x series) 2. Install &lt;a href="http://pear.php.net/" title="PEAR"&gt;PEAR&lt;/a&gt;, PHP&amp;rsquo;s component management system.  Here is the complete Yum log for a PEAR installation: Jun 03 22:49:56 Installed: php53-common-5.3.3-13.el5_8.x86_64 Jun 03 22:49:57 Installed: php53-cli-5.3.3-13.el5_8.x86_64 Jun 03 22:49:58 Installed: php53-5.3.3-13.el5_8.x86_64 Jun 03 22:51:24 Installed: php53-devel-5.3.3-13.el5_8.x86_64 Jun 03 22:51:25 Installed: 1:php-pear-1.4.9-8.el5.noarch 3. Install php53-xml: Jun 03 23:30:40 Installed: php53-xml-5.3.3-13.el5_8.x86_64 4. Install php54-xml and restart httpd to get the DOM extension for PHP 5. Install PHPUnit with PEAR:&lt;/p&gt;</description></item><item><title>Very helpful PDF manipulation tools on Linux</title><link>https://shocksolution.com/posts/very-helpful-pdf-manipulation-tools-on-linux/</link><pubDate>Fri, 14 Jun 2013 21:25:15 +0000</pubDate><guid>https://shocksolution.com/posts/very-helpful-pdf-manipulation-tools-on-linux/</guid><description>&lt;p&gt;You can do some really cool stuff with Ghostscript on the command line on a computer running Linux or OS X. However, it&amp;rsquo;s hard to remember all that stuff when you don&amp;rsquo;t use it very often. I recently learned about a set of &lt;a href="http://www2.warwick.ac.uk/fac/sci/statistics/staff/academic-research/firth/software/pdfjam/" title="PDFjam%20PDF-manipulation%20tools"&gt;command-line PDF manipulation tools called PDFjam&lt;/a&gt;. If you are a  geek like me, you probably already have pdfLaTeX installed.  I can&amp;rsquo;t summarize the capabilities any better than the description on the PDFjam site:&lt;/p&gt;</description></item><item><title>When root cannot run X applications from a local terminal</title><link>https://shocksolution.com/posts/when-root-cannot-run-x-applications-from-a-local-terminal/</link><pubDate>Sun, 02 Jun 2013 03:08:56 +0000</pubDate><guid>https://shocksolution.com/posts/when-root-cannot-run-x-applications-from-a-local-terminal/</guid><description>&lt;p&gt;I run XWindows on a CentOS 5.9 box as a non-root user. To perform administrative tasks, I occasionally log in as root using &amp;ldquo;su&amp;rdquo; in a terminal window. However, I found that I was unable to start any GUI applications as root. I got the following error:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Xlib: connection to &amp;#34;:0.0&amp;#34; refused by server&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Xlib: No protocol specified&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;E233: cannot open display Xlib: connection to &amp;#34;:0.0&amp;#34; refused by server&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Xlib: No protocol specified&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;This can happen when xhost isn&amp;rsquo;t configured to allow local, non-network connections. As the user who started the xwindows session (not root) run:&lt;/p&gt;</description></item><item><title>The cause of init: Id "co" respawning too fast, and how to fix it</title><link>https://shocksolution.com/posts/the-cause-of-init-id-co-respawning-too-fast-and-how-to-fix-it/</link><pubDate>Fri, 05 Apr 2013 20:26:03 +0000</pubDate><guid>https://shocksolution.com/posts/the-cause-of-init-id-co-respawning-too-fast-and-how-to-fix-it/</guid><description>&lt;p&gt;I recently found the following message in the system logs for one of the compute nodes in the STOKES cluster:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;init: Id &amp;#34;co&amp;#34; respawning too fast: disabled for 5 minutes&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;This caught my attention, because this OS image on this particular node should be identical to the image that is deployed on the rest of the nodes in the cluster. Why was it the only one producing this strange warning message? I searched the web and learned that the following line in /etc/inittab is causing the warning:&lt;/p&gt;</description></item><item><title>How to plot .xvg files from GROMACS on Windows</title><link>https://shocksolution.com/posts/how-to-plot-xvg-files-from-gromacs-on-windows/</link><pubDate>Tue, 12 Mar 2013 18:00:51 +0000</pubDate><guid>https://shocksolution.com/posts/how-to-plot-xvg-files-from-gromacs-on-windows/</guid><description>&lt;p&gt;&lt;a href="http://%3C%3Cwww.gromacs.org/Documentation/How-tos/Graphing_Data&amp;amp;gt%3E;" title="GROMACS%20xvg%20files"&gt;GROMACS produces graphical output in the form of .xvg files&lt;/a&gt;. These are designed to be viewed with a classic &lt;a href="http://plasma-gate.weizmann.ac.il/Grace/" title="Grace"&gt;UNIX/Linux plotting program called Grace&lt;/a&gt;. If you happen to be using Linux and you have Grace installed, it is very easy to plot the data with the command&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;xmgrace my_file.xvg&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;If you aren&amp;rsquo;t using Linux, plotting .xvg files is quite a bit more difficult. &lt;a href="http://%3C%3Cwww.gnuplot.info/&amp;amp;gt%3E;" title="Gnuplot"&gt;Gnuplot&lt;/a&gt; is the only free plotting program that I have found that can handle .xvg files. &lt;a href="http://sourceforge.net/projects/gnuplot/files/" title="Gnuplot%20download%20for%20Windows"&gt;Gnuplot is available for Windows&lt;/a&gt; (there is a direct download link near the top of the download page), but I will caution you that Gnuplot is not easy to learn. It has a command-line interface, and there are no point-and-click options to do basic operations such as labeling the axes of the plot. If you are using Gnuplot, you can plot the contents of an .xvg file with the command:&lt;/p&gt;</description></item><item><title>Opportunity for postdoctoral research associate in high performance computing</title><link>https://shocksolution.com/posts/opportunity-for-postdoctoral-research-associate-in-high-performance-computing/</link><pubDate>Mon, 04 Mar 2013 22:51:12 +0000</pubDate><guid>https://shocksolution.com/posts/opportunity-for-postdoctoral-research-associate-in-high-performance-computing/</guid><description>&lt;p&gt;My current employer, the &lt;a href="http://webstokes.ist.ucf.edu" title="STOKES%20ARCC"&gt;STOKES Advanced Research Computing Center (STOKES ARCC)&lt;/a&gt;, is &lt;a href="https://%3Cwww.jobswithucf.com/postings/34718%3E" title="Hiring%20postdoc%20in%20high%20performance%20computing"&gt;hiring a postdoctoral research associate to conduct research in high performance computing with an emphasis on next-generation networking technologies&lt;/a&gt;. The ARCC has internal funding that will be used to upgrade our research network to the &lt;a href="http://%3Cwww.internet2.edu/%3E" title="Internet2"&gt;Internet2&lt;/a&gt; &lt;a href="http://%3Cwww.internet2.edu/pubs/Internet2-Innovation-Platform-FAQ.pdf%3E" title="Innovation%20Platform"&gt;Innovation Platform&lt;/a&gt; standard. We are also seeking external funding to extend the research network across the &lt;a href="http://%3Cwww.ucf.edu/%3E" title="University%20of%20Central%20Florida"&gt;UCF&lt;/a&gt; campus. We are looking for a candidate with an interest in topics such as defining a &amp;ldquo;Science DMZ,&amp;rdquo; Internet2, GENI, &lt;a href="http://%3Cwww.internet2.edu/performance/pS-PS/%3E" title="perfSONAR-PS"&gt;perfSONAR&lt;/a&gt;, software-defined networks, etc. Please use the link above to apply for the position. Feel free to contact me if you have questions-&lt;a href="https://shocksolution.com/about_craig_finch/" title="Contact%20Craig%20Finch"&gt;my contact information is on the about page&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Updated GROMACS tutorials</title><link>https://shocksolution.com/posts/updated-gromacs-tutorials/</link><pubDate>Thu, 28 Feb 2013 21:40:54 +0000</pubDate><guid>https://shocksolution.com/posts/updated-gromacs-tutorials/</guid><description>&lt;p&gt;I have published &lt;a href="https://github.com/cfinch/GROMACS_Examples" title="GROMACS%20Tutorials"&gt;up-to-date versions of two classic GROMACS tutorials&lt;/a&gt; on GitHub. The &lt;a href="http://manual.gromacs.org/online/getting_started.html" title="GROMACS%20Getting%20Started"&gt;Getting Started section of the GROMACS online documentation&lt;/a&gt; contains some helpful tutorials.  Unfortunately, these tutorials have not been updated in a while. They also don&amp;rsquo;t explain how to set up an efficient workflow to run large molecular dynamics simulations on a shared cluster using a resource manager such at &lt;a href="http://%3Cwww.adaptivecomputing.com/products/open-source/torque/%3E" title="Torque%20resource%20manager"&gt;Torque&lt;/a&gt;. I have created a set of files that implement the &lt;a href="http://manual.gromacs.org/online/speptide.html" title="speptide%20molecular%20dynamics%20tutorial"&gt;speptide tutorial&lt;/a&gt; from the GROMACS documentation.You can use my files and follow along with the explanations in the GROMACS manual. The speptide directory has two subdirectories: one for MDP files (which control the simulations) and one for simulation files. I have found this to be an efficient setup because many MD experiments involve simulating multiple variants of a molecule (such as mutants of a protein) and comparing the results. All variants should be run with the same parameters, so the same MDP files are used for each simulation. Keeping the MDP files in their own directory and creating symbolic links from the run directory to the MDP files ensures that all simulations are run with identical parameters. In the &lt;strong&gt;run&lt;/strong&gt; directory, there is a Bash script called setup_GROMACS_job.sh. At the top of the script, the user sets variables to set simulation parameters such as the box size. The script can be run with the command&lt;/p&gt;</description></item><item><title>Installing Lumerical FDTD on a linux cluster</title><link>https://shocksolution.com/posts/installing-lumerical-fdtd-on-a-linux-cluster/</link><pubDate>Mon, 25 Feb 2013 20:25:43 +0000</pubDate><guid>https://shocksolution.com/posts/installing-lumerical-fdtd-on-a-linux-cluster/</guid><description>&lt;p&gt;Most of the time, RPM (especially in conjunction with yum) is a decent package management solution. However, I can think of two common circumstances when you don&amp;rsquo;t want to let RPM install a package:&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;You don&amp;rsquo;t have root permissions on a system such as a shared cluster&lt;/em&gt; You are an administrator on a shared cluster and you can&amp;rsquo;t risk having a package over-write system-critical files&lt;/p&gt;&#10;&lt;p&gt;One approach is to &lt;a href="http://%3Cwww.cyberciti.biz/tips/how-to-extract-an-rpm-package-without-installing-it.html%3E" title="Extract%20files%20from%20RPM%20package"&gt;extract the files from the RPM package&lt;/a&gt; and install them manually. I used this method to install &lt;a href="http://%3Cwww.lumerical.com/tcad-products/fdtd/%3E" title="FDTD%20Solutions"&gt;FDTD Solutions&lt;/a&gt; from &lt;a href="http://%3Cwww.lumerical.com/%3E" title="Lumerical"&gt;Lumerical&lt;/a&gt; on the &lt;a href="http://webstokes.ist.ucf.edu/" title="STOKES%20ARCC"&gt;STOKES Linux cluster&lt;/a&gt;. The application is distributed as an RPM package. I &lt;em&gt;never&lt;/em&gt; install a third-party RPM as root, because a badly constructed package might over-write a system-critical file that some user is depending on. I downloaded the appropriate TAR file from Lumerical, uncompressed it, and looked at the contents. There is a simple script called install.sh which checks to make sure the user is root and then tries to install a hardware key driver and an RPM that contains the FDTD software. Here are my recommendations for installing Lumerical products on a cluster:&lt;/p&gt;</description></item><item><title>OpenMPI, Intel Compilers and RedHat 5: cannot find -lnuma</title><link>https://shocksolution.com/posts/openmpi-on-redhat-5-cannot-find-lnuma/</link><pubDate>Wed, 20 Feb 2013 23:21:42 +0000</pubDate><guid>https://shocksolution.com/posts/openmpi-on-redhat-5-cannot-find-lnuma/</guid><description>&lt;p&gt;I found an interesting quirk when trying to build an OpenMPI application on a visualization node with a &amp;ldquo;stock&amp;rdquo; version of Red Hat Enterprise Linux 5.8.  I used mpicc to compile the application and got the following error:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ mpicc hello_world_mpi.c -o hello_world&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;/usr/bin/ld: cannot find -lnuma&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;This was rather surprising, since this node mounts a directory via NFS that contains OpenMPI and Intel Composer 2013, and these applications are known to work on other nodes. To find the source of the problem, I used the &lt;strong&gt;showme&lt;/strong&gt; option to see the command that is actually run by mpicc:&lt;/p&gt;</description></item><item><title>pickle, hickle and HDF5</title><link>https://shocksolution.com/posts/pickle-hickle-and-hdf5/</link><pubDate>Sun, 03 Feb 2013 19:33:57 +0000</pubDate><guid>https://shocksolution.com/posts/pickle-hickle-and-hdf5/</guid><description>&lt;p&gt;&lt;a href="http://%3C%3Cwww.thetelegraphic.com/&amp;amp;gt%3E;" title="Danny%20Price"&gt;Danny Price&lt;/a&gt; recently left a comment to let me know about a new Python package he&amp;rsquo;s developing called &lt;a href="https://github.com/telegraphic/hickle" title="hickle"&gt;hickle&lt;/a&gt;. The goal of &amp;ldquo;hickle&amp;rdquo; is to create a module that works like Python&amp;rsquo;s &lt;a href="http://docs.python.org/2/library/pickle.html" title="Pickle"&gt;pickle&lt;/a&gt; module but stores its data in the &lt;a href="http://%3C%3Cwww.hdfgroup.org/HDF5/&amp;amp;gt%3E;" title="HDF5%20Project"&gt;HDF5&lt;/a&gt; binary file format. This is a promising approach, because I advocate storing binary data in HDF5 files whenever possible instead of creating yet another one-off binary file format that nobody will be able to read in ten years. The immediate advantage of using HDF5 to store picked Python objects is that HDF5 files are portable across many platforms, while &amp;ldquo;pickled&amp;rdquo; objects may not be readable on a different platform. The hickle developers have made a good start, and they have a long way to go before hickle will be useful to a wider audience. Right now, hickle can only store NumPy ndarrays and Python list objects. If you only need to store lists and arrays, you might as well use HDF5 bindings for Python such as &lt;a href="http://%3C%3Cwww.pytables.org/moin&amp;amp;gt%3E;" title="PyTables"&gt;PyTables&lt;/a&gt; or &lt;a href="http://%3C%3Cwww.h5py.org/&amp;amp;gt%3E;" title="HDF5%20for%20Python"&gt;h5py&lt;/a&gt;. The power of the pickle module is that you can immediately serialize almost any Python object of arbitrary complexity, store it on disk, and retrieve it. hickle will only achieve its full potential once it replicates this functionality, and I&amp;rsquo;m not sure how difficult this will be. Ideally, you might be able to derive a class from Pickler that uses Picker&amp;rsquo;s methods to serialize an object, and then add your own method to write the serialized object to an HDF5 file. In a future post, I&amp;rsquo;ll describe some of the practical problems with using pickle files to store data, and try to organize some thoughts about how they might be solved.&lt;/p&gt;</description></item><item><title>Building NumPy and SciPy with Intel Composer 2013 and the MKL</title><link>https://shocksolution.com/posts/building-numpy-and-scipy-with-intel-composer-2013-and-the-mkl/</link><pubDate>Wed, 16 Jan 2013 22:29:19 +0000</pubDate><guid>https://shocksolution.com/posts/building-numpy-and-scipy-with-intel-composer-2013-and-the-mkl/</guid><description>&lt;p&gt;Since Python is widely used as a high-productivity language for scientific computing, &lt;a href="http://software.intel.com/en-us/articles/numpy-scipy-with-mkl" title="Intel:%20building%20NumPy%20with%20Intel%20compilers%20and%20MKL"&gt;Intel has created a page showing how to build NumPy with Intel compilers and the Math Kernel Library (MKL)&lt;/a&gt;. I would like to clarify a few items regarding building NumPy on a 64-bit Red Hat Enterprise Linux 5.4 system. Since this is a production system, I don&amp;rsquo;t want to replace the Python 2.4 binary -2.7.3-intel-composer-2013that ships with RHEL 5.4. Instead, I created a directory called&lt;/p&gt;</description></item><item><title>A list of system and application profiling tools</title><link>https://shocksolution.com/posts/a-list-of-system-and-application-profiling-tools/</link><pubDate>Mon, 07 Jan 2013 14:21:04 +0000</pubDate><guid>https://shocksolution.com/posts/a-list-of-system-and-application-profiling-tools/</guid><description>&lt;p&gt;&lt;a href="http://%3Cwww.admin-magazine.com/HPC/Articles/Profiling-The-Key-to-Survival%3E" title="Admin%20Magazine%20article%20about%20profiling%20tools"&gt;This article from Admin Magazine has a handy list of profiling tools&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>A trend for 2013: the democratization of manufacturing</title><link>https://shocksolution.com/posts/a-trend-for-2013-the-democratization-of-manufacturing/</link><pubDate>Tue, 01 Jan 2013 21:40:00 +0000</pubDate><guid>https://shocksolution.com/posts/a-trend-for-2013-the-democratization-of-manufacturing/</guid><description>&lt;p&gt;3D printers have been getting more attention in the mainstream media in the past few months. 3D printers were mentioned in a story about tech trends on National Public Radio today, and my father showed me a newsletter from a mutual fund company with a short article about 3D printing. You know that something is hitting the mainstream when retired people learn about it. Of course, 3D printing is old news to those of us in the Maker community. We know that just because consumers &lt;em&gt;can&lt;/em&gt; buy 3D printers for their homes doesn&amp;rsquo;t mean that they &lt;em&gt;should&lt;/em&gt;. Today&amp;rsquo;s 3D printers aren&amp;rsquo;t exactly consumer products, and someone who believes the hype and spends a couple thousand dollars without doing a lot of research is probably going to be disappointed. The technology is not at the point where you can print objects that look as good or work as well as similar items you can buy at the store. Likewise, designing your own custom objects sounds good until you discover the price (and learning curve) of 3D design software. Focusing on 3D printers risks missing a broader trend in the &lt;strong&gt;democratization of manufacturing&lt;/strong&gt;. From the late 1970&amp;rsquo;s to the early 1990&amp;rsquo;s, computing power became affordable to the masses. From the late 1990&amp;rsquo;s to the present, the Internet has given the common man access to an amount of information that would have been inconceivable two decades ago. These trends democratized the means of production for media, music, video, and information technology. Over the past few years, the barriers to entry for manufacturing are becoming lower at a rapid pace. Now you can print goods in your home, or send your design out for rapid prototyping, at an affordable price. For example, I recently spent $25 to buy a &lt;a href="http://%3Cwww.kickstarter.com/projects/1832782518/mount-your-smartphone-for-millions-of-uses?ref=live%3E" title="Millimount%20Project%20on%20Kickstarter"&gt;mount for my smartphone through Kickstarter&lt;/a&gt;. The &lt;a href="http://%3Cwww.spatialstudios.tv/%3E" title="Spatial%20Studios"&gt;business that is developing this item&lt;/a&gt; consists of one man with a 3D CAD program. The &lt;a href="http://blog.ponoko.com/2012/10/11/millimount-smartphone-mount-prototyped-using-personal-factory/" title="Ponoko"&gt;prototypes were fabricated using the Ponoko 3D printing service&lt;/a&gt; and the production tooling will only require an up-front investment of $18,000. Karl Marx developed communism because he perceived that the common man was oppressed by the few wealthy people who owned the means of production. Today, the common man doesn&amp;rsquo;t need to own the means of production because he can make use of them at an affordable price. Our concept of work is being transformed in a post-industrial revolution, and no one describes it better than &lt;a href="http://%3Cwww.sethgodin.com/sg/%3E" title="Seth%20Godin"&gt;Seth Godin&lt;/a&gt;. If you haven&amp;rsquo;t read any of his books, &lt;a href="http://%3Cwww.amazon.com/Linchpin-Are-Indispensable-Seth-Godin/dp/1591844096%3E" title="Linchpin"&gt;Linchpin&lt;/a&gt; is a good place to start. We&amp;rsquo;re living in an exciting time, and I&amp;rsquo;m looking forward to seeing what 2013 will bring!&lt;/p&gt;</description></item><item><title>Installing and configuring Infiniband on a Red Hat system</title><link>https://shocksolution.com/posts/installing-and-configuring-infiniband-on-a-red-hat-system/</link><pubDate>Wed, 12 Dec 2012 23:15:54 +0000</pubDate><guid>https://shocksolution.com/posts/installing-and-configuring-infiniband-on-a-red-hat-system/</guid><description>&lt;p&gt;This post will take you through the installation and configuration of an Infiniband card on a server running Red Hat Enterprise Linux 5.4.  These steps are applicable to any version of Red Hat 5, and will probably work with version 6 as well.  It has been surprisingly hard to find all of these steps in one document.&lt;/p&gt;&#10;&lt;h2 id="required-packages"&gt;Required packages&lt;/h2&gt;&#10;&lt;p&gt;openib-1.4.1-6.el5.noarch libibverbs-1.1.3-2.el5.x86_64 libnes-0.9.0-2.el5.x86_64 libibumad-1.3.3-1.el5.x86_64 opensm-libs-3.3.3-2.el5.x86_64 swig-1.3.29-2.el5.x86_64 ibutils-libs-1.2-11.1.el5.x86_64 ibutils-1.2-11.1.el5.x86_64 (provides ibdiagnet and others) opensm-3.3.3-2.el5.x86_64 libibmad-1.3.3-1.el5.x86_64 infiniband-diags-1.5.3-1.el5.x86_64 (provides handy tools like ibstat and ibstatus) libibverbs-utils-1.1.3-2.el5.x86_64 (provides handy tools ibv_devinfo and ibv_devices) libibverbs-devel-1.1.3-2.el5.x86_64&lt;/p&gt;</description></item><item><title>The Infiniband troubleshooting quick reference</title><link>https://shocksolution.com/posts/the-infiniband-troubleshooting-quick-reference/</link><pubDate>Tue, 04 Dec 2012 16:59:34 +0000</pubDate><guid>https://shocksolution.com/posts/the-infiniband-troubleshooting-quick-reference/</guid><description>&lt;h2 id="glossary-of-infiniband-terminology"&gt;Glossary of Infiniband Terminology&lt;/h2&gt;&#10;&lt;p&gt;&lt;em&gt;GID: Global Identifier&lt;/em&gt; GUID: Global Unique Identifiers (also known as Direct Address)&#10;&lt;em&gt;HCA: Host Channel Adapter&lt;/em&gt; LID: Local Identifier&#10;&lt;em&gt;TCA: Target Channel Adapter&lt;/em&gt; SM: Subnet Manager&lt;/p&gt;&#10;&lt;h3 id="infiniband-the-host-perspective"&gt;Infiniband: The Host Perspective&lt;/h3&gt;&#10;&lt;p&gt;Every host on an Infiniband fabric has three identifiers: GUID, GID, and LID. A GUID is similar in concept to a MAC address because it consists of a 24-bit manufacturer&amp;rsquo;s prefix and a 40-bit device identifier (64 bits total). The Global Identifier (GID) is a 128-bit identifier similar to an IPv6 address (technically, a GID is a valid IPv6 identifier with restrictions). The GID consists of the 64-bit GUID plus an additional 64-bit EUI-64 identifier, for a total of 128 bits. The GID is used for routing between subnets. The default GID prefix is 0xfe80::0. Finally, there is the local identifier (LID), which is assigned by the subnet manager. The LID is a 16-bit identifier that is unique within a subnet. Hosts have an LID between 0 and 48,000, usually expressed in hexadecimal notation (such as 0xb1). Routing within a subnet is managed by LID. The GUID, GID, and LID for a Linux server are stored in text files. The exact path to this text file will depend upon which Infiniband driver is used on the system. For a system with the MLX4 driver (such as RedHat/CentOS 5.x), the commands are:&lt;/p&gt;</description></item><item><title>Managing an HPC cluster or cloud infrastructure: alternatives to xCAT</title><link>https://shocksolution.com/posts/managing-an-hpc-cluster-or-cloud-infrastructure-alternatives-to-xcat/</link><pubDate>Sun, 04 Nov 2012 19:01:15 +0000</pubDate><guid>https://shocksolution.com/posts/managing-an-hpc-cluster-or-cloud-infrastructure-alternatives-to-xcat/</guid><description>&lt;p&gt;&lt;a href="http://sourceforge.net/apps/mediawiki/xcat/index.php?title=Main_Page" title="xCAT%20home%20page"&gt;xCAT is the eXtreme Cloud Administration Toolkit from IBM&lt;/a&gt;.  It&amp;rsquo;s a suite of tools that IBM has developed to manage large groups of servers, such as a cloud infrastructure or a high-performance computing cluster (HPCC).  I have only used xCAT to administer a mid-sized compute cluster (about 140 compute nodes totaling about 1400 cores running &lt;a href="https://access.redhat.com/knowledge/docs/Red_Hat_Enterprise_Linux/" title="Red%20Hat%20Enterprise%20Linux%20Documentation"&gt;RHEL 5&lt;/a&gt;).  Overall, I have not found xCAT to be particularly effective for managing a mid-sized cluster.  In many ways, xCAT is a brilliant piece of software, but like many &amp;ldquo;brilliant&amp;rdquo; solutions, it&amp;rsquo;s just too complex for its own good.  There might be a cluster that is so large and complex that only a tool like xCAT can effectively manage it (especially if you have an administrative staff and you can pay someone to be a full-time xCAT guru).  If you have a smaller cluster with limited administrative resources, you&amp;rsquo;re better off finding a simpler management solution. In contrast, I will briefly outline the administrative tools provided by &lt;a href="http://%3Cwww.aspsys.com/%3E" title="Aspen%20Systems,%20Inc."&gt;Aspen Systems&lt;/a&gt;.  We are in the process of expanding our IBM x1350 cluster with about 1000 compute cores from Aspen. Aspen has developed their own suite of cluster administration tools that take a very different approach.  For a system such as ours (2400 cores total), the Aspen approach makes a lot more sense.  &lt;a href="http://%3Cwww.aspsys.com/clients%3E" title="Aspen%20Systems%20customers"&gt;The Aspen tools have also been used to manage much larger clusters for customers such as NOAA, NREL and NIST&lt;/a&gt;, so I&amp;rsquo;m not sure if there is a cluster that is &amp;ldquo;too big&amp;rdquo; for Aspen&amp;rsquo;s tools.  I&amp;rsquo;ll list some of the key differences between the IBM and Aspen systems:&lt;/p&gt;</description></item><item><title>Mac OS X hack: download multiple files with curl</title><link>https://shocksolution.com/posts/mac-os-x-hack-download-multiple-files-with-curl/</link><pubDate>Mon, 29 Oct 2012 11:03:26 +0000</pubDate><guid>https://shocksolution.com/posts/mac-os-x-hack-download-multiple-files-with-curl/</guid><description>&lt;p&gt;Updated 2017-08-01 to fix typo and use new demo URL. Also note that &lt;a href="https://brew.sh/"&gt;the Homebrew package manager&lt;/a&gt; has matured since this post was first published in 2012. Once you&amp;rsquo;ve configured Homebrew, installing a tool like wget is as simple as running &lt;code&gt;brew install wget&lt;/code&gt; &lt;a href="http://%3C%3Cwww.gnu.org/software/wget/manual/wget.html&amp;amp;gt%3E;" title="wget%20manual"&gt;wget&lt;/a&gt; is an incredibly useful GNU tool on Linux. Unfortunately, it doesn&amp;rsquo;t come with OS X (as of Mountain Lion). OS X includes &lt;a href="http://curl.haxx.se/docs/manpage.html" title="curl%20manual"&gt;curl&lt;/a&gt;, which is a very handy tool but lacks at least one important feature of wget: the ability to use wildcards to get multiple files at the same time. For example, let&amp;rsquo;s say you want to &lt;a href="ftp://ftp.dos.state.fl.us/public/doc/cor/"&gt;download a subset of files from an FTP server&lt;/a&gt;. With wget, you could type:&lt;/p&gt;</description></item><item><title>An Improved Ebuild for OpenFOAM on Gentoo Linux</title><link>https://shocksolution.com/posts/an-improved-ebuild-for-openfoam-on-gentoo-linux/</link><pubDate>Mon, 22 Oct 2012 09:38:00 +0000</pubDate><guid>https://shocksolution.com/posts/an-improved-ebuild-for-openfoam-on-gentoo-linux/</guid><description>&lt;p&gt;&lt;a href="http://%3C%3Cwww.openfoam.org/&amp;amp;gt%3E;" title="OpenFOAM"&gt;OpenFOAM&lt;/a&gt; is a notoriously difficult piece of software to compile, install and run. OpenCFD (the authors of OpenFOAM) have chosen to require the use of recent versions of gcc that are not available on most stable enterprise-class systems (ie Red Hat Enterprise Linux). To make things worse, until recently, OpenCFD also bundled a large number of libraries and helper applications (like VTK and ParaView) with the OpenFOAM source instead of using libraries and tools that are already on the system. Fortunately, OpenCFD has now moved the extra tools to a separate tarball, and the wizards at Gentoo have managed to create an ebuild for OpenFOAM. This is why I run Gentoo on my desktop workstation!&lt;/p&gt;</description></item><item><title>Run DSSP with GROMACS 4.5.5 on Red Hat Linux</title><link>https://shocksolution.com/posts/getting-dssp-to-run-with-gromacs-4-5-5-on-red-hat-linux/</link><pubDate>Mon, 15 Oct 2012 10:00:50 +0000</pubDate><guid>https://shocksolution.com/posts/getting-dssp-to-run-with-gromacs-4-5-5-on-red-hat-linux/</guid><description>&lt;h2 id="update"&gt;UPDATE&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;A new version of GROMACS (4.6 series) has been released since this post was written. Please try installing the latest version of GROMACS before attempting the steps in this post.&lt;/strong&gt;&lt;/p&gt;&#10;&lt;h3 id="fixing-gromacs"&gt;Fixing GROMACS&lt;/h3&gt;&#10;&lt;p&gt;There is a bug in the &lt;strong&gt;do_dssp&lt;/strong&gt;command in GROMACS 4.5.5 that prevents the analysis of secondary structure using &lt;a href="https://swift.cmbi.umcn.nl/gv/dssp/" title="DSSP"&gt;DSSP&lt;/a&gt; . Attempting to run&lt;strong&gt;do_dssp&lt;/strong&gt; will result in a segmentation fault. The bug has been patched since 4.5.5, but this version has not been released (see &lt;a href="http://lists.gromacs.org/pipermail/gmx-users/2011-November/066357.html" title="GROMACS%20Mailing%20List"&gt;this post on the GROMACS mailing list&lt;/a&gt;). To get the patched version, &lt;a href="http://lists.gromacs.org/pipermail/gmx-users/2011-November/066375.html" title="GROMACS%20Mailing%20List"&gt;follow the instructions from this post&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Tricks for Writing XML with Python 3</title><link>https://shocksolution.com/posts/tricks-for-writing-xml-with-python-3/</link><pubDate>Thu, 27 Sep 2012 16:35:49 +0000</pubDate><guid>https://shocksolution.com/posts/tricks-for-writing-xml-with-python-3/</guid><description>&lt;p&gt;I&amp;rsquo;ve added a &lt;a href="https://github.com/cfinch/Shocksolution_Examples" title="Example:%20generating%20XML%20with%20ElementTree%20in%20Python%203"&gt;Python 3 XML example to my Shocksolution_Examples repo on GitHub&lt;/a&gt;.  The new example shows how to generate an XML file which functions as a template for &lt;a href="http://wxglade.sourceforge.net/" title="wxGlade%20rapid%20GUI%20builder%20tool"&gt;building a GUI with wxGlade&lt;/a&gt;.  However, this example should be helpful for anyone who needs to create XML files with Python.  The full example is on GitHub, so I&amp;rsquo;m just going to highlight a few interesting snippets. Use the SubElement factory function to create a new Element instance and add it to an existing element. Here, I create an element called &lt;em&gt;templatedata&lt;/em&gt; and add it to the root element. I then create another element called &lt;em&gt;author&lt;/em&gt; and add it to templatedata.&lt;/p&gt;</description></item><item><title>Firefox in CentOS/Fedora/Red Hat Enterprise Linux can only access Google</title><link>https://shocksolution.com/posts/firefox-in-centosfedorared-hat-enterprise-linux-can-only-access-google/</link><pubDate>Mon, 10 Sep 2012 03:54:24 +0000</pubDate><guid>https://shocksolution.com/posts/firefox-in-centosfedorared-hat-enterprise-linux-can-only-access-google/</guid><description>&lt;h2 id="the-problem"&gt;The Problem&lt;/h2&gt;&#10;&lt;p&gt;I ran into what was probably the strangest error I have ever encountered as a Linux admin.  I created a fresh CentoOS 6 virtual machine (VM) using VirtualBox on my OS X Mountain Lion system.  To my great surprise, I was only able to access Google and a handful of other web sites from Firefox in the VM.  I assumed that there was an issue with the networking of the VM, but after several frustrating hours of checking my setup I realized that the network in the VM was working fine.  I was able to ping any web site by name on the command line, so clearly DNS was working.  I could navigate to &amp;lt;&amp;lt;www.google.com&amp;amp;gt&amp;gt;; and perform searches, but clicking on most links resulted in the browser waiting forever.  I could navigate to any site by IP, although the sites didn&amp;rsquo;t always load correctly (such as centos.org).&lt;/p&gt;</description></item><item><title>Hack of the Day: running CFD-ACE+ on Gentoo Linux</title><link>https://shocksolution.com/posts/hack-of-the-day-running-cfd-ace-on-gentoo-linux/</link><pubDate>Tue, 24 Jul 2012 18:50:49 +0000</pubDate><guid>https://shocksolution.com/posts/hack-of-the-day-running-cfd-ace-on-gentoo-linux/</guid><description>&lt;p&gt;&lt;a href="http://%3C%3Cwww.esi-cfd.com/&amp;amp;gt%3E;" title="CFD-ACE+"&gt;CFD-ACE+&lt;/a&gt; is a multiphysics and computational fluid dynamics (CFD) simulation tool that was originally developed by &lt;a href="http://%3C%3Cwww.cfdrc.com/&amp;amp;gt%3E;" title="CFDRC"&gt;CFD Research Corp.&lt;/a&gt; and is now distributed by ESI Software. The only platforms officially supported by CFD-ACE+ are Red Hat Enterprise Linux, SUSE Linux and Windows. Fortunately, it seems that ACE+ runs on other Linux distributions with only a little hacking. I just installed and tested CFD-ACE+ successfully (albeit not very thoroughly) on an up-to-date Gentoo Linux system.  The process will require hacking some config files to build an external library from source. I started by downloading the files intended for Red Hat 6. Each package is a strange self-extracting executable file that unpacks itself when run. They also provide a C-shell script called install.com that automates the install process. The install script is very well behaved in that it doesn&amp;rsquo;t try to spew libraries and binaries throughout your filesystem, and you can run it as an ordinary user and install the file in your home directory.  The tricky part about the installation is that the unpacking software (which is bundled into the self-extracting executable) needs the library selinux.so.1 in order to run. That library isn&amp;rsquo;t normally installed on a Gentoo system unless you&amp;rsquo;ve specifically set up SELinux.  In order to avoid the potential problems of installing this library in my system paths,  I  created &lt;strong&gt;src&lt;/strong&gt;and&lt;strong&gt;include&lt;/strong&gt;directories in my home directory.  I downloaded source tarballs for libsepol and libselinux from the &lt;a href="http://userspace.selinuxproject.org/releases/" title="SELinux%20Source%20Downloads"&gt;download page of the selinux project&lt;/a&gt;.  First, build libsepol using&lt;strong&gt;make&lt;/strong&gt;.  Then, copy the libsepol.so.1 binary from the src directory to the lib directory you just created in your home directory. Copy the include/sepol directory with all of its contents to the include directory in your home directory.  When you are done, you should have:&lt;/p&gt;</description></item><item><title>Building SciPy with Intel compilers and MKL on 64bit RHEL 5</title><link>https://shocksolution.com/posts/building-scipy-with-intel-compilers-and-mkl-on-64bit-rhel-5/</link><pubDate>Mon, 02 Jul 2012 17:14:54 +0000</pubDate><guid>https://shocksolution.com/posts/building-scipy-with-intel-compilers-and-mkl-on-64bit-rhel-5/</guid><description>&lt;p&gt;This is a follow-up to my earlier &lt;a href="https://shocksolution.com/2012/04/building-numpy-on-a-red-hat-cluster-with-intel-mkl/" title="NumPy%20on%2064%20bit%20RHEL%205%20with%20Intel%20Compilers%20and%20MKL"&gt;post about building NumPy with Intel compilers and the Intel MKL on CentOS 5&lt;/a&gt;. I will now explain how to build SciPy (which requires NumPy). First, download and unpack the SciPy source tarball. The following command can be used to build SciPy:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;LDFLAGS=&amp;#34;&amp;#34; FFLAGS=&amp;#34;-fPIC -openmp&amp;#34; python2.7 setup.py build --fcompiler=intelem &amp;amp;&amp;gt; build.out&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;I set the LDFLAGS variable to an empty string to avoid using any LDFLAGS which are defined in my .bashrc. The &lt;strong&gt;-fPIC&lt;/strong&gt;tells the compiler to create position-independent code, although this flag may not be required for newer compilers (ours are quote old: ifort (IFORT) 10.1 20070913 and icc (ICC) 10.1 20070913). I used the**-openmp&lt;strong&gt;flag to be consistent with the flags I used for building NumPy. The option&lt;/strong&gt;--fcompiler=intelem** forces the Intel Fortran compiler to be used instead of g77. I redirected all output to a file called build.out, which is helpful for finding errors and warnings in the build output. Once you have built SciPy successfully, install it with the following command:&lt;/p&gt;</description></item><item><title>How to dump/print/display/show UEFI configuration for IBM hardware</title><link>https://shocksolution.com/posts/how-to-dumpdisplayshow-uefi-configuration-for-ibm-hardware/</link><pubDate>Thu, 07 Jun 2012 22:00:48 +0000</pubDate><guid>https://shocksolution.com/posts/how-to-dumpdisplayshow-uefi-configuration-for-ibm-hardware/</guid><description>&lt;p&gt;Newer enterprise-class hardware is starting to use UEFI instead of BIOS. UEFI is a big improvement, but there isn&amp;rsquo;t much documentation on the subject. Today I had to configure the UEFI for a new node in our cluster. I wanted to configure it exactly like an existing node that works. It was challenging just to find out how to display the configuration of the old node without rebooting the node and paging through dozens of configuration screens with the keyboard. Then I discovered &lt;a href="http://www-947.ibm.com/support/entry/portal/docdisplay?lndocid=TOOL-ASU" title="IBM%20Advanced%20Setting%20Utility%20for%20UEFI"&gt;IBM&amp;rsquo;s Advanced Settings Utility&lt;/a&gt; software, which  fortunately was already installed on our cluster.  It appears to be free for download, but with a restricted license.  To display the complete UEFI configuration for a server, ssh to the server and run&lt;/p&gt;</description></item><item><title>Mini Maker Faire Orlando Report: Electronics</title><link>https://shocksolution.com/posts/mini-maker-faire-orlando-report-electronics/</link><pubDate>Sun, 03 Jun 2012 19:28:31 +0000</pubDate><guid>https://shocksolution.com/posts/mini-maker-faire-orlando-report-electronics/</guid><description>&lt;p&gt;In my &lt;a href="https://shocksolution.com/2012/05/mini-maker-faire-orlando-report-hardware/" title="Mini%20Maker%20Faire%20Orlando%20Report:%20Hardware"&gt;previous post about the Mini Maker Faire Orlando&lt;/a&gt;, I described some of the cool hardware that was on display.  In this post, I&amp;rsquo;m going to describe some of the electronics available from local vendors.&lt;/p&gt;&#10;&lt;h2 id="electrimod"&gt;&lt;a href="http://%3Cwww.electrimod.com/z/%3E" title="Electrimod:%20Pluggable%20PIC%20microcontroller%20modules"&gt;Electrimod&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;&lt;figure class="ma0 w-75"&gt;&lt;img src="https://shocksolution.com/images/MiniStack_1-150x150.jpg"&#10;&#9;&#9;&#9;alt="Electrimod MiniStack"&gt;&lt;figcaption&gt;&#10;&#9;&#9;&#9;&lt;p&gt;Electrimod MiniStack&lt;/p&gt;&#10;&#9;&#9;&lt;/figcaption&gt;&#10;&lt;/figure&gt;&#10; Local vendor Electrimod (Clermont, FL) was on hand to showcase their pluggable modules for PIC microcontroller development.  Basically, Electrimod is developing products that are equivalent to Arduino shields.  You start with the PIC module, and then plug in whatever other modules you need to build your prototype in the form of a stack. These brand-new products aren&amp;rsquo;t available yet, but they should be shipping by June or July 2012.&lt;/p&gt;</description></item><item><title>Mini Maker Faire Orlando Report: Hardware</title><link>https://shocksolution.com/posts/mini-maker-faire-orlando-report-hardware/</link><pubDate>Sun, 27 May 2012 02:20:43 +0000</pubDate><guid>https://shocksolution.com/posts/mini-maker-faire-orlando-report-hardware/</guid><description>&lt;p&gt;I had a lot of fun at the &lt;a href="http://%3C%3Cwww.orlandominimakerfaire.com/&amp;amp;gt%3E;" title="Orlando%20Mini%20Maker%20Faire"&gt;Orlando Mini Maker Fair&lt;/a&gt; today!  In this post I&amp;rsquo;m going to highlight some of the hardware vendors who took the time to come out and show their stuff to the community.&lt;/p&gt;&#10;&lt;h2 id="8020-the-industrial-erector-set"&gt;&lt;a href="http://%3C%3Cwww.8020.net/&amp;amp;gt%3E;" title="80/20%20Inc.%20The%20Industrial%20Erector%20Set"&gt;80/20: The Industrial Erector Set&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;80/20 is a company that makes modular aluminum framing systems.  Their motto is &amp;ldquo;The Industrial Erector Set,&amp;rdquo; and it&amp;rsquo;s a good description of their product.  Our local distributor is &lt;a href="http://%3C%3Cwww.flomoco.com/&amp;amp;gt%3E;" title="Florida%20Motion%20&amp;amp;%20Control"&gt;Florida Motion and Control&lt;/a&gt;.  If you ever might need to build any kind of machine or robot, you need to browse the 80/20 web site and bookmark it.  I have never used it, but I am desperately looking for a project that will require this!&lt;/p&gt;</description></item><item><title>Benchmarking BLAS Part 1: Building BLASbench with gcc</title><link>https://shocksolution.com/posts/benchmarking-blas-part-1-building-blasbench-with-gcc/</link><pubDate>Fri, 25 May 2012 22:37:22 +0000</pubDate><guid>https://shocksolution.com/posts/benchmarking-blas-part-1-building-blasbench-with-gcc/</guid><description>&lt;p&gt;I recently installed &lt;a href="http://math-atlas.sourceforge.net/" title="ATLAS"&gt;ATLAS&lt;/a&gt; on my new workstation and I&amp;rsquo;ve been wondering what kind of performance gain I would get compared to the &lt;a href="http://%3Cwww.netlib.org/blas/%3E" title="BLAS"&gt;reference BLAS&lt;/a&gt;. After some searching, I finally found a BLAS benchmarking tool called &lt;a href="http://icl.cs.utk.edu/projects/llcbench/blasbench.html" title="BLASbench"&gt;BLASbench&lt;/a&gt;, which is part of the &lt;a href="http://icl.cs.utk.edu/projects/llcbench/index.htm" title="LLCbench"&gt;LLCbench&lt;/a&gt; suite. This tool has a rather strange build process, so follow the instructions on the web page.  You have to create a file called sys.def which contains build instructions for your system.  Here&amp;rsquo;s the sys.def file I used for my Gentoo system:&lt;/p&gt;</description></item><item><title>Building NumPy on a 64-bit Red Hat Cluster with Intel MKL</title><link>https://shocksolution.com/posts/building-numpy-on-a-red-hat-cluster-with-intel-mkl/</link><pubDate>Tue, 24 Apr 2012 16:40:40 +0000</pubDate><guid>https://shocksolution.com/posts/building-numpy-on-a-red-hat-cluster-with-intel-mkl/</guid><description>&lt;p&gt;In a previous post I described &lt;a href="https://shocksolution.com/2008/12/update-2-building-64-bit-numpy-with-intel-compilers-and-mkl/" title="Build%20NumPy%20with%20Intel%20Compilers%20and%20MKL"&gt;how to build an optimized version of NumPy using the Intel compilers and Math Kernel Library (MKL)&lt;/a&gt;.  This post will update those instructions, since it has been a few years and I am now using NumPy 1.6.1, MKL 10.0.1.014 and Red Hat 4.1.1 (kernel 2.6.18-8.el5). First, copy the file &lt;strong&gt;site.cfg.example&lt;/strong&gt;to&lt;strong&gt;site.cfg&lt;/strong&gt; and open it in an editor like vim. The commented lines in the file give some explanation of how it works. You only need to add the following lines:&lt;/p&gt;</description></item><item><title>We won Startup Weekend Orlando!</title><link>https://shocksolution.com/posts/we-won-startup-weekend-orlando/</link><pubDate>Sat, 07 Apr 2012 17:27:16 +0000</pubDate><guid>https://shocksolution.com/posts/we-won-startup-weekend-orlando/</guid><description>&lt;p&gt;Our team (&lt;a href="http://%3Cwww.moleshopper.com/%3E" title="Mole%20Shopper:%20mobile%20software%20enabling%20customer%20feedback"&gt;Mole Shopper&lt;/a&gt;) &lt;a href="http://orlando.startupweekend.org/2012/03/26/winners-of-sworl-2012/" title="Startup%20Weekend%20Orlando%20Winners"&gt;won Startup Weekend Orlando&lt;/a&gt;!  It was a great experience, and I highly recommend that anyone who is interested in entrepreneurship attend a &lt;a href="http://startupweekend.org/" title="Startup%20Weekend"&gt;Startup Weekend event&lt;/a&gt;.  An MBA might tell you about how business is supposed to work, but launching a business in 52 hours will show you how business _actually_works. We owe a great debt to the volunteer mentors that helped us formulate our business plan and refine our pitch.  We won $5,000 in seed funding from &lt;a href="http://%3Cwww.startuporangecounty.com/%3E"&gt;Startup Orange County&lt;/a&gt; (Florida), three months of incubation at the &lt;a href="http://%3Cwww.venturelab.ucf.edu/%3E"&gt;UCF Venture Lab&lt;/a&gt;, 4 months of internet marking and social media consulting by &lt;a href="http://%3Cwww.p2gdesigns.com/%3E"&gt;Pro2Go Designs&lt;/a&gt;, 2 months of legal services by &lt;a href="http://%3Cwww.orlandobusinesslawyer.com/%3E"&gt;The Entrepreneurship Law Firm&lt;/a&gt;, a $500 credit for &lt;a href="http://voicebunny.com/"&gt;VoiceBunny&lt;/a&gt; and a subscription to &lt;a href="http://startupthreads.com/"&gt;Startup Threads&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Partial derivative notation in Sage</title><link>https://shocksolution.com/posts/partial-derivative-notation-in-sage/</link><pubDate>Tue, 06 Mar 2012 18:36:26 +0000</pubDate><guid>https://shocksolution.com/posts/partial-derivative-notation-in-sage/</guid><description>&lt;p&gt;This post will explain the notation used to denote partial derivatives in the output from &lt;a href="http://%3C%3Cwww.sagemath.org/&amp;amp;gt%3E;" title="Sage"&gt;Sage&lt;/a&gt;.  It&amp;rsquo;s confusing at first, but a simple example will make it clear. Here is the input to Sage:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;var(&amp;#39;x y&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;function(&amp;#39;test&amp;#39;, x, y)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;show(test(x, y))&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;show(diff(test(x, y), x))&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;show(diff(test(x, y), x, 2))&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;show(diff(test(x, y), y))&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;show(diff(test(x, y), y, 2))&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;I defined a function of two variables called &lt;strong&gt;test&lt;/strong&gt;.  When you run this in the notebook interface, you get:&lt;/p&gt;</description></item><item><title>Publication-quality plots with Excel</title><link>https://shocksolution.com/posts/publication-quality-plots-with-excel/</link><pubDate>Tue, 28 Feb 2012 21:36:11 +0000</pubDate><guid>https://shocksolution.com/posts/publication-quality-plots-with-excel/</guid><description>&lt;p&gt;Microsoft Office tools are not the best choice for scientific publications, but sometimes you have to use them.  Some journals actually require Word documents, and many of my collaborators simply don&amp;rsquo;t do LaTeX.  The process outlined below is they best way that I&amp;rsquo;ve found to make high-quality plots and charts with Microsoft  Excel.  High-quality graphics with consistent size, aspect ratio, typeface, and font size will make your publications look much more professional.  You can do this with Excel, but it requires some effort.  You will need to install the &lt;a href="http://%3C%3Cwww.bullzip.com/products/pdf/info.php&amp;amp;gt%3E;" title="Bullzip%20PDF%20Printer"&gt;free Bullzip PDF Printer&lt;/a&gt; before you begin. 1. Create and format the chart correctly in Excel.  It&amp;rsquo;s better to insert a &amp;ldquo;floating&amp;rdquo; chart in an existing worksheet, as shown below, rather than creating a new worksheet that contains only the chart.  Set the size of the chart by right-clicking near the edge of the chart and selecting &lt;strong&gt;Format Chart Area&lt;/strong&gt;.  Then select &lt;strong&gt;Size&lt;/strong&gt; and set the actual size and aspect ratio that you want (try 3 inches by 4 inches).  &lt;em&gt;If you want a set of plots to have consistent formatting, it is very important that they are the exact same size in Excel!&lt;/em&gt;  If the finished plots must be different sizes but have the same formatting, make the outer dimensions for all the charts big enough to accommodate the largest plot.  Then shrink the plot within the frame, leaving whitespace which will be cropped out at a later step.  Also set correct font sizes, line widths, colors, etc.&lt;/p&gt;</description></item><item><title>Installing PETSc and libMesh on CentOS 5</title><link>https://shocksolution.com/posts/installing-petsc-and-libmesh-on-centos-5/</link><pubDate>Fri, 20 Jan 2012 20:06:18 +0000</pubDate><guid>https://shocksolution.com/posts/installing-petsc-and-libmesh-on-centos-5/</guid><description>&lt;p&gt;&lt;strong&gt;Prerequisites:&lt;/strong&gt; boost-devel, openmpi-devel, valgrind-devel I installed PETSc and libMesh in my user directory, since I have a single-user workstation.&lt;/p&gt;&#10;&lt;h2 id="installing-petsc-for-use-with-libmesh"&gt;Installing PETSc for use with libMesh&lt;/h2&gt;&#10;&lt;p&gt;First, ensure that OpenMPI is installed and the system paths have been configured correctly.  You will need to add the directory containing OpenMPI binaries to your $PATH, and the directory containing OpenMPI libraries to $LD_LIBRARY_PATH.  CentOS does &lt;em&gt;not&lt;/em&gt; do this automatically!  Type &lt;strong&gt;mpicc&lt;/strong&gt; on the command line to make sure the shell can find the binary.  If mpicc and mpif77 run, then you &lt;a href="http://%3Cwww.open-mpi.org/faq/?category=mpi-apps#petsc%3E" title="OpenMPI%20docs%20on%20PETSc"&gt;should &lt;em&gt;not&lt;/em&gt; need to use the comnand-line flags to the configure script for PETSc&lt;/a&gt;. If you are going to use libMesh with PETSc, you need to enable C++ with a command-line option to the configure script.  Here is the process I used (it might be a good idea to set PETSC_ARCH and PETSC_DIR in your .bashrc so they are consistent for all builds).&lt;/p&gt;</description></item><item><title>Paraview 3.12 on 64-bit CentOS 5.7</title><link>https://shocksolution.com/posts/paraview-3-12-on-64-bit-centos-5-7/</link><pubDate>Thu, 19 Jan 2012 19:23:15 +0000</pubDate><guid>https://shocksolution.com/posts/paraview-3-12-on-64-bit-centos-5-7/</guid><description>&lt;p&gt;I finally got around to installing Paraview on my CentOS 5 box.  There are no official RPMS for CentOS 5, so I was expecting a painful build process. To my great surprise, I was able to &lt;a href="http://%3C%3Cwww.paraview.org/paraview/resources/software.php&amp;amp;gt%3E;" title="Download%20Paraview"&gt;download the Paraview binary&lt;/a&gt; for Linux (64-bit) from Kitware, unpack the archive, and run it!  As root, I placed the entire ParaView-3.12.0 directory under /opt/Paraview.  You could also keep it in your home directory if you are running a single-user system.  I added /opt/Paraview/ParaView-3.12.0/bin to the $PATH in the .bashrc file in my home directory.  Now I can type &lt;strong&gt;paraview&lt;/strong&gt; at the command line and it runs! What if you want Paraview to appear in the Applications menu in your desktop environment?  Most modern desktops (I use XFCE4) construct the Applications menu &amp;ldquo;on the fly&amp;rdquo; based upon the files in a standard directory (/usr/share/applications on CentOS).  The &lt;a href="http://%3C%3Cwww.freedesktop.org/wiki/Home&amp;amp;gt%3E;" title="Free%20Desktop%20Project"&gt;Free Desktop Project&lt;/a&gt; has created a &lt;a href="http://standards.freedesktop.org/desktop-entry-spec/latest/" title="Desktop%20Entry%20File%20Format"&gt;standard for desktop entry files&lt;/a&gt;.  You may also find this &lt;a href="http://linuxcritic.wordpress.com/2010/04/07/anatomy-of-a-desktop-file/" title="Summary%20of%20.desktop%20standard"&gt;summary of the standard&lt;/a&gt; to be helpful.  To add Paraview to the menu, you simply need to create a new file in the standard location.  If you installed Paraview in your user directory, you may want to place the desktop file in $HOME/.local/applications.  Here are the contents of a file I called paraview.desktop:&lt;/p&gt;</description></item><item><title>Portfolio</title><link>https://shocksolution.com/posts/portfolio-2/</link><pubDate>Sat, 31 Dec 2011 19:29:18 +0000</pubDate><guid>https://shocksolution.com/posts/portfolio-2/</guid><description>&lt;h2 id="past-research-and-development-projects"&gt;Past Research and Development Projects&lt;/h2&gt;&#10;&lt;p&gt;&lt;em&gt;Used nonlinear optimization tools to develop signal processing devices&lt;/em&gt; Modeled the effect of parasitics from bond wires and packaging on the performance of radio-frequency devices, using a combination of lumped-element and finite-element models&#10;&lt;em&gt;Created a reduced-order model of the accuracy and penetration performance of armor-piercing projectiles, for use in a OneSAF tactical simulation&lt;/em&gt; Developed a basic flight-training scenario for the Orlando Executive Airport, including custom 3D scenery objects&lt;/p&gt;</description></item><item><title>Installing Sage 4.7 on CentOS 5</title><link>https://shocksolution.com/posts/installing-sage-4-7-on-centos-5/</link><pubDate>Mon, 07 Nov 2011 23:07:59 +0000</pubDate><guid>https://shocksolution.com/posts/installing-sage-4-7-on-centos-5/</guid><description>&lt;p&gt;I recently upgraded my desktop workstation from an old 32-bit version of Gentoo to 64-bit CentOS 5.  I downloaded and installed the latest version of &lt;a href="http://%3Cwww.sagemath.org/%3E" title="Sage%20home%20page"&gt;Sage&lt;/a&gt;, and the process went smoothly. If you find this post helpful, please check out the &lt;a href="http://%3Cwww.packtpub.com/sage-beginners-guide/book%3E" title="Sage%20Beginner's%20Guide"&gt;Sage Beginner&amp;rsquo;s Guide at Packt Publishing&lt;/a&gt;.  Since I don&amp;rsquo;t use Sage every day, I actually refer to my own book on a regular basis!&lt;/p&gt;&#10;&lt;h2 id="download"&gt;Download&lt;/h2&gt;&#10;&lt;p&gt;Since CentOS is designed to be binary compatible with Red Hat Enterprise Linux, the correct binary to download is &lt;strong&gt;sage-4.7.2-linux-64bit-red_hat_enterprise_linux_server_release_5.6_tikanga-x86_64-Linux.tar.gz&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Python string format examples</title><link>https://shocksolution.com/posts/python-string-format-examples/</link><pubDate>Thu, 03 Nov 2011 22:38:10 +0000</pubDate><guid>https://shocksolution.com/posts/python-string-format-examples/</guid><description>&lt;p&gt;The &lt;a href="http://docs.python.org/library/string.html#format-string-syntax" title="Python%20strings%20format%20method"&gt;format method for Python strings&lt;/a&gt; (introduced in 2.6) is very flexible and powerful.  It&amp;rsquo;s also easy to use, but the documentation is not very clear.  It all makes sense with a few examples.  I&amp;rsquo;ll add more as I have time: &lt;a href="https://%3C%3Cwww.amazon.com/gp/product/0132269937/ref=as_li_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0132269937&amp;amp;linkCode=as2&amp;amp;tag=rootwork0f-20&amp;amp;linkId=44971fe03f445ae25fecb2cc2702d3aa&amp;amp;gt%3E;"&gt;&lt;img src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;amp;MarketPlace=US&amp;amp;ASIN=0132269937&amp;amp;ServiceVersion=20070822&amp;amp;ID=AsinImage&amp;amp;WS=1&amp;amp;Format=_SL160_&amp;amp;tag=rootwork0f-20" alt="image"&gt;&lt;/a&gt;&lt;img src="//ir-na.amazon-adsystem.com/e/ir?t=rootwork0f-20&amp;amp;l=am2&amp;amp;o=1&amp;amp;a=0132269937" alt="image"&gt;&lt;/p&gt;&#10;&lt;h2 id="formatting-numbers-in-python-strings"&gt;Formatting Numbers in Python Strings&lt;/h2&gt;&#10;&lt;h3 id="formatting-a-floating-point-number"&gt;Formatting a floating-point number&lt;/h3&gt;&#10;&lt;p&gt;[code language=&amp;ldquo;python&amp;rdquo;] &amp;ldquo;{0:.4f}&amp;quot;.format(0.1234567890) &amp;ldquo;{0:.4f}&amp;quot;.format(10.1234567890) [/code] The result is the following string:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;#39;0.1235&amp;#39;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;#39;10.1235&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;Braces { } are used to enclose the &amp;ldquo;replacement field&amp;rdquo; 0 indicates the first argument to method &lt;strong&gt;format&lt;/strong&gt; : indicates the start of the format specifier .4 indicates four decimal places f indicates a floating-point number&lt;/p&gt;</description></item><item><title>Linux kernel 3.1 config for Gentoo guest on VMWare Fusion</title><link>https://shocksolution.com/posts/linux-kernel-3-1-config-for-gentoo-guest-on-vmware-fusion/</link><pubDate>Mon, 24 Oct 2011 03:23:48 +0000</pubDate><guid>https://shocksolution.com/posts/linux-kernel-3-1-config-for-gentoo-guest-on-vmware-fusion/</guid><description>&lt;p&gt;The following kernel configuration was posted by Alessandro Di Marco as a comment on a previous post in which I provided a Linux kernel config for an earlier version of the kernel. In the interest of sharing his contribution, I&amp;rsquo;m placing it in its own post. I don&amp;rsquo;t know the author personally and I have not tried this config.  Like any other free software, you are using it at your own risk and neither Alessandro nor I provide any warranty. Download the file from the link below, change the file extension from .txt. to .config and load the config into one of the standard kernel configuration tools (such as &lt;strong&gt;make menuconfig&lt;/strong&gt;) and look over all the options before using it. &lt;a href="https://shocksolution.com/files/gentoo_kernel31_config.txt"&gt;Gentoo Kernel 3.1 Config&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Alternate implementations of Python</title><link>https://shocksolution.com/posts/alternate-implementations-of-python/</link><pubDate>Sun, 09 Oct 2011 20:58:20 +0000</pubDate><guid>https://shocksolution.com/posts/alternate-implementations-of-python/</guid><description>&lt;p&gt;This is a &amp;ldquo;skeleton&amp;rdquo; of a page that I want to write about various versions of Python that are optimized for various applications. However, I now recommend that you just check out this &lt;a href="http://%3Cwww.toptal.com/python/why-are-there-so-many-pythons%3E" title="Python%20implementations:%20CPython,%20Jython,%20IronPython,%20PyPy,%20etc."&gt;article about all the different implementations of Python (CPython, Jython, IronPython, PyPy, etc.) by Charles Marsh&lt;/a&gt;. &lt;a href="http://%3Cwww.stackless.com/%3E" title="Stackless%20Python"&gt;Stackless Python&lt;/a&gt; is an implementation of Python that adds lightweight microthreads with scheduling and interthread communication.  It&amp;rsquo;s aimed at concurrent programming.  Note that &lt;a href="http://stackoverflow.com/questions/377254/stackless-python-and-multicores" title="Stackless%20Python%20and%20multicores%20on%20Stackoverflow.com"&gt;Stackless microthreads do not take advantage of multicore or multiprocessor&lt;/a&gt; architectures.  The threads all run within one Python process. &lt;a href="http://%3Cwww.jython.org/%3E" title="Jython"&gt;Jython&lt;/a&gt; is an implementation of the Python programming language that runs on the Java Virtual Machine (JVM). &lt;a href="http://pypy.org/" title="PyPy"&gt;PyPy&lt;/a&gt; is an alternative Python interpreter than incorporates a just-in-time (JIT) compiler that optimized bytecode to optimize performance. &lt;a href="http://cython.org/" title="Cython"&gt;Cython&lt;/a&gt; is a language that allows you to write C extensions for Python in a language that is very much like Python.&lt;/p&gt;</description></item><item><title>TeXLive and Asymptote on CentOS 5</title><link>https://shocksolution.com/posts/texlive-and-asymptote-on-centos-5/</link><pubDate>Mon, 03 Oct 2011 18:18:50 +0000</pubDate><guid>https://shocksolution.com/posts/texlive-and-asymptote-on-centos-5/</guid><description>&lt;h2 id="tex-live"&gt;Tex Live&lt;/h2&gt;&#10;&lt;p&gt;For reasons unknown, a &lt;a href="http://%3Cwww.tug.org/texlive/%3E" title="TeX%20Live"&gt;TeX Live&lt;/a&gt; package is not available for Red Hat Enterprise Linux/Centos 5 from the major repositories (EPEL or DAG).  I consider this to be a glaring omission, since TeXLive is a great improvement upon teTeX.  Since I don&amp;rsquo;t have time right now to package it myself, I installed TeX Live manually in my user directory and it&amp;rsquo;s working fine.  I used the network install process, which starts with &lt;a href="http://%3Cwww.tug.org/texlive/acquire-netinstall.html%3E" title="Tex%20Live%20installation%20script"&gt;downloading a command-line installer&lt;/a&gt; and then following the &lt;a href="http://%3Cwww.tug.org/texlive/doc/texlive-en/texlive-en.html#x1-150003%3E" title="Detailed%20TeX%20Live%20installation%20instructions"&gt;detailed installation instructions&lt;/a&gt; with the base path set to $HOME/texlive/2011.&lt;/p&gt;</description></item><item><title>How to install Octave video tools on CentOS 5</title><link>https://shocksolution.com/posts/how-to-install-octave-video-tools-on-centos-5/</link><pubDate>Wed, 14 Sep 2011 15:57:44 +0000</pubDate><guid>https://shocksolution.com/posts/how-to-install-octave-video-tools-on-centos-5/</guid><description>&lt;p&gt;This post describes how to get &lt;a href="http://%3C%3Cwww.gnu.org/software/octave/&amp;amp;gt%3E;" title="GNU%20Octave:%20free%20software%20that%20works%20like%20MATLAB"&gt;GNU Octave&lt;/a&gt; up and running on a CentOS 5 Linux system for use in reading, processing, and writing video files.  You will need to use the &lt;a href="http://fedoraproject.org/wiki/EPEL" title="How%20to%20set%20up%20EPEL%20repository"&gt;EPEL&lt;/a&gt; and &lt;a href="http://wiki.centos.org/AdditionalResources/Repositories/RPMForge" title="How%20to%20set%20up%20DAG/RPMForge%20repository"&gt;DAG/rpmforge&lt;/a&gt; repositories, but I won&amp;rsquo;t explain how to do that here. NOTE: I had to go through some trial and error to get this working.  I tried to summarize only the necessary steps, but I can&amp;rsquo;t guarantee I got it completely right until I try a fresh install on another system which does not have any of the dependencies already installed.  Please leave a comment if you encounter any problems. As a superuser, use &lt;strong&gt;yum&lt;/strong&gt;to install octave.  You need octave-devel and ncurses-devel in order to install any Octave packages.  You will need to have the EPEL repository enabled: yum install octave octave-devel ncurses-devel As a superuser, use&lt;strong&gt;yum&lt;/strong&gt; to install ffmpeg and ffmpeg-devel from the rpmforge repo.  The video package for octave uses the ffmpeg libraries (avilib) to perform the actual video processing.  You will need the ffmpeg-devel package, because Octave builds the video package from source.&lt;/p&gt;</description></item><item><title>How to build ScipPy with Python 2.7.2 on CentOS5</title><link>https://shocksolution.com/posts/how-to-build-scippy-with-python-2-7-2-on-centos5/</link><pubDate>Thu, 25 Aug 2011 00:17:57 +0000</pubDate><guid>https://shocksolution.com/posts/how-to-build-scippy-with-python-2-7-2-on-centos5/</guid><description>&lt;p&gt;EDIT: added &amp;ndash;enable-shared to configure script for building Python, and added /home/yourname/lib to shared library path.  This is necessary for building some packages such as pycairo (which you may need to build pygtk and matplotlib). EDIT 2: you should use the &amp;ndash;prefix=/home/yourusername instead of &amp;ndash;user.  The prefix option places packages in the standard location: /home/yourusername/lib/python2.7/site-packages.  The &amp;ndash;user option places the packages in /home/yourusername/.local/lib/python2.7/site-packages which I think is screwed up!   I use CentoOS5 because I want enterprise-class stability, as well as binary compatibility with a commercial application that is built for RHEL5.  I need to use some &amp;ldquo;bleeding edge&amp;rdquo; packages, such as the latest version of SciPy, but I don&amp;rsquo;t want to affect the base stability of the system.  Here is how I did it.  First, with superuser privileges, use yum to install the following packages.  You may need to set up epel as an alternate repository:&lt;/p&gt;</description></item><item><title>Parsing INI configuration files with FORTRAN</title><link>https://shocksolution.com/posts/parsing-ini-configuration-files-with-fortran/</link><pubDate>Tue, 23 Aug 2011 21:14:44 +0000</pubDate><guid>https://shocksolution.com/posts/parsing-ini-configuration-files-with-fortran/</guid><description>&lt;p&gt;Fortran would not be my first choice for working with text, in any form! However, sometimes even numerical codes need to read data from configuration files. The easiest way to read a configuration file from a Fortran 90 routine is by using &lt;a href="http://owen.sj.ca.us/~rk/howto/slides/f90model/slides/namelist.html" title="Fortran%20namelist%20I/O"&gt;namelist I/O&lt;/a&gt; (I really need to add an example of that). If you&amp;rsquo;re stuck with &lt;a href="http://en.wikipedia.org/wiki/INI_file" title="All%20about%20INI%20files"&gt;INI files&lt;/a&gt;, I found an &lt;a href="http://%3C%3Cwww.fortranlib.com/freesoft.htm#Miscellaneous&amp;amp;gt%3E;" title="Fortran%20INI%20file%20parser"&gt;INI file parser written in Fortran&lt;/a&gt; buried in an index of free Fortran routine.  I don&amp;rsquo;t even remember how I even found it, since it&amp;rsquo;s not well labeled and doesn&amp;rsquo;t come up in the first few pages of Google results, so I thought I&amp;rsquo;d better write a post about it in case I ever need such a thing in the future.&lt;/p&gt;</description></item><item><title>Visualization</title><link>https://shocksolution.com/posts/visualization/</link><pubDate>Tue, 23 Aug 2011 03:14:18 +0000</pubDate><guid>https://shocksolution.com/posts/visualization/</guid><description>&lt;h2 id="open-source-visualization-tools"&gt;Open-source visualization tools&lt;/h2&gt;&#10;&lt;p&gt;This list is not exhaustive, and I haven&amp;rsquo;t used all these tools.  Hopefully, you&amp;rsquo;ll find something useful.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;&lt;a href="http://asymptote.sourceforge.net/" title="Asymptote:%20a%20vector%20graphics%20language"&gt;asymptote&lt;/a&gt;&lt;/em&gt; &lt;a href="http://code.enthought.com/projects/chaco/" title="Chaco:%202D%20plotting%20for%20Python"&gt;chaco&lt;/a&gt;&#10;&lt;em&gt;&lt;a href="http://www2-pcmdi.llnl.gov/cdat" title="Climate%20Data%20Analysis%20Tools"&gt;CDAT (Climate Data Analysis Tools)&lt;/a&gt;&lt;/em&gt; &lt;a href="http://%3Cwww.sci.utah.edu/cibc/software/41-imagevis3d.html%3E" title="ImageVis3D"&gt;ImageVis3D (volume rendering)&lt;/a&gt;&#10;&lt;em&gt;&lt;a href="http://matplotlib.sourceforge.net/" title="matplotlib:%20Matlab-like%20plots%20in%20Python"&gt;matplotlib&lt;/a&gt; (&lt;a href="http://code.google.com/p/mplh5canvas/" title="HTML%205%20canvas%20backend%20for%20matplotlib"&gt;html 5 canvas&lt;/a&gt;)&lt;/em&gt; &lt;a href="http://pgf.sourceforge.net/" title="tikz/pgf:%20plotting%20for%20TeX"&gt;tikz/pgf (plotting for TeX)&lt;/a&gt;&#10;&lt;em&gt;&lt;a href="https://wci.llnl.gov/codes/visit/home.html" title="VisIt"&gt;VisIt&lt;/a&gt;&lt;/em&gt; &lt;a href="http://%3Cwww.vistrails.org/index.php/Main_Page%3E" title="VisTrails"&gt;VisTrails&lt;/a&gt; (a workflow tool that utilizes other visualizers)&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="http://%3Cwww.vtk.org/%3E" title="VTK"&gt;VTK&lt;/a&gt; (&lt;a href="http://github.enthought.com/mayavi/mayavi/" title="Mayavi:%203D%20visualization%20for%20Python"&gt;Mayavi&lt;/a&gt;, &lt;a href="http://%3Cwww.paraview.org/%3E" title="Paraview"&gt;Paraview&lt;/a&gt;)&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>LaTeX</title><link>https://shocksolution.com/posts/latex/</link><pubDate>Sun, 21 Aug 2011 03:52:06 +0000</pubDate><guid>https://shocksolution.com/posts/latex/</guid><description>&lt;p&gt;&lt;a href="http://%3Cwww.latex-project.org/%3E" title="LaTeX"&gt;LaTeX&lt;/a&gt; is the the best way to create technical documents.  I&amp;rsquo;m using it to write my dissertation at the University of Central Florida (I have already used it to write my Master&amp;rsquo;s thesis).  This time, I&amp;rsquo;m writing my own document class.  The existing unofficial UCF class uses a lot of raw TeX to achieve its formatting goals.  It&amp;rsquo;s hard to read and does not work well with modern LaTeX packages.  My new document class is much cleaner and simpler, uses no TeX, and requires only standard LaTeX packages that come with every distribution.&lt;/p&gt;</description></item><item><title>Removing an axis or both axes from a matplotlib plot</title><link>https://shocksolution.com/posts/removing-an-axis-or-both-axes-from-a-matplotlib-plot/</link><pubDate>Wed, 17 Aug 2011 22:40:14 +0000</pubDate><guid>https://shocksolution.com/posts/removing-an-axis-or-both-axes-from-a-matplotlib-plot/</guid><description>&lt;p&gt;Sometimes, the frame around a &lt;a href="http://matplotlib.sourceforge.net/" title="matplotlib"&gt;matplotlib&lt;/a&gt; plot can detract from the information you are trying to convey.  How do you remove the frame, ticks, or axes from a matplotlib plot? &lt;figure class="ma0 w-75"&gt;&lt;img src="https://shocksolution.com/images/plot_without_y_axis.png"&#10;&#9;&#9;&#9;alt="matplotlib plot without a y axis"&gt;&lt;figcaption&gt;&#10;&#9;&#9;&#9;&lt;p&gt;matplotlib plot without a y axis&lt;/p&gt;&#10;&#9;&#9;&lt;/figcaption&gt;&#10;&lt;/figure&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Some books you may find useful when working with matplotlib: &lt;a href="https://%3C%3Cwww.amazon.com/gp/product/0132269937/ref=as_li_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0132269937&amp;amp;linkCode=as2&amp;amp;tag=rootwork0f-20&amp;amp;linkId=44971fe03f445ae25fecb2cc2702d3aa&amp;amp;gt%3E;"&gt;&lt;img src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;amp;MarketPlace=US&amp;amp;ASIN=0132269937&amp;amp;ServiceVersion=20070822&amp;amp;ID=AsinImage&amp;amp;WS=1&amp;amp;Format=_SL160_&amp;amp;tag=rootwork0f-20" alt="image"&gt;&lt;/a&gt;&lt;img src="//ir-na.amazon-adsystem.com/e/ir?t=rootwork0f-20&amp;amp;l=am2&amp;amp;o=1&amp;amp;a=0132269937" alt="image"&gt;&lt;a href="https://%3C%3Cwww.amazon.com/Python-Data-Analysis-Wrangling-IPython/dp/1491957662/ref=as_li_ss_il?keywords=matplotlib&amp;amp;qid=1537646489&amp;amp;sr=8-12&amp;amp;ref=sr_1_12&amp;amp;linkCode=li2&amp;amp;tag=rootwork0f-20&amp;amp;linkId=545b965f9a5ae1055ae778fca7628568&amp;amp;language=en_US&amp;amp;gt%3E;"&gt;&lt;img src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;amp;ASIN=1491957662&amp;amp;Format=_SL160_&amp;amp;ID=AsinImage&amp;amp;MarketPlace=US&amp;amp;ServiceVersion=20070822&amp;amp;WS=1&amp;amp;tag=rootwork0f-20&amp;amp;language=en_US" alt="image"&gt;&lt;/a&gt;&lt;img src="https://ir-na.amazon-adsystem.com/e/ir?t=rootwork0f-20&amp;amp;language=en_US&amp;amp;l=li2&amp;amp;o=1&amp;amp;a=1491957662" alt="image"&gt;&lt;a href="https://%3C%3Cwww.amazon.com/Mastering-matplotlib-Duncan-M-McGreggor/dp/1783987545/ref=as_li_ss_il?keywords=matplotlib&amp;amp;qid=1537646489&amp;amp;sr=8-1&amp;amp;ref=sr_1_1&amp;amp;linkCode=li2&amp;amp;tag=rootwork0f-20&amp;amp;linkId=ec917748d4c441f93e36024379f32b58&amp;amp;language=en_US&amp;amp;gt%3E;"&gt;&lt;img src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;amp;ASIN=1783987545&amp;amp;Format=_SL160_&amp;amp;ID=AsinImage&amp;amp;MarketPlace=US&amp;amp;ServiceVersion=20070822&amp;amp;WS=1&amp;amp;tag=rootwork0f-20&amp;amp;language=en_US" alt="image"&gt;&lt;/a&gt;&lt;img src="https://ir-na.amazon-adsystem.com/e/ir?t=rootwork0f-20&amp;amp;language=en_US&amp;amp;l=li2&amp;amp;o=1&amp;amp;a=1783987545" alt="image"&gt;&lt;a href="https://%3C%3Cwww.amazon.com/Matplotlib-Plotting-Cookbook-Alexandre-Devert/dp/1849513260/ref=as_li_ss_il?keywords=matplotlib&amp;amp;qid=1537646489&amp;amp;sr=8-2&amp;amp;ref=sr_1_2&amp;amp;linkCode=li2&amp;amp;tag=rootwork0f-20&amp;amp;linkId=6b7d2e5dacde0fa357c7d0316befb29b&amp;amp;language=en_US&amp;amp;gt%3E;"&gt;&lt;img src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;amp;ASIN=1849513260&amp;amp;Format=_SL160_&amp;amp;ID=AsinImage&amp;amp;MarketPlace=US&amp;amp;ServiceVersion=20070822&amp;amp;WS=1&amp;amp;tag=rootwork0f-20&amp;amp;language=en_US" alt="image"&gt;&lt;/a&gt;&lt;img src="https://ir-na.amazon-adsystem.com/e/ir?t=rootwork0f-20&amp;amp;language=en_US&amp;amp;l=li2&amp;amp;o=1&amp;amp;a=1849513260" alt="image"&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/cfinch/Shocksolution_Examples/tree/master/Plotting/matplotlib" title="Removing%20an%20axis%20from%20a%20Matplotlib%20plot"&gt;The full example is available on github&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;First, we construct a figure and an axes object:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;fig1 = plt.figure(facecolor=&amp;#39;white&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ax1 = plt.axes(frameon=False)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;The Axes object is a container that holds the axes, the ticks, the labels, the plot, the legend, etc.  You will always have an Axes object, even if the axes are not visible! The keyword argument &lt;strong&gt;frameon=False&lt;/strong&gt; turns the frame off. An alternative method is:&lt;/p&gt;</description></item><item><title>A git branching strategy suitable for large projects</title><link>https://shocksolution.com/posts/a-git-branching-strategy-suitable-for-large-projects/</link><pubDate>Sat, 13 Aug 2011 21:57:14 +0000</pubDate><guid>https://shocksolution.com/posts/a-git-branching-strategy-suitable-for-large-projects/</guid><description>&lt;p&gt;Git is an amazing tool&amp;hellip;but what is the best way to use it?  Like any tool that gives you great power and flexibility, it&amp;rsquo;s up to you to use the tool in the best way to suit your purpose.  A friend of mine who manages an enterprise-class software development team recommended the &lt;a href="http://nvie.com/posts/a-successful-git-branching-model/" title="Git%20flow%20branching%20strategy"&gt;git branching strategy explained in this blog post&lt;/a&gt;.  I highly recommend reading it.&lt;/p&gt;</description></item><item><title>Running Sage on Windows with VirtualBox</title><link>https://shocksolution.com/posts/running-sage-on-windows-with-virtualbox/</link><pubDate>Thu, 28 Jul 2011 21:40:40 +0000</pubDate><guid>https://shocksolution.com/posts/running-sage-on-windows-with-virtualbox/</guid><description>&lt;p&gt;The easiest way to run Sage on Windows is with a virtual machine.  Sage is a collection of tools that were primarily developed for UNIX-based operating systems (such as Solaris or Mac OS X)  or UNIX-like operating systems (BSD, Linux, etc).  Since a standard Windows installation lacks many of the features provided by a UNIX-like environment, Sage is packaged as a Linux virtual machine.  You need free virtualization software&amp;ndash;&lt;a href="http://%3Cwww.vmware.com/products/player/%3E" title="VMware%20Player"&gt;VMWare Player&lt;/a&gt; or &lt;a href="http://%3Cwww.virtualbox.org/%3E" title="VirtualBox"&gt;VirtualBox&lt;/a&gt;--to run the virtual machine.  I find VMWare Player easier to work with, but it&amp;rsquo;s not an open-source solution.  VirtualBox is truly free software, but it&amp;rsquo;s also harder to configure.  When you download Sage, you can choose between a .ova file (for VirtualBox) or a zipped VMware virtual machine.  The easiest thing to do is choose the appropriate format for your VM.  However, it&amp;rsquo;s also possible to run the VMware image on Virtualbox, and I&amp;rsquo;ll show you how. If you want to learn more about Sage, check out the &lt;a href="http://%3Cwww.packtpub.com/sage-beginners-guide/book%3E" title="Sage%20Beginner's%20Guide"&gt;Sage Beginner&amp;rsquo;s Guide&lt;/a&gt; from Packt Publishing. Download, install, and run VirtualBox, and then click the &amp;ldquo;New&amp;rdquo; button to get started.  Also, unzip the .zip file that contains the VMware virtual machine. &lt;figure class="ma0 w-75"&gt;&lt;img src="https://shocksolution.com/images/VirtualBox_Manager-300x154.png"&#10;&#9;&#9;&#9;alt="VirtualBox Manager"&gt;&lt;figcaption&gt;&#10;&#9;&#9;&#9;&lt;p&gt;VirtualBox Manager&lt;/p&gt;</description></item><item><title>Numbering equations in Word 2007</title><link>https://shocksolution.com/posts/numbering-equations-in-word-2007/</link><pubDate>Tue, 12 Jul 2011 20:00:35 +0000</pubDate><guid>https://shocksolution.com/posts/numbering-equations-in-word-2007/</guid><description>&lt;p&gt;Microsoft Word isn&amp;rsquo;t the best software for technical writing, but sometimes we have to use it.  Here is the best way I&amp;rsquo;ve found to emulate the automatic equation numbering that &lt;a href="http://%3C%3Cwww.latex-project.org/&amp;amp;gt%3E;" title="LaTeX%20Project"&gt;LaTeX&lt;/a&gt; has been doing for years:&lt;/p&gt;&#10;&lt;h2 id="insert-an-equation-old-style"&gt;Insert an equation (old-style)&lt;/h2&gt;&#10;&lt;p&gt;Use the Object button on the Insert tab to bring up the dialog box.  Choose Microsoft Equation 3.0 and enter an equation. &lt;figure class="ma0 w-75"&gt;&lt;img src="https://shocksolution.com/images/Insert_Equation-300x197.png"&#10;&#9;&#9;&#9;alt="Insert equation"&gt;&lt;figcaption&gt;&#10;&#9;&#9;&#9;&lt;p&gt;Insert equation&lt;/p&gt;&#10;&#9;&#9;&lt;/figcaption&gt;&#10;&lt;/figure&gt;&#10; In Word 2007 and later, you can also use the new style of equations, but you&amp;rsquo;ll need to use a different &lt;a href="http://blogs.office.com/b/microsoft-word/archive/2006/10/20/equation-numbering.aspx" title="Numbering%20new-style%20equations%20in%20Word%202007%20and%20later"&gt;method for numbering the new equations&lt;/a&gt;.  Be warned that the new style is not compatible with Powerpoint 2007 or Word for Mac, which is why I&amp;rsquo;m not using them yet.&lt;/p&gt;</description></item><item><title>Python: lists to tuples and tuples to lists</title><link>https://shocksolution.com/posts/python-lists-to-tuples-and-tuples-to-lists/</link><pubDate>Sat, 02 Jul 2011 17:07:00 +0000</pubDate><guid>https://shocksolution.com/posts/python-lists-to-tuples-and-tuples-to-lists/</guid><description>&lt;p&gt;&lt;a href="https://github.com/cfinch/Shocksolution_Examples/blob/master/Fundamentals/zip.py" title="Example%20code%20for%20Python%20zip"&gt;Get the code for this example&lt;/a&gt; The &lt;a href="http://docs.python.org/library/functions.html#zip" title="zip"&gt;zip&lt;/a&gt; function in Python accepts a number of sequences (such as lists or arrays) and returns a list of tuples.  The first element of each tuple comes from the first sequence, the second from the second sequence, and so on.  For example: [code language=&amp;ldquo;Python&amp;rdquo;]a = range(0, 5) b = range(5, 10) c = range(10, 15) sequence_of_tuples = zip(a, b, c) print(sequence_of_tuples)[/code]&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[(0, 5, 10), (1, 6, 11), (2, 7, 12), (3, 8, 13), (4, 9, 14)]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;&lt;a href="https://%3Cwww.amazon.com/gp/product/0132269937/ref=as_li_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0132269937&amp;amp;linkCode=as2&amp;amp;tag=rootwork0f-20&amp;amp;linkId=44971fe03f445ae25fecb2cc2702d3aa%3E"&gt;&lt;img src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;amp;MarketPlace=US&amp;amp;ASIN=0132269937&amp;amp;ServiceVersion=20070822&amp;amp;ID=AsinImage&amp;amp;WS=1&amp;amp;Format=_SL160_&amp;amp;tag=rootwork0f-20" alt="image"&gt;&lt;/a&gt;&lt;img src="//ir-na.amazon-adsystem.com/e/ir?t=rootwork0f-20&amp;amp;l=am2&amp;amp;o=1&amp;amp;a=0132269937" alt="image"&gt;&lt;/p&gt;</description></item><item><title>Blog infrastructure updated</title><link>https://shocksolution.com/posts/blog-infrastructure-updated/</link><pubDate>Fri, 24 Jun 2011 15:15:06 +0000</pubDate><guid>https://shocksolution.com/posts/blog-infrastructure-updated/</guid><description>&lt;p&gt;I&amp;rsquo;m almost finished with a round of updates to the infrastructure of this site. I upgraded Wordpress and changed my hosting from a friend&amp;rsquo;s virtual server to Linux hosting with GoDaddy.com.  The price is right and so far the service has been great.  I&amp;rsquo;ve used GoDaddy for domain name registration for many years. [ad#GoDaddy Hosting] Comments are now protected with &lt;a href="http://%3C%3Cwww.google.com/recaptcha&amp;amp;gt%3E;"&gt;reCaptcha&lt;/a&gt; to try to reduce the amount of link spam that I have to sort through.  If you have a problem posting a comment, or notice any other aspect of the site that is &amp;ldquo;broken,&amp;rdquo; please contact me at the email address shown on the &lt;a href="https://shocksolution.com/about/" title="About%20shocksolution.com"&gt;About&lt;/a&gt; page. I still have a bit of work to do on updating my theme to take advantage of the features of Wordpress 3.&lt;/p&gt;</description></item><item><title>Finding dimensions of a bounding box in Jmol</title><link>https://shocksolution.com/posts/finding-dimensions-of-a-bounding-box-in-jmol/</link><pubDate>Mon, 13 Jun 2011 20:22:35 +0000</pubDate><guid>https://shocksolution.com/posts/finding-dimensions-of-a-bounding-box-in-jmol/</guid><description>&lt;p&gt;The &lt;a href="http://jmol.sourceforge.net/" title="Jmol%20homepage"&gt;Jmol&lt;/a&gt; applet (or Java application) is widely used to visualize the structure of molecules.  It is very powerful, but not that well documented. If you don&amp;rsquo;t have Jmol running, open the page for &lt;a href="http://%3Cwww.pdb.org/pdb/explore/jmol.do?structureId=1CF3&amp;amp;opt=3&amp;amp;bionumber=1%3E" title="PDB%201CF3"&gt;Glucose Oxidase (1CF3) from the Protein Databank&lt;/a&gt; so you can follow the instructions for finding the size of the bounding box. Right-click on the applet to get a pop-up menu with lots of options.  Under the &lt;strong&gt;Style&lt;/strong&gt;submenu, click on&lt;strong&gt;Boundbox&lt;/strong&gt;to show a bounding box around the molecule: &lt;figure class="ma0 w-75"&gt;&lt;img src="https://shocksolution.com/images/show_boundbox_menu.png"&#10;&#9;&#9;&#9;alt="Show bounding box"&gt;&lt;figcaption&gt;&#10;&#9;&#9;&#9;&lt;p&gt;Show bounding box&lt;/p&gt;</description></item><item><title>Sage Beginner's Guide: Code and Errata</title><link>https://shocksolution.com/posts/sage/</link><pubDate>Sat, 04 Jun 2011 18:50:59 +0000</pubDate><guid>https://shocksolution.com/posts/sage/</guid><description>&lt;p&gt;&lt;a href="http://%3C%3Cwww.sagemath.org/&amp;amp;gt%3E;" title="Sage"&gt;Sage&lt;/a&gt; is a free open-source mathematics software system.  It&amp;rsquo;s a GPL alternative to commercial software such as &lt;em&gt;Magma&lt;/em&gt;, &lt;em&gt;Maple&lt;/em&gt;, &lt;em&gt;Mathematica&lt;/em&gt; and &lt;em&gt;MATLAB&lt;/em&gt;.  Sage is a research-grade tool, &lt;a href="http://%3C%3Cwww.sagemath.org/library-publications.html&amp;amp;gt%3E;" title="Sage%20citations"&gt;cited in nearly 100 academic research articles&lt;/a&gt; (with dozens more in press). I&amp;rsquo;ve written a &lt;a href="https://%3C%3Cwww.packtpub.com/sage-beginners-guide/book&amp;amp;gt%3E;" title="Sage%20beginners%20guide"&gt;book to help engineers, scientists, and students get started with Sage&lt;/a&gt;.  It&amp;rsquo;s available in print and e-book formats.  Please check it out!&lt;/p&gt;&#10;&lt;h2 id="code"&gt;Code&lt;/h2&gt;&#10;&lt;p&gt;I am aware that there are a number of issues with the code bundle that is available on the Packt site, but I have not been able to get the publisher to replace it.&lt;/p&gt;</description></item><item><title>Photography</title><link>https://shocksolution.com/posts/photography/</link><pubDate>Sat, 14 May 2011 21:26:28 +0000</pubDate><guid>https://shocksolution.com/posts/photography/</guid><description>&lt;p&gt;These are links to places where my photos have appeared online or in print:&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;&lt;a href="http://%3Cwww.darkroastedblend.com/2009/01/ugly-belching-steam-powered-tractors.html%3E" title="Steam%20Tractors"&gt;Steam tractors on Dark Roasted Blend&lt;/a&gt;&lt;/em&gt; &lt;a href="http://%3Cwww.tfwm.com/1109backlighting%3E" title="Backlighting"&gt;Stage lighting article for Technologies for Worship Magazine&lt;/a&gt; (also in print)&#10;&lt;em&gt;&lt;a href="http://%3Cwww.schmap.com/floridakeys/shopping_markets/#r=none&amp;amp;mapview=Map&amp;amp;tab=Places&amp;amp;p=98087&amp;amp;topleft=24.56479,-81.80614&amp;amp;bottomright=24.55393,-81.80011&amp;amp;i=98087_21.jpg%3E" title="Guide%20to%20the%20Florida%20Keys"&gt;Schmap.com Guide to the Florida Keys&lt;/a&gt; (one of several photos of Mallory Square)&lt;/em&gt; The Center for Educational Technology in Israel used a photo of a cell phone tower disguised as a tree in a geography book for 7th and 8th grade students&lt;/p&gt;</description></item><item><title>IGES file reader</title><link>https://shocksolution.com/posts/iges-file-reader/</link><pubDate>Thu, 14 Apr 2011 18:26:47 +0000</pubDate><guid>https://shocksolution.com/posts/iges-file-reader/</guid><description>&lt;p&gt;I am creating a Python library for reading CAD files in IGES format.   I have barely started on the project&amp;ndash;so far, it should be able to parse arbitrary IGES files without crashing, and it can extract useful information for line segments and rational B-spline curves.   That&amp;rsquo;s all I need to get my work done right now, so I don&amp;rsquo;t feel justified in spending too much more &amp;ldquo;company time&amp;rdquo; on this.  I am hoping that other people will help me by adding Python classes to represent the types of entities that they need.&lt;/p&gt;</description></item><item><title>CAD/CAM</title><link>https://shocksolution.com/posts/cadcam/</link><pubDate>Thu, 14 Apr 2011 18:26:11 +0000</pubDate><guid>https://shocksolution.com/posts/cadcam/</guid><description>&lt;p&gt;Projects related to computer aided design/drafting (CAD) and computer aided manufacturing (CAM).&lt;/p&gt;</description></item><item><title>Replacing text in place with GNU sed</title><link>https://shocksolution.com/posts/replacing-text-in-place-with-gnu-sed/</link><pubDate>Mon, 11 Apr 2011 17:39:38 +0000</pubDate><guid>https://shocksolution.com/posts/replacing-text-in-place-with-gnu-sed/</guid><description>&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Sed" title="sed%20on%20wikipedia"&gt;sed&lt;/a&gt; is a stream editor, which means that it accepts a stream of text, processes it, and spits out another stream of text.  sed can process files that are too large to load into memory, and it is a completely command-line tool that can easily be integrated into shell scripts.  This &lt;a href="http://%3Cwww.grymoire.com/Unix/Sed.html%3E" title="sed%20tutorial"&gt;excellent sed tutorial&lt;/a&gt; was written for an old version of sed provided by Sun Microsystems, and it doesn&amp;rsquo;t cover one of the most useful features of &lt;a href="http://%3Cwww.gnu.org/software/sed/%3E" title="GNU%20sed"&gt;GNU sed&lt;/a&gt;.  GNU sed accepts a &lt;strong&gt;-i&lt;/strong&gt;command line argument that tells sed to replace the text file in place, rather than writing the output stream to another file.  Another nice feature is that&lt;strong&gt;sed -i&lt;/strong&gt; will create a backup file before processing if you provide a backup suffix:&lt;/p&gt;</description></item><item><title>A self-contained Fortran linear equation solver</title><link>https://shocksolution.com/posts/a-self-contained-fortran-linear-equation-solver/</link><pubDate>Wed, 16 Mar 2011 21:33:27 +0000</pubDate><guid>https://shocksolution.com/posts/a-self-contained-fortran-linear-equation-solver/</guid><description>&lt;p&gt;I&amp;rsquo;ve just released a self-contained Fortran module that solves a system of linear equations using the LU decomposition. &lt;a href="https://github.com/cfinch/Shocksolution_Examples/tree/master/FORTRAN/LinearEquationSolver" title="Fortran%20linear%20system%20solver"&gt;Download the Fortran linear solver from github&lt;/a&gt; This module is based on code that was implemented and released on the Web by &lt;a href="http://jean-pierre.moreau.pagesperso-orange.fr/f_matrices.html"&gt;Jean-Pierre Moreau&lt;/a&gt;.  His implementation was based on one of the &lt;a href="http://%3Cwww.nr.com/%3E"&gt;Numerical Recipes&lt;/a&gt; books.  I updated his code to a more strict Fortran 90 standard and added the necessary comments so that it can be built as a Python module using &lt;a href="http://%3Cwww.scipy.org/F2py%3E" title="f2py"&gt;f2py&lt;/a&gt;.  I replaced Jean-Pierre&amp;rsquo;s Fortran test program with a simpler, self-contained program.  I also included a Python script that implements the same test case. I created this module because sometimes a self-contained routine is more appropriate than a full library.  I am compiling a library that implements a custom boundary condition for a proprietary computational fluid dynamics solver (CFD-ACE+).  The library has to be written in Fortran, and it has to be built using a proprietary set of build scripts.  I could either try to reverse-engineer the build process and to modify it to link to a shared library like &lt;a href="http://%3Cwww.netlib.org/lapack/%3E" title="LAPACK"&gt;LAPACK&lt;/a&gt;, or I could implement a self-contained solver.  Since Pierre had already implemented the solver, I was able to slightly modify his code and get it working relatively quickly.&lt;/p&gt;</description></item><item><title>Finding a value in an unordered Fortran array</title><link>https://shocksolution.com/posts/finding-value-in-unordered-fortran-array/</link><pubDate>Fri, 11 Mar 2011 16:27:51 +0000</pubDate><guid>https://shocksolution.com/posts/finding-value-in-unordered-fortran-array/</guid><description>&lt;p&gt;I have been optimizing some Fortran code that involved searching for an integer value in an unordered array (we know the value occurs only once).  Since there is no intrinsic procedure to accomplish this, I thought I&amp;rsquo;d try a couple of approaches to see which was fastest.  The simple answer is that, in this case, brute force beats elegance, even when the target value is near the end of the array. &lt;a href="https://github.com/cfinch/Shocksolution_Examples/tree/master/FORTRAN/FindElementInArray" title="Example%20code"&gt;Download the full example from GitHub&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Sage: open-source mathematical software</title><link>https://shocksolution.com/posts/sage-open-source-mathematical-software/</link><pubDate>Mon, 07 Mar 2011 14:07:19 +0000</pubDate><guid>https://shocksolution.com/posts/sage-open-source-mathematical-software/</guid><description>&lt;p&gt;I&amp;rsquo;ve recently gained a lot of experience with &lt;a href="http://%3Cwww.sagemath.org/%3E" title="Sage"&gt;Sage&lt;/a&gt;, an open-source alternative to MATLAB, Mathematica, Maple, MuPAD, and Magma.  Here are a couple of links to check out:&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;&lt;a href="http://%3Cwww.sagenb.org/%3E" title="Sage%20public%20notebook%20servers"&gt;Public notebook servers&lt;/a&gt;--try it online right now!&lt;/em&gt; &lt;a href="http://wiki.sagemath.org/interact" title="Interactive%20Sage%20examples"&gt;Interactive examples with Sage&lt;/a&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="http://sagemath.org/library-publications.html" title="Publications%20citing%20Sage"&gt;Mathematical publications citing Sage&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="sage-vs-mathematica"&gt;Sage vs. Mathematica&lt;/h2&gt;&#10;&lt;p&gt;My experience with mathematical software started my freshman year at the University of Illinois when I signed up for a calculus class that was taught almost entirely with Mathematica.  I grew to love Mathematica&amp;rsquo;s symbolic computation and plotting capabilities, although I found its programming language to be cumbersome.  Once I was no longer a student, Mathematica was no longer an option due to the hefty licensing fees.  With the caveat that I haven&amp;rsquo;t used Mathematica in many years,  I will say that Sage compares very favorably to my experience with Mathematica.  Sage has a notebook interface that allows you to integrate code, results, text, typeset equations, and graphics in an interactive document that can be viewed with any standards-compliant web browser.  I don&amp;rsquo;t know how Sage stacks up against Mathematica in areas of advanced mathematics.  I have heard that Sage is far ahead of Mathematica in number theory, because the lead developer of Sage is a number theorist.&lt;/p&gt;</description></item><item><title>Moving example code to GitHub</title><link>https://shocksolution.com/posts/moving-example-code-to-github/</link><pubDate>Fri, 04 Mar 2011 18:09:32 +0000</pubDate><guid>https://shocksolution.com/posts/moving-example-code-to-github/</guid><description>&lt;p&gt;As this site has grown, the example code has gradually become unmanageable. I&amp;rsquo;ve posted snippets and fragments here and there over the years, and the original code is scattered in various locations across several computers. Further, as people have pointed out bugs or ways to improve the examples, I&amp;rsquo;ve had a hard time making changes. This is problem is crying out for version control with a central repository. Since I&amp;rsquo;ve been using &lt;a href="http://git-scm.com/" title="Git"&gt;Git&lt;/a&gt; for the past year or so, I decided to try &lt;a href="https://github.com/"&gt;GitHub&lt;/a&gt;. So, I am gradually moving all the examples from the site to: &lt;a href="https://github.com/cfinch/Shocksolution_Examples" title="GitHub"&gt;&lt;a href="https://github.com/cfinch/Shocksolution_Examples"&gt;https://github.com/cfinch/Shocksolution_Examples&lt;/a&gt;&lt;/a&gt; When I put code in a post, I will provide a link to GitHub where you can browse or download the code.  You won&amp;rsquo; t need to use Git, or even learn anything about it.&lt;/p&gt;</description></item><item><title>Linear system simulation with Python</title><link>https://shocksolution.com/posts/linear-system-simulation-with-python/</link><pubDate>Fri, 17 Dec 2010 21:33:16 +0000</pubDate><guid>https://shocksolution.com/posts/linear-system-simulation-with-python/</guid><description>&lt;p&gt;Linear time-invariant (LTI) systems are widely used in the field of signal processing.  &lt;a href="http://scipy.org/" title="Scipy"&gt;Scipy&lt;/a&gt; contains powerful tools for simulating LTI systems in the &lt;a href="http://docs.scipy.org/doc/scipy/reference/signal.html" title="scipy.signal%20docs"&gt;scipy.signal&lt;/a&gt; package, but they are not well documented.  I will provide a simple example that demonstrates how to use a few of the core classes and functions in scipy.signal for simulating LTI systems with Python.&lt;/p&gt;&#10;&lt;h2 id="define-an-lti-system"&gt;Define an LTI system&lt;/h2&gt;&#10;&lt;p&gt;You will need to have Scipy installed, and you will need to have &lt;a href="http://matplotlib.sourceforge.net/" title="Matplotlib"&gt;Matplotlib&lt;/a&gt; as well to make plots. We will start with an example of a &lt;a href="http://en.wikipedia.org/wiki/Time_constant" title="Time%20constant"&gt;first-order LTI system&lt;/a&gt;, which is characterized by a single parameter known as the time constant.  scipy.signal defines the class &lt;strong&gt;lti&lt;/strong&gt; to represent a linear system in Python.&lt;/p&gt;</description></item><item><title>Using Microsoft Word for Technical Documents</title><link>https://shocksolution.com/posts/using-microsoft-word-for-technical-documents/</link><pubDate>Wed, 18 Aug 2010 23:30:34 +0000</pubDate><guid>https://shocksolution.com/posts/using-microsoft-word-for-technical-documents/</guid><description>&lt;p&gt;Microsoft Word is not the best tool for doing technical writing.  However, sometimes we are required to use Word because we need to collaborate with others who want to use Word.  Right now, I am using Word 2007  on Windows XP to write several mathematical papers.  In general, it is a big improvement from previous versions.  The new integrated equation editor is outstanding&amp;ndash;except for the major bug I&amp;rsquo;ll discuss below.  Here is a brief &amp;ldquo;FAQ&amp;rdquo; you will want to read if you are using Word for technical writing. **Q:**How do I enter multi-line equations in Word 2007?**A:&lt;strong&gt;Press Shift-Enter where you want a line break to appear&lt;/strong&gt;Q:**How do I prevent a page break from splitting a table into two parts?**A:**Select the table.  On the Home tab, click the little box in the lower-right corner of the Paragraph box.  On the paragraph dialog, choose the &amp;ldquo;Lines and Page Breaks&amp;rdquo; tab.  Check the box for &amp;ldquo;Keep Lines Together.&amp;rdquo;**Q:**How do I automatically number headings in Word 2007?  For example: Section 1, Subsection 1.1, 1.2, 1.3, Section 2, etc.**A:**It&amp;rsquo;s not obvious.  &lt;a href="http://%3Cwww.dummies.com/how-to/content/numbering-headings-in-word-2007-multilevel-lists0.html%3E" title="Numbering%20headings%20in%20Word%202007"&gt;See this page from dummies.com about number headings&lt;/a&gt;.**Q:**In Word 2007, why do equations sometimes appear as blank spaces or question marks when I print or save my document as a PDF file?**A.**This occurs when Word is installed on Windows XP Pro.  See the following Microsoft tech support item to find out how to install missing scripts: &lt;a href="http://support.microsoft.com/kb/960985" title="Microsoft%20Support%20Item%20960985"&gt;The characters in an equation are not printed&lt;/a&gt;&amp;hellip; You may also have an outdated printer driver: &lt;a href="http://support.microsoft.com/kb/920228" title="Microsoft%20Support%20Item%20920228"&gt;Microsoft Support Item 920228&lt;/a&gt;**Q:**Why do equations created in Word 2007 disappear when I open the document in Word 2008 for Mac?&lt;strong&gt;A.&lt;/strong&gt; &lt;a href="http://tinyurl.com/2knb6l" title="Word%20for%20Mac%20does%20not%20support%20Word%202007%20equations"&gt;Word for Mac does not support equations written in the new Word 2007 equation editor&lt;/a&gt;. Unfortunately, neither does PowerPoint 2007 on the PC.  You can work around this by inserting equations into Word the old-fashioned way: go to the Insert tab, click on Object (found in the &amp;ldquo;Text&amp;rdquo; box towards the right side of the tab), and choose &amp;ldquo;Microsoft Equation 3.0&amp;rdquo; from the list in the dialog box.&lt;/p&gt;</description></item><item><title>Reading an array from a text file with Fortran 90/95</title><link>https://shocksolution.com/posts/reading-an-array-from-a-text-file-with-fortran-9095/</link><pubDate>Fri, 21 May 2010 20:59:26 +0000</pubDate><guid>https://shocksolution.com/posts/reading-an-array-from-a-text-file-with-fortran-9095/</guid><description>&lt;p&gt;If you&amp;rsquo;re used to coding in more modern languages, Fortran I/O can seem a little bizarre.  Strings in Fortran are much more difficult to work with, since they are fixed-length rather than null-terminated. The following example illustrates a simple way to read an array of numbers from a text file when the array length is unknown at compile time.&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;program io_test&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; real, dimension(:), allocatable :: x&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; integer :: n&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; open (unit=99, file=&amp;#39;array.txt&amp;#39;, status=&amp;#39;old&amp;#39;, action=&amp;#39;read&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; read(99, *), n&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; allocate(x(n))&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; read(99,*) x&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; write(*,*) x&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;Here is the text file that the array is read from. The integer on the first line is the number of elements to read from the next line.&lt;/p&gt;</description></item><item><title>Managing a pool of MPI processes with Python and Pypar</title><link>https://shocksolution.com/posts/managing-a-pool-of-mpi-processes-with-python-and-pypar/</link><pubDate>Sat, 17 Apr 2010 18:52:13 +0000</pubDate><guid>https://shocksolution.com/posts/managing-a-pool-of-mpi-processes-with-python-and-pypar/</guid><description>&lt;p&gt;MPI is a standard for communication between multiple processes in parallel computing. These processes can be running on different cores, CPUs, or entirely different computers in a grid. MPI is a standard, and there are many implementations available (many are open source). The features of MPI can be accessed from Python with the packages &lt;a href="http://code.google.com/p/pypar/" title="pypar"&gt;pypar&lt;/a&gt; and &lt;a href="http://mpi4py.scipy.org/" title="mpi4py"&gt;mpi4py&lt;/a&gt;.  Here I present a Python script that implements a &amp;ldquo;process pool&amp;rdquo; &lt;a href="http://en.wikipedia.org/wiki/Design_pattern_(computer_science)" title="Design patterns on Wikipedia"&gt;design pattern&lt;/a&gt; using pypar.  I have observed a pattern often enough in my own work that I wrote this framework to avoid reinventing the wheel every time I come across it. This pattern is useful for any &lt;a href="http://en.wikipedia.org/wiki/Embarrassingly_parallel" title="Embarassingly%20Parallel"&gt;embarrassingly parallel&lt;/a&gt; problem.  This describes a computing task that can be easily accelerated by running multiple parallel processes that do not not need to interact with one another.  For example, I have large scientific data sets from several runs of an experiment that need to be analyzed.  Since the data from each run can be analyzed independently from the other runs, I can analyze all the data sets at once on a parallel machine.   The code below implements a &amp;ldquo;master-worker&amp;rdquo; paradigm that requires at least three processes to accelerate the calculation.  The first process be comes the master, which does no calculation but hands out tasks to the workers.  The rest of the processes are workers, which receive a chunk of work, finish it, return the result to the master process, and then wait for more work.&lt;/p&gt;</description></item><item><title>Boost.python Numpy example</title><link>https://shocksolution.com/posts/boostpython-numpy-example/</link><pubDate>Wed, 14 Apr 2010 17:28:45 +0000</pubDate><guid>https://shocksolution.com/posts/boostpython-numpy-example/</guid><description>&lt;p&gt;Before recent advances such as &lt;a href="http://%3C%3Cwww.cython.org/&amp;amp;gt%3E;" title="Cython"&gt;Cython&lt;/a&gt;, &lt;a href="http://%3C%3Cwww.boost.org/doc/libs/1_52_0/libs/python/doc/&amp;amp;gt%3E;" title="Boost.Python"&gt;Boost.Python&lt;/a&gt; was one of the best ways to integrate C++ code into Python programs. The following C++ source code exposes a C++ function to Python. The function takes a &lt;a href="http://sourceforge.net/projects/numpy/files/" title="NumPy"&gt;NumPy array&lt;/a&gt; as an argument and extracts a C++ integer type.&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;#include&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;#include &amp;#34;boost/python/extract.hpp&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;#include &amp;#34;boost/python/numeric.hpp&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;#include&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;using namespace boost::python;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;// Functions to demonstrate extraction&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;void setArray(boost::python::numeric::array data) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; // Access a built-in type (an array)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; boost::python::numeric::array a = data;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; // Need to array elements because their type is unknown&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; std::cout &amp;lt;&amp;lt; &amp;#34;First array item: &amp;#34; &amp;lt;&amp;lt; extract(a[0]) &amp;lt;&amp;lt; std::endl;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;// Expose classes and methods to Python&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;BOOST_PYTHON_MODULE(TestNumPy) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; boost::python::numeric::array::set_module_and_type(&amp;#34;numpy&amp;#34;, &amp;#34;ndarray&amp;#34;);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; def(&amp;#34;setArray&amp;#34;, &amp;amp;setArray);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;```---&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;## Comments&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;### Comment #1 by ARAMBAM JAMES SINGH&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[ARAMBAM JAMES SINGH](mailto:&amp;lt;jamesastrick@gmail.com&amp;gt;) - Aug 2, 2016&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;I get this error : import TestNumpy as tnp ImportError: dynamic module does not define init function (initTestNumpy)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;---&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;#### Comment #2 by James&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[James](mailto:&amp;lt;jameastrick@gmail.com&amp;gt;) - Aug 0, 2016&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Hi , I get the error &amp;#34;Segmentation fault: 11&amp;#34; when i run the python code after compiling above c++ code #--------------- # import TestNumPy as nt import numpy as np a = np.array(\[10,20,30\]) nt.setArray(a)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&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;&#10; &lt;/div&gt;</description></item><item><title>Linking Python and C++ with Boost.python</title><link>https://shocksolution.com/posts/linking-python-and-c-with-boostpython/</link><pubDate>Wed, 14 Apr 2010 15:59:56 +0000</pubDate><guid>https://shocksolution.com/posts/linking-python-and-c-with-boostpython/</guid><description>&lt;h2 id="introduction-to-boost"&gt;Introduction to Boost&lt;/h2&gt;&#10;&lt;p&gt;Boost is a project to create open-source libraries for C++. There are a lot of nice tools available through Boost, one of which is &lt;a href="http://%3C%3Cwww.boost.org/doc/libs/1_58_0/libs/python/doc/index.html&amp;amp;gt%3E;"&gt;Boost.python&lt;/a&gt;. Boost.Python provides seamless interoperability between C++ and Python. I have found it to be an extremely useful tool for scientific programming. Parts of a program that require more flexibility than speed can be written in Python, and critical portions can be coded in C++.&lt;/p&gt;</description></item><item><title>Constrained least-squares fitting with Python</title><link>https://shocksolution.com/posts/constrained-least-squares-fitting-with-python/</link><pubDate>Fri, 05 Mar 2010 19:27:25 +0000</pubDate><guid>https://shocksolution.com/posts/constrained-least-squares-fitting-with-python/</guid><description>&lt;p&gt;&lt;a href="https://%3C%3Cwww.amazon.com/Elegant-SciPy-Art-Scientific-Python/dp/1491922877/ref=as_li_ss_il?keywords=scipy&amp;amp;qid=1537721480&amp;amp;sr=8-2&amp;amp;ref=sr_1_2&amp;amp;linkCode=li2&amp;amp;tag=rootwork0f-20&amp;amp;linkId=b82af06689ab1a386116469d41f270d6&amp;amp;language=en_US&amp;amp;gt%3E;"&gt;&lt;img src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;amp;ASIN=1491922877&amp;amp;Format=_SL160_&amp;amp;ID=AsinImage&amp;amp;MarketPlace=US&amp;amp;ServiceVersion=20070822&amp;amp;WS=1&amp;amp;tag=rootwork0f-20&amp;amp;language=en_US" alt="image"&gt;&lt;/a&gt;&lt;img src="https://ir-na.amazon-adsystem.com/e/ir?t=rootwork0f-20&amp;amp;language=en_US&amp;amp;l=li2&amp;amp;o=1&amp;amp;a=1491922877" alt="image"&gt;&lt;a href="https://%3C%3Cwww.amazon.com/Learning-Numerical-Scientific-Computing-Second/dp/1783987707/ref=as_li_ss_il?keywords=scipy&amp;amp;qid=1537721480&amp;amp;sr=8-3&amp;amp;ref=sr_1_3&amp;amp;linkCode=li2&amp;amp;tag=rootwork0f-20&amp;amp;linkId=4f28164dbe2c853ec36f6f35b052e71a&amp;amp;language=en_US&amp;amp;gt%3E;"&gt;&lt;img src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;amp;ASIN=1783987707&amp;amp;Format=_SL160_&amp;amp;ID=AsinImage&amp;amp;MarketPlace=US&amp;amp;ServiceVersion=20070822&amp;amp;WS=1&amp;amp;tag=rootwork0f-20&amp;amp;language=en_US" alt="image"&gt;&lt;/a&gt;&lt;img src="https://ir-na.amazon-adsystem.com/e/ir?t=rootwork0f-20&amp;amp;language=en_US&amp;amp;l=li2&amp;amp;o=1&amp;amp;a=1783987707" alt="image"&gt;&lt;a href="https://%3C%3Cwww.amazon.com/SciPy-Recipes-performing-mathematical-computations/dp/1788291468/ref=as_li_ss_il?keywords=scipy&amp;amp;qid=1537721480&amp;amp;sr=8-6&amp;amp;ref=sr_1_6&amp;amp;linkCode=li2&amp;amp;tag=rootwork0f-20&amp;amp;linkId=0f24d2d9680bc94c36ebe6665e04c5e3&amp;amp;language=en_US&amp;amp;gt%3E;"&gt;&lt;img src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;amp;ASIN=1788291468&amp;amp;Format=_SL160_&amp;amp;ID=AsinImage&amp;amp;MarketPlace=US&amp;amp;ServiceVersion=20070822&amp;amp;WS=1&amp;amp;tag=rootwork0f-20&amp;amp;language=en_US" alt="image"&gt;&lt;/a&gt;&lt;img src="https://ir-na.amazon-adsystem.com/e/ir?t=rootwork0f-20&amp;amp;language=en_US&amp;amp;l=li2&amp;amp;o=1&amp;amp;a=1788291468" alt="image"&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="http://scipy.org" title="SciPy%20home"&gt;Scipy&lt;/a&gt; contains a good least-squares fitting routine, &lt;a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.leastsq.html#scipy-optimize-leastsq"&gt;&lt;strong&gt;leastsq()&lt;/strong&gt;&lt;/a&gt;, which implements a modified Levenberg-Marquardt algorithm.  I just learned that it also has a constrained least-squared routine called &lt;a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.fmin_slsqp.html#scipy.optimize.fmin_slsqp" title="scipy.optimize.fmin_slsqp"&gt;&lt;strong&gt;fmin_slsqp()&lt;/strong&gt;&lt;/a&gt;.   I am using simple upper and lower bound constraints, but it&amp;rsquo;s also possible to specify more complex functional constraints. What I did not realize, at first, is that &lt;strong&gt;fmin_slsqp&lt;/strong&gt;requires a different type of objective function than&lt;strong&gt;leastsq&lt;/strong&gt;.   &lt;strong&gt;leastsq&lt;/strong&gt;requires you to write a function that returns a vector of residuals, and&lt;strong&gt;leastsq&lt;/strong&gt;automatically squares and sums the residuals.&lt;strong&gt;fmin_slsqp&lt;/strong&gt; is actually more flexible, in that it can use any objective function that returns a single scalar value.  To implement least-squares curve fitting, your objective function will need to find the residual at each data point, square the values, and sum them up.  Hopefully this tip will save you some time. Check out the &lt;a href="http://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html" title="scipy%20optimization%20tutorial"&gt;scipy optimization tutorial&lt;/a&gt; for more examples.  Here is the original &lt;a href="http://abs-5.me.washington.edu/dynOpt/p262-kraft.pdf" title="SLSQP%20reference"&gt;paper by Dieter Kraft&lt;/a&gt; which introduces the algorithm used by fmin_slsqp.&lt;/p&gt;</description></item><item><title>A preliminary review of the Lehigh Rendition console</title><link>https://shocksolution.com/posts/lehigh-rendition-console-review/</link><pubDate>Sun, 17 Jan 2010 17:35:09 +0000</pubDate><guid>https://shocksolution.com/posts/lehigh-rendition-console-review/</guid><description>&lt;p&gt;In my last post, I explained why I don&amp;rsquo;t think the ETC Element is a good replacement for the ETC Express.  When I was at LDI 2009, I ran across the &lt;a href="http://%3Cwww.lehighdim.com/rendition.htm%3E" title="Lehigh%20Rendition"&gt;Rendition&lt;/a&gt; series of consoles from &lt;a href="http://%3Cwww.lehighdim.com/%3E"&gt;Lehigh Lighting&lt;/a&gt;.   Based on the literature I picked up, and the extensive demonstration that I received from the Lehigh representative, it looks like the Rendition might be the true heir to the Express.  It is targeted at a similar market: small theaters, churches, and schools.  The physical layout will be familiar to anyone with theater console experience: 24 or 48 submasters on the left,  dual cue playback controls in the center, and hardkeys on the right, with channel faders (48 or 96) along the upper right portion of the desk.  The submasters are traditional theater-style subs.  Each sub records a fixed look rather than an independent cuelist.  Shows can be saved to a flash drive via a USB port. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/4281567195/%3E" title="Lehigh Rendition 24/48 by Oanjao, on Flickr"&gt;&lt;img src="http://farm3.static.flickr.com/2694/4281567195_952c07ffc0.jpg" alt="Lehigh Rendition 24/48"&gt;&lt;/a&gt; While the console hardware is finalized, several additional features will be added in an upcoming version of the operation system.  The console currently supports one external monitor, but dual monitors will soon be supported.  An Ethernet port is already included on the console.  In a future software release, it will be possible to add wings with additional submasters or channel faders.  The advantage of Ethernet over USB is that a wing can be placed hundreds of feet from the console, and connected using existing Ethernet lines.  This feature would allow a wing to to be used as remote focus unit.  Using a wireless Ethernet bridge opens up even more possibilities. The main difference between the two models, the 24/48 and 48/96, is the number of hardware faders.  The software capabilities are identical.   The price of the console depends on how many channels of conventional dimming are &amp;ldquo;unlocked.&amp;rdquo;  You can choose from 125, 250, or 512 conventional channels.  All models support 1024 channels of moving-light control.  The two hardware DMX ports each support 512 channels, but two additional universes can be accessed via Ethernet (I&amp;rsquo;m not sure of the details on how this works).  The console seems to support all the basic and advanced cue and effect functions that you&amp;rsquo;d expect: multiple cue lists, flexible cue timing options, macros, subroutines, and effects.  I can&amp;rsquo;t really comment further about that, since I would need to spend a lot of time with the console to accurately gauge its reliability and ease of use.  Moving lights are also supported, with fixture profiles for easy patching and a trackball for focusing.  Once again, it looks promising, but the only way to really evaluate these features is to try to use them and see how intuitive the process is.  &lt;a href="http://%3Cwww.lehighdim.com/offline_editors.htm%3E" title="Lehigh%20Rendition%20offline%20editor"&gt;Download the offline editing software and try it for yourself&lt;/a&gt;. A more sophisticated console called the Rendition Pro is expected to be available in the second quarter of 2010.  The Pro is aimed at more experienced users, and appears to compete with the ETC Eos and Ion.  It will run the same software as the Rendition, so many of the features that are expected to be added to the Rendition are actually being developed for the Pro.  The layout is similar to the Rendition, with playback masters on the left side, traditional cue playback controls in the lower center, and keys to the lower right. Two LCD displays with encoder wheels and softkeys occupy the space above the keypad, with no hard channel faders.  Further, the submasters  have LCD displays and additional buttons&amp;ndash;probably &amp;ldquo;Go&amp;rdquo; and &amp;ldquo;Pause&amp;rdquo;  buttons to support a cue stack on each sub. From my limited experience, both of these consoles series are worthy of further investigation.  They seem to be solidly built and well-engineered.  The Lehigh personnel that I spoke to were helpful and friendly, and I appreciate their assistance in answering my questions.&lt;/p&gt;</description></item><item><title>Storing large Numpy arrays on disk: Python Pickle vs. HDF5</title><link>https://shocksolution.com/posts/storing-large-numpy-arrays-on-disk-python-pickle-vs-hdf5adsf/</link><pubDate>Sun, 10 Jan 2010 23:00:20 +0000</pubDate><guid>https://shocksolution.com/posts/storing-large-numpy-arrays-on-disk-python-pickle-vs-hdf5adsf/</guid><description>&lt;p&gt;&lt;a href="https://shocksolution.com/2008/09/15/python-pickle-painless-binary-storage-for-python-objects/" title="Python%20data%20storage%20with%20Pickle"&gt;In a previous post, I described how Python&amp;rsquo;s Pickle module is fast and convenient&lt;/a&gt; for storing all sorts of data on disk. More recently, I showed &lt;a href="https://shocksolution.com/2009/04/17/profiling-memory-usage-of-python-code/" title="Profiling%20Python%20code"&gt;how to profile the memory usage of Python code&lt;/a&gt;.  In recent weeks, I&amp;rsquo;ve uncovered a serious limitation in the Pickle module when storing large amounts of data: Pickle requires a large amount of memory to save a data structure to disk. Fortunately, there is an open standard called HDF, which defines a binary file format that is designed to efficiently store large scientific data sets. I will demonstrate both approaches, and profile them to see how much memory is required. I am writing the HDF file using the PyTables interface. Here&amp;rsquo;s the little test program I&amp;rsquo;ve been using: [code language=&amp;ldquo;Python&amp;rdquo;]#!/usr/bin/env python from numpy import array&lt;/p&gt;</description></item><item><title>Python Basics: Tutorials and Examples</title><link>https://shocksolution.com/posts/python-basics-tutorials-and-examples/</link><pubDate>Mon, 21 Dec 2009 21:23:09 +0000</pubDate><guid>https://shocksolution.com/posts/python-basics-tutorials-and-examples/</guid><description>&lt;p&gt;If you&amp;rsquo;re new to Python and wondering how to use some of its features, you may find something useful in the following posts:&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;&lt;a href="https://shocksolution.com/2008/09/15/python-pickle-painless-binary-storage-for-python-objects/" title="Storing%20Python%20objects%20with%20Pickle"&gt;Storing data with Pickle&lt;/a&gt;&lt;/em&gt; &lt;a href="https://shocksolution.com/2009/01/06/tools-for-python-software-development/" title="Tools%20for%20Python%20software%20development"&gt;Tools for Python software development&lt;/a&gt;&#10;&lt;em&gt;&lt;a href="https://shocksolution.com/2009/02/03/the-python-configparser-a-way-to-read-simple-data-files/" title="Redirecting%20Python%20standard%20output"&gt;Redirecting standard output from Python&lt;/a&gt;&lt;/em&gt; &lt;a href="https://shocksolution.com/2008/08/19/python-threads-are-easy-with-example/" title="Python%20threads%20example"&gt;Python threads example&lt;/a&gt;&lt;/p&gt;</description></item><item><title>My article published in Technologies for Worship Magazine</title><link>https://shocksolution.com/posts/my-article-published-in-technologies-for-worship-magazine/</link><pubDate>Tue, 15 Dec 2009 04:49:09 +0000</pubDate><guid>https://shocksolution.com/posts/my-article-published-in-technologies-for-worship-magazine/</guid><description>&lt;p&gt;Head over to &lt;a href="https://%3Cwww.tfwm.com/1109backlighting%3E" title="Technologies%20for%20Worship%20Magazine"&gt;Technologies for Worship Magazine&lt;/a&gt; and check out my recently-published article about backlighting.  It&amp;rsquo;s my first publication in print (outside of technical journals).  I&amp;rsquo;m looking forward to writing more articles for a general audience!&lt;/p&gt;</description></item><item><title>First impression: ETC Element Console Review</title><link>https://shocksolution.com/posts/first-impression-etc-element-console-review/</link><pubDate>Wed, 09 Dec 2009 04:12:04 +0000</pubDate><guid>https://shocksolution.com/posts/first-impression-etc-element-console-review/</guid><description>&lt;p&gt;We recently got an &lt;a href="http://%3Cwww.etcconnect.com/product.overview.aspx?ID=22010%3E" title="ETC%20Element"&gt;ETC Element&lt;/a&gt; to replace an &lt;a href="http://%3Cwww.etcconnect.com/product.overview.aspx?ID=20012&amp;amp;lang=us&amp;amp;region=1%3E" title="ETC%20Express"&gt;ETC Express&lt;/a&gt; 72/144 that had become unreliable due to a hardware problem.  I&amp;rsquo;d like to point out that ETC equipment is generally very durable, but this particular console only lasted about 8 years due to abuse by the high-school students who use the console during the week.  The Express was a great console.  It had a hardware fader for each of the channels that we commonly used, and a bank of 20 submasters.  Recording a submaster was as simple as creating a look onstage with the channel faders, then pressing &amp;ldquo;Record&amp;rdquo; and hitting the submaster bump button.  It had one external LCD screen for output, which had a very simple character-based interface.  Just about anyone could learn to use the Express. The Element is, in many ways, a much more sophisticated console.  While the Express didn&amp;rsquo;t have any real capability to run moving lights, the Element has many features to facilitate the use of moving lights and programmable LED fixtures.  It supports two external LCD screens with a full graphical interface, a keyboard, and a mouse. Unfortunately, the Element has lost all of the simplicity that made the Express so successful in its target market.  Let&amp;rsquo;s start with the physical design. The greatest disadvantage of the Element, especially for untrained users, is that all of the forty faders (60 in some models) are multi-function.  With the bank switch in position 1, the faders represent channels 1-40.  Position 2 changes the fader function to channels 41-80, and Position 3 changes the faders to channels 81-120.  Position 4 changes the fader function to submasters.  While it&amp;rsquo;s nice to have 40 subs, it&amp;rsquo;s also extremely confusing to figure out which channel fader or submaster is currently controlling the output.  Here&amp;rsquo;s an example. Let&amp;rsquo; s say that you use faders 2, 17, and 31 to set a look on Bank 1.  If you switch to Bank 2, faders 2, 17, and 31 are still up, but they are not controlling anything.  Bring those faders down, and continue setting up the look on channels 41-80 using Bank 2.  Now switch back to Bank 1 to tweak the look on channels 1-40…but the faders are no longer up!  The LEDs on the bump buttons will flash to show which channel levels no longer match the fader positions.  To take control of these channels, bring the fader up until it matches the current channel level.  Then you can control the channel again.  Are you confused yet?  Did I mention that the faders have no numbers?  I find this slows me down when creating a look, and makes it harder to edit a look &amp;ldquo;on the fly.&amp;rdquo;  To top it off, the bank selector is a little plastic twist switch, and it&amp;rsquo;s hard to see which bank it&amp;rsquo;s pointing at. With many consoles, you can work around the limited number of faders by adding an expansion wing with additional controls.  Unfortunately, the Element does not support expansions&amp;ndash;you have to upgrade to the Ion to get that feature!  I&amp;rsquo;m not thrilled with the layout of the keys on the Element keyboard, either.  It&amp;rsquo;s difficult to guess where a key is going to be&amp;ndash;they don&amp;rsquo;t seem to be grouped in any particular way.  Compare to the Hog 1000, in which the keys are grouped as &amp;ldquo;verbs&amp;rdquo; and &amp;ldquo;nouns&amp;rdquo; for command-line programming.  One final gripe about the hardware: it&amp;rsquo;s difficult to run my finger down the row of bump buttons to  find a particular light&amp;ndash;this was easy to do on the old Express. So, after all my complaining, I want to leave you with a great feature.  I love the &amp;ldquo;Exclusive&amp;rdquo; submaster setting that prevents the output from a sub from being recorded in subsequent cues and submasters.  I use this all the time to keep some lights up onstage or in the house without having them recorded into cues.  I&amp;rsquo;m sure there are more little gems built into the Express. Here is my conclusion about the Element: it is NOT a replacement for the Express.  Do not expect this console to be a &amp;ldquo;drop-in&amp;rdquo; replacement for any traditional theater console.  The learning curve will be very steep for brand-new users, and slightly less steep for Express users.  In the end, the Element will be far more capable than the Express&amp;ndash;but that&amp;rsquo;s not the target market for the Express.  If you are buying a console for a school, small church, or community theater where the users are generally inexperienced, there are probably better choices than the Element.&lt;/p&gt;</description></item><item><title>Search</title><link>https://shocksolution.com/posts/search-results/</link><pubDate>Sun, 29 Nov 2009 18:24:50 +0000</pubDate><guid>https://shocksolution.com/posts/search-results/</guid><description/></item><item><title>LDI 2009 Report</title><link>https://shocksolution.com/posts/ldi-2009-report/</link><pubDate>Mon, 23 Nov 2009 03:15:54 +0000</pubDate><guid>https://shocksolution.com/posts/ldi-2009-report/</guid><description>&lt;p&gt;I attended &lt;a href="http://%3Cwww.ldishow.com/LDI09/public/enter.aspx%3E" title="LDI"&gt;LDI&lt;/a&gt; (Live Design International) last Friday in Orlando, FL.  This was my second time at the show (&lt;a href="https://shocksolution.com/2007/11/18/ldi-reportpart-1eye-candy/" title="LDI%202007%20Report"&gt;read my report from 2007&lt;/a&gt;).  Overall, I&amp;rsquo;d say this year&amp;rsquo;s show was scaled back from 2007, which is not surprising considering how the economic recession has affected the entertainment industry.  There were fewer booths this year, and they weren&amp;rsquo;t as fancy.  A few manufacturers, such as Chauvet and Coemar, brought pretty spectacular booths.  Other companies brought large booths (such as ETC and Martin), but they were not as flashy.  I&amp;rsquo;m not sure if Friday is normally a slow day for this conference, but there wasn&amp;rsquo;t much of a crowd.  I didn&amp;rsquo;t have to wait in line to see anything. In 2007, I went to LDI to try out control consoles to replace our Hog 1000.  That plan fell through when the economy tanked, so this year I was just looking around.  Apparently a lot of people were, because the sales people were rather aggressive about jumping onto any apparent interest in their product.  One girl tried to scan my badge as I walked by&amp;ndash;I don&amp;rsquo;t even know what she was selling!  Actually, that&amp;rsquo;s a common occurrence at LDI&amp;ndash;it&amp;rsquo;s hard to tell what the actual product is in the booth.  All the larger booths seemed to consist of truss, truss warmers, banners, drapes, moving lights, and video.  I often had to stop and look for a minute to figure out which one was actually their product! I will post some photos when I get a chance.&lt;/p&gt;</description></item><item><title>Building and linking to a shared Fortran library</title><link>https://shocksolution.com/posts/building-and-linking-to-a-shared-fortran-library/</link><pubDate>Mon, 26 Oct 2009 22:34:02 +0000</pubDate><guid>https://shocksolution.com/posts/building-and-linking-to-a-shared-fortran-library/</guid><description>&lt;p&gt;I&amp;rsquo;m using GNU Fortran (&lt;a href="http://gcc.gnu.org/onlinedocs/gfortran/index.html" title="gFortran"&gt;gfortran&lt;/a&gt;) to build several shared libraries, and then dynamically linking to them from a Fortran program.  The process is a little different than what I&amp;rsquo;m used to for C libraries, so I thought I&amp;rsquo;d explain it.  Unlike C, there is no need to #include header files when compiling code that relies on functions defined in an external library.  Likewise, there is no need to use -l or -L linking flags to tell the linker about s hared libraries (at least when they&amp;rsquo;re in the same directory).  In fact, the whole process requires a lot less command-line options than I had expected.&lt;/p&gt;</description></item><item><title>X.org configuration for a Gentoo guest on VMWare Fusion</title><link>https://shocksolution.com/posts/xorg-configuration-for-a-gentoo-guest-on-vmware-fusion/</link><pubDate>Thu, 22 Oct 2009 03:25:37 +0000</pubDate><guid>https://shocksolution.com/posts/xorg-configuration-for-a-gentoo-guest-on-vmware-fusion/</guid><description>&lt;p&gt;Here is an &lt;a href="https://shocksolution.com/files/xorg.conf" title="xorg.conf for Gentoo guest in VMWare Fusion"&gt;xorg.conf for a Gentoo guest running in VMWare Fusion&lt;/a&gt; on MacOS 10.6 (Snow Leopard).  It&amp;rsquo;s surprisingly simple to set up X when the hardware is fake ;)  Gentoo runs great on a Macbook Pro 13&amp;quot;.  I was concerned at first about the lack of 3D acceleration, but I tried a few 3D applications and found the performance to be acceptable.  &lt;a href="http://%3Cwww.blender.org/%3E" title="Blender"&gt;Blender&lt;/a&gt; ran really smoothly with a simple model (once I found out that command-click is equivalent to middle click).  Rotating a field of several hundred spheres in &lt;a href="http://%3Cwww.paraview.org/%3E" title="Paraview"&gt;Paraview&lt;/a&gt; was a little slow, but still very acceptable. I also bought a Logitech wireless mouse, and found that the middle button works just as you&amp;rsquo;d expect (paste) in Gentoo running in Fusion.  I didn&amp;rsquo;t have to install the Logitech drivers in OS X.&lt;/p&gt;</description></item><item><title>Kernel configuration for a Gentoo guest in VMWare Fusion</title><link>https://shocksolution.com/posts/kernel-configuration-gentoo-guest-vmware-fusion/</link><pubDate>Fri, 09 Oct 2009 22:48:23 +0000</pubDate><guid>https://shocksolution.com/posts/kernel-configuration-gentoo-guest-vmware-fusion/</guid><description>&lt;p&gt;I recently installed Gentoo Linux (amd64) as a guest on my Mac (OS 10.6 Snow Leopard) using VMWare Fusion.  I thought I&amp;rsquo;d post the kernel config that I am using, since I didn&amp;rsquo;t find any out there that I trusted.  If you can use this as a starting point, then it should save you some time and trouble.  It&amp;rsquo;s a pretty minimal configuration&amp;ndash;I think I removed all the extra drivers and stuff.  You could lean it out a little more by removing the audio and a few other extras that I thought I might use.  Let me know if you have any trouble with it. &lt;a href="https://shocksolution.com/files/26Sept2009_Vmware_Gentoo_amd64.config" title="Gentoo amd64 kernel config for VMWare Fusion"&gt;Gentoo amd64 kernel config for VMWare Fusion&lt;/a&gt; So far I am very pleased with its performance.  My only disappointment is that VMWare doesn&amp;rsquo;t support Linux graphics hardware acceleration.&lt;/p&gt;</description></item><item><title>f2py: binding Fortran and Python</title><link>https://shocksolution.com/posts/f2py-binding-fortran-python/</link><pubDate>Wed, 23 Sep 2009 22:56:08 +0000</pubDate><guid>https://shocksolution.com/posts/f2py-binding-fortran-python/</guid><description>&lt;p&gt;I  have recently started using &lt;a href="http://%3C%3Cwww.scipy.org/F2py&amp;amp;gt%3E;" title="F2py"&gt;f2py&lt;/a&gt; to call Fortran from Python.  I have found this useful for two reasons: speeding up Python scripts by calling compiled Fortran code, and using Python as a unit testing framework for Fortran modules.   Unfortunately, the &lt;a href="http://cens.ioc.ee/projects/f2py2e/usersguide/index.html" title="F2py%20docs"&gt;documentation&lt;/a&gt; for f2py is rather sparse, and may not be completely up to date.   In this note, I will hopefully prevent you from wasting a lot of time figuring out how to pass array arguments, and return array results.&lt;/p&gt;</description></item><item><title>Profiling memory usage of Python code</title><link>https://shocksolution.com/posts/profiling-memory-usage-of-python-code/</link><pubDate>Fri, 17 Apr 2009 22:08:52 +0000</pubDate><guid>https://shocksolution.com/posts/profiling-memory-usage-of-python-code/</guid><description>&lt;p&gt;In a previous post, I explained how to use the Python profiler.  The profile is great for finding out which parts of the code run the slowest, or are called most often.  However, the profiler doesn&amp;rsquo;t give any information about how much RAM is being consumed, or where it&amp;rsquo;s being consumed.  If your program needs so much memory that it starts swapping to disk, its speed can be reduced by orders of magnitude.  On the positive side, your code may run much faster if it fits entirely in the processor cache.  In this post, I will introduce two tools that can help you understand the RAM usage of your Python code.&lt;/p&gt;</description></item><item><title>How to make two mice work with xwindows (x.org)</title><link>https://shocksolution.com/posts/how-to-make-two-mice-work-with-xwindows-xorg/</link><pubDate>Sat, 11 Apr 2009 04:01:45 +0000</pubDate><guid>https://shocksolution.com/posts/how-to-make-two-mice-work-with-xwindows-xorg/</guid><description>&lt;p&gt;It&amp;rsquo;s a real pain to surf the Web when the batteries die in your wireless mouse or trackball.  I use some old rechargeables that are no longer fit for digital camera service, so this happens to me fairly often.   My batteries just died again, so I had to figure out how to configure X.org to use a backup mouse.  It&amp;rsquo;s actually not hard to have an old 3-button mouse plugged into the PS/2 port and tell X.org to use it as a backup.  First, define two input devices:&lt;/p&gt;</description></item><item><title>Lookup tables and spline fitting in Python</title><link>https://shocksolution.com/posts/lookup-tables-and-spline-fitting-in-python/</link><pubDate>Wed, 08 Apr 2009 23:36:09 +0000</pubDate><guid>https://shocksolution.com/posts/lookup-tables-and-spline-fitting-in-python/</guid><description>&lt;p&gt;Lookup tables and spline fitting are widely used by scientific programmers.  A particular function may not have an analytic solution&amp;ndash;in other words, it can&amp;rsquo;t be expressed as an equation of elementary functions.  This might happen if the function were empirically determined from experimental data, or if the equation can&amp;rsquo;t be algebraically solved for one variable.  If the analytical function is available, but takes a long time to evaluate, a lookup table or spline approximation can be considerably faster.  In a previous post, I showed how to use the function &lt;a href="https://shocksolution.com/2008/12/11/a-lookup-table-for-fast-python-math/" title="scipy.interpolate.interp1d%20as%20a%20lookup%20table"&gt;interp1d from scipy.interpolate as a lookup table&lt;/a&gt;.  In a later post, I showed that &lt;a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp1d.html#scipy.interpolate.interp1d" title="interp1d%20docs"&gt;interp1d&lt;/a&gt; is actually rather slow, and &lt;a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.UnivariateSpline.html#scipy.interpolate.UnivariateSpline" title="Scipy.interpolate.UnivariateSpline"&gt;scipy.interpolate.UnivariateSpline&lt;/a&gt; is much faster.  Now, I will show some benchmark results, and explain a potential pitfall when using UnivariateSpline. The two functions I will use for this demonstration are not very complicated.  Each function is a piecewise approximation of a more complex function.  Here is one of the functions.  For small z, the function uses one approximation, and for large z, it uses a far-field approximation.  For intermediate values, a polynomial is used to smoothly match the two solutions. &lt;a href="https://%3Cwww.amazon.com/Elegant-SciPy-Art-Scientific-Python/dp/1491922877/ref=as_li_ss_il?keywords=scipy&amp;amp;qid=1537721480&amp;amp;sr=8-2&amp;amp;ref=sr_1_2&amp;amp;linkCode=li2&amp;amp;tag=rootwork0f-20&amp;amp;linkId=b82af06689ab1a386116469d41f270d6&amp;amp;language=en_US%3E"&gt;&lt;img src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;amp;ASIN=1491922877&amp;amp;Format=_SL160_&amp;amp;ID=AsinImage&amp;amp;MarketPlace=US&amp;amp;ServiceVersion=20070822&amp;amp;WS=1&amp;amp;tag=rootwork0f-20&amp;amp;language=en_US" alt="image"&gt;&lt;/a&gt;&lt;img src="https://ir-na.amazon-adsystem.com/e/ir?t=rootwork0f-20&amp;amp;language=en_US&amp;amp;l=li2&amp;amp;o=1&amp;amp;a=1491922877" alt="image"&gt;&lt;a href="https://%3Cwww.amazon.com/Learning-Numerical-Scientific-Computing-Second/dp/1783987707/ref=as_li_ss_il?keywords=scipy&amp;amp;qid=1537721480&amp;amp;sr=8-3&amp;amp;ref=sr_1_3&amp;amp;linkCode=li2&amp;amp;tag=rootwork0f-20&amp;amp;linkId=4f28164dbe2c853ec36f6f35b052e71a&amp;amp;language=en_US%3E"&gt;&lt;img src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;amp;ASIN=1783987707&amp;amp;Format=_SL160_&amp;amp;ID=AsinImage&amp;amp;MarketPlace=US&amp;amp;ServiceVersion=20070822&amp;amp;WS=1&amp;amp;tag=rootwork0f-20&amp;amp;language=en_US" alt="image"&gt;&lt;/a&gt;&lt;img src="https://ir-na.amazon-adsystem.com/e/ir?t=rootwork0f-20&amp;amp;language=en_US&amp;amp;l=li2&amp;amp;o=1&amp;amp;a=1783987707" alt="image"&gt;&lt;a href="https://%3Cwww.amazon.com/SciPy-Recipes-performing-mathematical-computations/dp/1788291468/ref=as_li_ss_il?keywords=scipy&amp;amp;qid=1537721480&amp;amp;sr=8-6&amp;amp;ref=sr_1_6&amp;amp;linkCode=li2&amp;amp;tag=rootwork0f-20&amp;amp;linkId=0f24d2d9680bc94c36ebe6665e04c5e3&amp;amp;language=en_US%3E"&gt;&lt;img src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;amp;ASIN=1788291468&amp;amp;Format=_SL160_&amp;amp;ID=AsinImage&amp;amp;MarketPlace=US&amp;amp;ServiceVersion=20070822&amp;amp;WS=1&amp;amp;tag=rootwork0f-20&amp;amp;language=en_US" alt="image"&gt;&lt;/a&gt;&lt;img src="https://ir-na.amazon-adsystem.com/e/ir?t=rootwork0f-20&amp;amp;language=en_US&amp;amp;l=li2&amp;amp;o=1&amp;amp;a=1788291468" alt="image"&gt;&lt;/p&gt;</description></item><item><title>3D Plotting Software for Python::Part 1::PyX</title><link>https://shocksolution.com/posts/3d-plotting-software-for-python-pyx/</link><pubDate>Fri, 20 Mar 2009 23:08:55 +0000</pubDate><guid>https://shocksolution.com/posts/3d-plotting-software-for-python-pyx/</guid><description>&lt;p&gt;There are lots of good open-source tools that you can use to make high-resolution, publication-quality 2D plots.  Personally, I like to use &lt;a href="http://python.org/" title="Python%20homepage"&gt;Python&lt;/a&gt;, &lt;a href="http://numpy.scipy.org/" title="Numpy%20home%20page"&gt;numpy&lt;/a&gt;, and &lt;a href="http://matplotlib.sourceforge.net/" title="Matplotlib%20home%20page"&gt;matplotlib&lt;/a&gt;.  Unfortunately, it is much harder to find a good tools to make 3D plots.  Older versions of matplotlib had rudimentary 3D support, but this was removed in version 0.98.  In this post, I will review a Python 3D plotting library called &lt;a href="http://pyx.sourceforge.net/" title="PyX%20homepage"&gt;PyX&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="preparing-the-data"&gt;Preparing the data&lt;/h2&gt;&#10;&lt;p&gt;Figuring out how to store the data to be plotted was actually the hardest part of learning to use PyX.  The data format for 3D plots is not well documented.  PyX requires a list of (x,y,z) lists like this:&lt;/p&gt;</description></item><item><title>Pypar Documentation</title><link>https://shocksolution.com/posts/pypar-documentation/</link><pubDate>Sat, 21 Feb 2009 04:08:27 +0000</pubDate><guid>https://shocksolution.com/posts/pypar-documentation/</guid><description>&lt;p&gt;UPDATE 1/2016: It appears that Pypar is no longer maintained, although it probably still works. For new projects, I advise using &lt;a href="http://mpi4py.readthedocs.org/en/stable/"&gt;mpi4py&lt;/a&gt;. The following is an online copy of the documentation of Pypar.  I am not the author of the text below.  I have merely posted it online to make it more accessible to the community.  The latest version of Pypar can be found at: &lt;a href="http://sourceforge.net/projects/pypar" title="Pypar%20on%20Sourceforge"&gt;The Pypar page on Sourceforge&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="pypar---parallel-python-no-frills-mpi-interface"&gt;PyPAR - Parallel Python, no-frills MPI interface&lt;/h2&gt;&#10;&lt;p&gt;Author:  Ole Nielsen (2001, 2002, 2003) Version: See pypar.__version__ Date:    See pypar.__date__&lt;/p&gt;</description></item><item><title>Parallel Programming with Python</title><link>https://shocksolution.com/posts/parallel-programming-with-python/</link><pubDate>Sat, 21 Feb 2009 03:49:01 +0000</pubDate><guid>https://shocksolution.com/posts/parallel-programming-with-python/</guid><description>&lt;h2 id="background"&gt;Background&lt;/h2&gt;&#10;&lt;p&gt;As an interpreted language, Python cannot compete directly with C or Fortran in execution speed.  As I have written elsewhere, there are ways to make Python code run as fast as you need it to run.  However, in scientific computing there is often no single processor that can execute a program in a reasonable amount of time.  Computationally intensive problems require the use of parallel computers.  A message-passing interface such as MPI is used to communicate between processes running on multiple CPUs.  There is a Python interface to MPI called &lt;a href="http://sourceforge.net/projects/pypar" title="Pypar"&gt;Pypar&lt;/a&gt;, which allows your Python programs to run in parallel on a system with an implemention of MPI installed.  My experience is mainly with &lt;a href="http://%3Cwww.open-mpi.org/%3E" title="Open%20MPI"&gt;Open MPI&lt;/a&gt;, but there are several others.  Below are some other resources to learn about about MPI and parallel programming in general. Using MPI with Python works around one of Python&amp;rsquo;s more serious limitations: the Global Interpreter Lock (GIL).  Basically, Python uses the GIL to prevent errors that may occur when two threads try to access the same data.  What this means is that Python can only utilize a single CPU thread.  Note that this is not a fundamental limitation of the &lt;em&gt;language&lt;/em&gt;, but of the standard C implementation of the &lt;em&gt;interpreter&lt;/em&gt;.  New interpreter implementations may be thread-safe, but for now, Python is stuck in a single thread.  The GIL will become more of a problem as ordinary desktop CPU&amp;rsquo;s gain speed by adding cores rather than increasing clock speed.  Rather than exposing my ignorance of Python&amp;rsquo;s internals, here are some links to posts written by people who are more knowledgable about this subject than I am.&lt;/p&gt;</description></item><item><title>Optimizing fast Python math with Numpy and Scipy</title><link>https://shocksolution.com/posts/optimizing-fast-python-math-with-numpy-and-scipy/</link><pubDate>Tue, 10 Feb 2009 21:58:31 +0000</pubDate><guid>https://shocksolution.com/posts/optimizing-fast-python-math-with-numpy-and-scipy/</guid><description>&lt;p&gt;Coming soon!  The work is already done&amp;ndash;I just have to find time to write it up.&lt;/p&gt;&#10;&lt;h2 id="online-documentation-and-resources"&gt;Online Documentation and Resources&lt;/h2&gt;&#10;&lt;p&gt;&lt;em&gt;&lt;a href="http://%3Cwww.mpia.de/homes/tamburro/whatisthepython/weave/weave.html%3E" title="Scipy.weave%20documentation"&gt;scipy.weave documentation&lt;/a&gt;&lt;/em&gt; &lt;a href="http://%3Cwww.scipy.org/PerformancePython%3E" title="Performance%20Python%20documentation"&gt;Performance Python documentation&lt;/a&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="http://%3Cwww.oonumerics.org/blitz/docs/blitz.html%3E" title="Blitz++%20docs"&gt;Blitz++ (array and matrix library for C++) docs&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>The Python configparser: a way to read simple data files</title><link>https://shocksolution.com/posts/the-python-configparser-a-way-to-read-simple-data-files/</link><pubDate>Tue, 03 Feb 2009 23:42:21 +0000</pubDate><guid>https://shocksolution.com/posts/the-python-configparser-a-way-to-read-simple-data-files/</guid><description>&lt;p&gt;My simulation library, which is written mostly in Python, needs a lot of data and parameters in order to run. In some cases, I just hard-code the values in the script that calls the library, and in other cases I &lt;a href="https://shocksolution.com/2008/09/15/python-pickle-painless-binary-storage-for-python-objects/" title="loading%20Python%20pickle%20files"&gt;load a pickle file&lt;/a&gt; containing a Python objext. What if I want to read in data or configuration parameters from a human-editable text file? If the information is extensive or complex, XML might be a good choice, but XML is overkill for simple configuration or data files. Fortunately, a standard Python library called &lt;a href="http://docs.python.org/library/configparser.html" title="ConfigParser%20docs"&gt;ConfigParser&lt;/a&gt; has already defined a configuration file format, and provides methods to interact with such files. Here is a sample of the format used in a config file:&lt;/p&gt;</description></item><item><title>Updated Python class for writing Paraview (VTK) (.vtu) files</title><link>https://shocksolution.com/posts/updated-python-class-for-writing-paraview-vtk-vtu-files/</link><pubDate>Fri, 23 Jan 2009 23:28:05 +0000</pubDate><guid>https://shocksolution.com/posts/updated-python-class-for-writing-paraview-vtk-vtu-files/</guid><description>&lt;p&gt;I have released a new version of my &lt;a href="https://shocksolution.com/microfluidics-and-biotechnology/python-vtk-paraview/" title="Python%20class%20for%20generating%20VTK%20.vtu%20files"&gt;Python class that generates VTK data files in the .vtu format&lt;/a&gt;, which is compatible with Paraview and other VTK applications.  If you have downloaded the old one, please get the latest version, which incorporates some bug fixes and has been more thoroughly tested.&lt;/p&gt;</description></item><item><title>How to put formatted, highlighted code in a Wordpress post</title><link>https://shocksolution.com/posts/how-to-put-formatted-highlighted-code-in-a-wordpress-post/</link><pubDate>Sat, 17 Jan 2009 21:49:36 +0000</pubDate><guid>https://shocksolution.com/posts/how-to-put-formatted-highlighted-code-in-a-wordpress-post/</guid><description>&lt;p&gt;I found two complementary plugins that enable me to put highlighted formatted code in a Wordpress page or post. Here&amp;rsquo;s an example of what they do:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[sourcecode language=&amp;#34;python&amp;#34;]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# Plot flux at continuum boundary&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;pylab.figure()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;pylab.hold(True)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;pylab.plot(nd_times, Jl_BD, &amp;#39;b-&amp;#39;, label=&amp;#34;Flux from BD simulation&amp;#34;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;pylab.plot(nd_times, Jl_BD+Jl_BD_std, &amp;#39;b.&amp;#39;, label=&amp;#34;Flux from BD simulation&amp;#34;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;pylab.plot(nd_times, Jl_BD-Jl_BD_std, &amp;#39;b.&amp;#39;, label=&amp;#34;Flux from BD simulation&amp;#34;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[/sourcecode]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;Test successful! Note that Javascript must be enabled to see the highlighting. Get the plugins here:&lt;/p&gt;</description></item><item><title>Deploying Python applications on Windows</title><link>https://shocksolution.com/posts/deploying-python-applications-on-windows/</link><pubDate>Thu, 15 Jan 2009 16:38:56 +0000</pubDate><guid>https://shocksolution.com/posts/deploying-python-applications-on-windows/</guid><description>&lt;p&gt;Writing applications in Python on a Linux system is almost too easy.  Deploying Python apps on other Linux systems is not hard, because most Linux systems already have Python, with its core libraries and tools, installed.  Most Linux systems also have package managers that make it easy to find and install required components.  But, what happens when your co-workers who use Windows need to use your app?  When you tell them to &amp;ldquo;go to the command line and&amp;hellip;&amp;rdquo; you&amp;rsquo;ve pretty much lost them at &amp;ldquo;command line.&amp;rdquo; How do you package Python in a way that&amp;rsquo;s easy for a Windows user to install? Here is a process that worked for me:&lt;/p&gt;</description></item><item><title>Scipy.integrate ODEPACK import error solved!</title><link>https://shocksolution.com/posts/scipyintegrate-odepack-import-error-solved/</link><pubDate>Wed, 14 Jan 2009 16:46:16 +0000</pubDate><guid>https://shocksolution.com/posts/scipyintegrate-odepack-import-error-solved/</guid><description>&lt;p&gt;I recently found a solution to a problem that had been vexing me for about a year. In order to successfully import anything from scipy.integrate, I had edit the file scipy/integrate/__init__.py and comment out the line&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;from odepack import *&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;If not, I would get various import errors such as&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Traceback (most recent call last):&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; File &amp;#34;&amp;lt;stdin&amp;gt;&amp;#34;, line 1, in &amp;lt;module&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; File &amp;#34;/usr/lib/python2.5/site-packages/scipy/integrate/__init__.py&amp;#34;, line 10,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;in &amp;lt;module&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; from odepack import *&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; File &amp;#34;/usr/lib/python2.5/site-packages/scipy/integrate/odepack.py&amp;#34;, line 7,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;in &amp;lt;module&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; import _odepack&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ImportError: /usr/lib/python2.5/site-packages/scipy/integrate/_odepack.so:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;undefined symbol: daxpy_&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;I found the solution in &lt;a href="http://bugs.gentoo.org/show_bug.cgi?id=251165" title="Gentoo%20bug%20251165"&gt;Gentoo bug 251165&lt;/a&gt;. The problem only occurs when Scipy is built with non-reference versions of BLAS and CBLAS. The solution is to install the reference implementation of BLAS and CBLAS, rebuild Scipy, and then use whichever implementation of BLAS or CBLAS you want. I don&amp;rsquo;t know why this happens, and I don&amp;rsquo;t know if it affects distributions other than Gentoo. By the way, Gentoo has a really useful system tool called &lt;a href="http://%3C%3Cwww.gentoo.org/proj/en/eselect/index.xml&amp;amp;gt%3E;" title="Eselect%20home%20page"&gt;eselect&lt;/a&gt;, which has various modules that are used to choose between different versions or implementations of tools on your system (BLAS, Java virtual machine, kernel sources, OpenGL, etc.)&lt;/p&gt;</description></item><item><title>Optimizing Python code for fast math</title><link>https://shocksolution.com/posts/optimizing-python-code-for-fast-math/</link><pubDate>Fri, 09 Jan 2009 21:14:38 +0000</pubDate><guid>https://shocksolution.com/posts/optimizing-python-code-for-fast-math/</guid><description>&lt;p&gt;I spent some time today profiling a Brownian dynamics simulation written in Python to see how I could make it faster before starting some long runs on a Linux cluster. In the sections below, I have attempted to quantify the speed improvements due to various changes. Keep in mind that the actual speed improvement in your code will vary, depending on where the actual bottlenecks occur. See my post about &lt;a href="https://shocksolution.com/2008/10/24/profiling-python-code/" title="Profiling%20Python%20code"&gt;profiling Python code&lt;/a&gt;. Another caveat: I am running Python 2.4.4 because it&amp;rsquo;s installed on our cluster.&lt;/p&gt;</description></item><item><title>Redirecting standard output from Python: another example</title><link>https://shocksolution.com/posts/redirecting-standard-output-from-python-another-example/</link><pubDate>Wed, 07 Jan 2009 21:54:10 +0000</pubDate><guid>https://shocksolution.com/posts/redirecting-standard-output-from-python-another-example/</guid><description>&lt;p&gt;I wrote a previous post about how to &lt;a href="https://shocksolution.com/2008/08/16/redirecting-text-output-from-python-functions/" title="Redirecting%20Python%20standard%20output"&gt;redirect standard output from a Python script to a GUI window&lt;/a&gt;.  In this post, I will give an even simpler example of to redirect standard output to a log file.  During the early development and debugging of Python programs, I use print statements to keep me informed of what&amp;rsquo;s happening.  However, printing to the terminal is not always practical&amp;ndash;for example, when I run numerical code on a parallel cluster, there is no way to determine which output came from which instance of the program.  Here is a class that you can use to redirect standard output to a log file:&lt;/p&gt;</description></item><item><title>Tools for Python software development</title><link>https://shocksolution.com/posts/tools-for-python-software-development/</link><pubDate>Tue, 06 Jan 2009 18:52:45 +0000</pubDate><guid>https://shocksolution.com/posts/tools-for-python-software-development/</guid><description>&lt;p&gt;I have found a few tools over the years that I find extremely useful for developing software. Python is my language of choice at the moment, but I&amp;rsquo;m sure these tools will be handy for any language.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="http://subversion.tigris.org/" title="Subversion%20home%20page"&gt;Subversion&lt;/a&gt; is an open-source version-control system. Version control was designed to allow multiple programmers to work on the same project at the same time without stepping all over one another. However, even though I am a solo developer, I find version control to be extremely helpful.&#10;&lt;ol&gt;&#10;&lt;li&gt;When I commit changes to the repository, I can document what I&amp;rsquo;ve changed and why. This is a great help when I introduce a bug and have to go back and find it.&lt;/li&gt;&#10;&lt;li&gt;The repository is stored on a remote server that is backed up nightly.&lt;/li&gt;&#10;&lt;li&gt;It&amp;rsquo;s easy to make an &amp;ldquo;unstable&amp;rdquo; branch for implementing new features. When I make changes that don&amp;rsquo;t work, it&amp;rsquo;s easy to revert to a previous version that works.&lt;/li&gt;&#10;&lt;li&gt;It is easy to deploy my code to the Linux cluster and make sure that the cluster is running the latest version of my software.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Go read the documentation on the Subversion web site to find out what it can do for you.&lt;em&gt;&lt;a href="http://rapidsvn.tigris.org/" title="RapidSVN%20home%20page"&gt;RapidSVN&lt;/a&gt; is a GUI client for a Subversion server. By default, Subversion comes with a command-line client that does everything you need. However, sometimes it&amp;rsquo;s easier to stay organized when everything is presented visually. Here is a screenshot of RapidSVN: &lt;figure class="ma0 w-75"&gt;&lt;img src="https://shocksolution.com/images/rapidsvn_screenshot-150x150.png"&#10;&#9;&#9;&#9;alt="RapidSVN screenshot"&gt;&lt;figcaption&gt;&#10;&#9;&#9;&#9;&lt;p&gt;RapidSVN screenshot&lt;/p&gt;</description></item><item><title>A lookup table for fast Python math</title><link>https://shocksolution.com/posts/a-lookup-table-for-fast-python-math/</link><pubDate>Thu, 11 Dec 2008 23:17:06 +0000</pubDate><guid>https://shocksolution.com/posts/a-lookup-table-for-fast-python-math/</guid><description>&lt;p&gt;Numerical programming frequently requires the use of look-up tables. A look-up table is a collection of pre-computed values. When given an &amp;ldquo;x&amp;rdquo; value, the table returns a pre-computed &amp;ldquo;y&amp;rdquo; value. Look-up tables can be used to speed up numerical codes, when it is faster to look up a value in the table than it is to compute the value. They are also used when the data in the table cannot be computed&amp;ndash;for example, experimental data or averaged results from an ensemble of Monte Carlo simulations. Another application is to compute a value when a function cannot be solved algebraically. Assume that you have a formula for a function q(h). You need the value of h for a given value of q, but the formula cannot be algebraically solved to get h(q). Instead, choose a range of h values, compute the function q(h), and store each value in a look-up table. Now you can get h(q) for any value stored in the table. The major limitation of a look-up table is that it cannot return valid results for any value of q which is outside the range of those stored in the table. Depending on its implementation, the table may be able to interpolate to return values between known points.&lt;/p&gt;</description></item><item><title>Update 2: building 64-bit Numpy with Intel compilers and MKL</title><link>https://shocksolution.com/posts/update-2-building-64-bit-numpy-with-intel-compilers-and-mkl/</link><pubDate>Tue, 09 Dec 2008 19:33:12 +0000</pubDate><guid>https://shocksolution.com/posts/update-2-building-64-bit-numpy-with-intel-compilers-and-mkl/</guid><description>&lt;p&gt;NOTE: these instructions are obsolete.  Please see &lt;a href="../../2012/04/building-numpy-on-a-red-hat-cluster-with-intel-mkl/" title="Permanent Link: Building NumPy on a 64-bit Red Hat Cluster with Intel MKL"&gt;Building NumPy on a 64-bit Red Hat Cluster with Intel MKL&lt;/a&gt;. In a previous post I described &lt;a href="https://shocksolution.com/2008/10/17/updated-building-64-bit-numpy-with-intel-compilers-icc/" title="Previous%20update"&gt;how I built Numpy with Intel compilers and the Math Kernel Library on a 64-bit cluster&lt;/a&gt;. Today I upgraded to Numpy-1.2.1 and I made a few improvements to my install process. Please read the previous post, since I will not duplicate some important information, and then read on. This time, I made use of a site.cfg file. Copy the file &lt;strong&gt;site.cfg.example&lt;/strong&gt;to&lt;strong&gt;site.cfg&lt;/strong&gt; and edit. At the end of the file, uncomment the [mkl] section and set the path to your library. Mine looks like:&lt;/p&gt;</description></item><item><title>Calculating the Pair Correlation Function in Python</title><link>https://shocksolution.com/posts/calculating-the-pair-correlation-function-in-python/</link><pubDate>Wed, 26 Nov 2008 23:45:55 +0000</pubDate><guid>https://shocksolution.com/posts/calculating-the-pair-correlation-function-in-python/</guid><description>&lt;p&gt;The pair correlation function, also known as the radial distribution function, is a way to characterize the distribution of particles on a two-dimensional plane or in a three-dimensional space. Please check out Eric Weeks&amp;rsquo; web site for an &lt;a href="http://%3C%3Cwww.physics.emory.edu/~weeks/idl/gofr0.html&amp;amp;gt%3E;" title="Eric%20Weeks%20Pair%20Correlation%20Functions"&gt;introduction to pair correlation functions&lt;/a&gt;. He has written some routines in IDL to compute these functions. Using his foundation, I have written some simple routines in Python to compute 2D and 3D pair correlation functions.&lt;/p&gt;</description></item><item><title>Visualizing trajectories with Python, VMD, and .vtf files</title><link>https://shocksolution.com/posts/visualizing-trajectories-with-python-vmd-and-vtf-files/</link><pubDate>Wed, 26 Nov 2008 19:48:01 +0000</pubDate><guid>https://shocksolution.com/posts/visualizing-trajectories-with-python-vmd-and-vtf-files/</guid><description>&lt;p&gt;As a computational scientist who develops &lt;a href="http://en.wikipedia.org/wiki/Brownian_dynamics" title="Brownian%20Dynamics%20on%20Wikipedia"&gt;Brownian Dynamics&lt;/a&gt; (BD) simulations, I have had a difficult time finding software to visualize trajectories from my simulations.  There are a lot of software tools for molecular visualization, but the majority of these tools are designed to view &amp;ldquo;static&amp;rdquo; molecules that do not change over time.  For storing the output of &lt;a href="http://en.wikipedia.org/wiki/Molecular_dynamics" title="Molecular%20Dynamics%20on%20Wikipedia"&gt;molecular dynamics&lt;/a&gt; (MD) simulations, this is logical, since the simulations often run for millions of time steps and it would be impractical to store (and view) all of them.  The user is often interested only in finding the lowest-energy configuration, so all the earlier steps can be discarded.  While this is also somewhat true for BD simulations, for debugging purposes it is helpful to visualize the trajectory of the particles.&lt;/p&gt;</description></item><item><title>Generating VTK files with Python</title><link>https://shocksolution.com/posts/python-vtk-paraview/</link><pubDate>Thu, 20 Nov 2008 23:39:54 +0000</pubDate><guid>https://shocksolution.com/posts/python-vtk-paraview/</guid><description>&lt;p&gt;&lt;a href="http://%3C%3Cwww.paraview.org/&amp;amp;gt%3E;" title="Paraview%20home%20page"&gt;Paraview&lt;/a&gt; is an industrial-strength, open-source 3D visualization program designed to visualize large data sets created by computational fluid dynamics (CFD) simulations. Although its native data file format (.vtu) is designed for reading in point- and cell-based data from CFD simulations, I have successfully used it to read in and visualized discrete particle data from a Brownian Dynamics (BD) simulation. Below, you can download a Python class that is useful for visualizing particles in motion. It should be easily adaptable to any type of discrete data set that involves discrete objects, vectors, and/or scalars.  In addition, this class should be useful with any application based on the &lt;a href="http://%3C%3Cwww.vtk.org/&amp;amp;gt%3E;" title="VTK%20Toolkit"&gt;VTK toolkit&lt;/a&gt; because they also read .vtu files.&lt;/p&gt;</description></item><item><title>Numerical software and examples</title><link>https://shocksolution.com/posts/numerical-software-and-examples/</link><pubDate>Mon, 17 Nov 2008 19:49:59 +0000</pubDate><guid>https://shocksolution.com/posts/numerical-software-and-examples/</guid><description>&lt;p&gt;Here is a brief index to some of the more useful things I have created or modified.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;&lt;a href="../../math_tools/lapack.html"&gt;Compiling LAPACK with the Intel Fortran Compiler&lt;/a&gt;&lt;/em&gt; &lt;a href="../../math_tools/odepack/index.html"&gt;ODEPACK: a library for numerically solving a system of ordinary differential equations&lt;/a&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="../../math_tools/boost.python/index.html"&gt;Boost.Python Examples and Tutorials&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>Scientific Computing</title><link>https://shocksolution.com/posts/microfluidics-and-biotechnology/</link><pubDate>Mon, 17 Nov 2008 04:03:51 +0000</pubDate><guid>https://shocksolution.com/posts/microfluidics-and-biotechnology/</guid><description>&lt;p&gt;My PhD research is to develop tools that predict the interaction of proteins with engineered surfaces. This work has applications in the development of biomedical devices (such as neural implants and point-of-care diagnostics), biosensors, and hybrid neural systems.&lt;/p&gt;&#10;&lt;h2 id="my-pages-about-scientific-computing"&gt;My pages about scientific computing&lt;/h2&gt;&#10;&lt;p&gt;&lt;em&gt;Optimizing fast Python math with Numpy and Scipy (coming soon!)&lt;/em&gt; &lt;a href="https://shocksolution.com/microfluidics-and-biotechnology/python-vtk-paraview/" title="Calculating%20the%20pair%20correlation%20(radial%20distribution) function in Python"&gt;Calculating the pair correlation function with Python&lt;/a&gt;&#10;&lt;em&gt;&lt;a href="../../microfluidics-and-biotechnology/python-vtk-paraview/" title="Generating VTK files with Python for Paraview"&gt;Generating VTK files with Python for visualization in Paraview&lt;/a&gt;&lt;/em&gt; &lt;a href="../../microfluidics-and-biotechnology/visualizing-trajectories-with-python-vmd-and-vtf-files/" title="Visualizing trajectories with Python, VMD, and .vtf files"&gt;Visualizing trajectories with Python, VMD, and .vtf files&lt;/a&gt;&#10;&lt;em&gt;&lt;a href="../../math_tools/lapack.html"&gt;Compiling LAPACK with the Intel Fortran Compiler&lt;/a&gt;&lt;/em&gt; &lt;a href="../../math_tools/odepack/index.html"&gt;ODEPACK: a library for numerically solving a system of ordinary differential equations&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Simulation</title><link>https://shocksolution.com/posts/military-and-training-simulations/</link><pubDate>Mon, 17 Nov 2008 04:01:17 +0000</pubDate><guid>https://shocksolution.com/posts/military-and-training-simulations/</guid><description>&lt;p&gt;Most of my work has been focused on developing simulations for use in research and development. However, I have worked on several projects with applications in military simulation and civilian training.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;&lt;a href="https://%3Cwww.researchgate.net/publication/228904002_Creating_a_World_War_II_Combat_Simulator_Using_OneSAF_Objective_System%3E"&gt;A WWII Simulation Using OneSAF Objective Framework&lt;/a&gt;&lt;/em&gt; Custom scenery development for a pilot training scenario&lt;/p&gt;</description></item><item><title>Open-source tool chain</title><link>https://shocksolution.com/posts/open-source-tool-chain/</link><pubDate>Mon, 17 Nov 2008 02:58:22 +0000</pubDate><guid>https://shocksolution.com/posts/open-source-tool-chain/</guid><description>&lt;p&gt;I use open-source software whenever possible. Although there are cases where a proprietary tool is the right choice, open-source tools have many advantages.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;Complete control of your critical tools&amp;ndash;the vendor will never stop supporting your platform, an upgrade will never be forced upon you, and the licensing fee will never increase.&lt;/em&gt; Open-source tools tend to utilize open standards and exchange data much more fluidly than proprietary tools.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;If necessary, your developers can fix a bug themselves. A bug might be critical to your application, but that doesn&amp;rsquo;t mean it&amp;rsquo;s a high priority for the application vendor.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="open-source-tools"&gt;Open-Source Tools&lt;/h2&gt;&#10;&lt;p&gt;&lt;em&gt;Programming&lt;/em&gt; Python for rapid application development&#10;&lt;em&gt;Numpy and Scipy for scientific omputing&lt;/em&gt; C, C++ and Fortran for optimized code&#10;&lt;em&gt;Parallel Computing&lt;/em&gt; MPI&#10;&lt;em&gt;PETSC&lt;/em&gt; &lt;a href="https://shocksolution.com/microfluidics-and-biotechnology/parallel-programming-with-python/pypar-documentation/" title="Pypar%20Documentation"&gt;pypar&lt;/a&gt; and mpi4py (Python bindings for MPI)&#10;&lt;em&gt;CUDA and PyCUDA for massively parallel execution on NVIDIA graphics processors (GPUs)&lt;/em&gt; Simulation&#10;&lt;em&gt;OpenFOAM: Computational Fluid Dynamics&lt;/em&gt; libmesh: finite element library&#10;&lt;em&gt;Visualization&lt;/em&gt; Matplotlib (2D plotting)&#10;&lt;em&gt;VTK (3D visualization)&lt;/em&gt; Paraview (3D visualization)&#10;&lt;em&gt;VMD (Molecular dynamics visualization)&lt;/em&gt; Documentation&#10;&lt;em&gt;LyX&lt;/em&gt; LaTeX&#10;&lt;em&gt;Asymptote (technical vector graphics)&lt;/em&gt; Office and OpenOffice&#10;&lt;em&gt;Version control&lt;/em&gt; Subversion&#10;&lt;em&gt;Git&lt;/em&gt; OpenFOAM&lt;/p&gt;</description></item><item><title>Using Python to generate XML files for visualization in Paraview</title><link>https://shocksolution.com/posts/using-python-to-generate-xml-files-for-visualization-in-paraview/</link><pubDate>Thu, 13 Nov 2008 19:00:23 +0000</pubDate><guid>https://shocksolution.com/posts/using-python-to-generate-xml-files-for-visualization-in-paraview/</guid><description>&lt;p&gt;&lt;a href="http://%3Cwww.vtk.org/%3E" title="VTK%20homepage"&gt;VTK&lt;/a&gt; is an open-source software system for &amp;ldquo;3D computer graphics, image processing, and visualization&amp;rdquo; developed by by Kitware. VTK is the foundation of &lt;a href="http://%3Cwww.paraview.org/%3E" title="Paraview%20homepage"&gt;Paraview,&lt;/a&gt; an industrial-strength CFD visualization tool that I have found to be very useful. I generate &amp;ldquo;second generation&amp;rdquo; XML-based files from my Python code and import them into Paraview for visualization. I am in the process of creating some Python classes to do, and I hope to publish them soon. Until then, I want to share some useful resources. The &lt;a href="http://%3Cwww.vtk.org/pdf/file-formats.pdf%3E" title="VTK%20File%20Formats"&gt;VTK file formats are specified in this document&lt;/a&gt;. It&amp;rsquo;s a pretty good specification, but it lacks some examples. Soon I will post an example of a valid unstructured, serial .vtu file. Each VTK file includes data from only one time step, so you have to keep track of time yourself (the filename is an easy solution). Paraview can read in data from multiple time steps, but you have to specify them in a .pvd file. This is also an XML file, with the following format: (&lt;a href="http://%3Cwww.cmake.org/pipermail/paraview/2008-August/009062.html%3E" title="Cmake%20discussion%20t%20hread"&gt;reference&lt;/a&gt;)&lt;/p&gt;</description></item><item><title>Unexpected integer/float math behavior in Python</title><link>https://shocksolution.com/posts/unexpected-integerfloat-math-behavior-in-python/</link><pubDate>Fri, 07 Nov 2008 00:21:16 +0000</pubDate><guid>https://shocksolution.com/posts/unexpected-integerfloat-math-behavior-in-python/</guid><description>&lt;p&gt;I wasted some time today tracking down a bug in one of my programs.  It turned out to be &amp;ldquo;unexpected behavior&amp;rdquo; rather than a bug.  I was aware of this aspect of the language, but I made an assumption and got bit.  Read on for a valuable lesson. Python handles integer math differently than floating point math.  If you type a number without a decimal point, Python treats it as an integer.  &lt;strong&gt;All math performed only with integers results in integers.&lt;strong&gt;For example, 1/2 evaluates to 0 while 1./2. evaluates to 0.5.  If you mix integers and floats, Python will  produce a floating point result (1/2.=0.5), but you must be very careful.  For example, you might expect the expression 4/3*3.14159 to yield a floating point result.  It does yield a floating point number, but&lt;/strong&gt;not&lt;/strong&gt;the one you were expecting!  4/3*3.14159 yields 3.14159.  What happened?  Python works from left to right.  4/3 evaluates to the integer &amp;ldquo;1&amp;rdquo;.  1*3.14159 evaluates to  3.14159.  For comparison, 4./3.*3.14159 evaluates to 4.1887866.  Here&amp;rsquo;s the problem with this particular aspect of Python: according to the rules of math, 4/3*3.14159 is exactly the same expression as 4*3.14159/3, but in Python they yield different results if you forget the decimal points!  4*3.14159 evaluates to a floating point, so (4*3.14159)/3 yields the &amp;ldquo;correct&amp;rdquo; floating point value. Lesson Learned: be explicit about specifying&lt;strong&gt;all&lt;/strong&gt; floats if you are doing floating-point math!  Sometimes I get lazy and leave a trailing decimal point off of a number when doing a floating point calculation, knowing that the results are &amp;ldquo;upcast&amp;rdquo; into floats. Not any more! Note: this unexpected behavior &lt;a href="http://docs.python.org/dev/3.0/whatsnew/3.0.html#common-stumbling-blocks" title="Python%203.0%20Changes"&gt;goes away in Python 3.0&lt;/a&gt;&lt;/p&gt;</description></item><item><title>What is a shock solution?</title><link>https://shocksolution.com/posts/shock_solution/</link><pubDate>Fri, 31 Oct 2008 22:22:11 +0000</pubDate><guid>https://shocksolution.com/posts/shock_solution/</guid><description>&lt;h2 id="definition-of-a-shock-solution"&gt;Definition of a shock solution&lt;/h2&gt;&#10;&lt;p&gt;Definition: &amp;ldquo;shock solution&amp;rdquo; is an informal mathematical term used to describe a type of weak solution in the field of partial differential equations. When a nonlinear or quasilinear equation does not have a strict solution, a weak solution may be found that allows useful information to be obtained even though a strict solution cannot be obtained. Reference: J. Kevorkian, Partial Differential Equations, Springer-Verlag, 2000.&lt;/p&gt;&#10;&lt;h2 id="why-did-i-choose-the-domain-shocksolutioncom"&gt;Why did I choose the domain shocksolution.com?&lt;/h2&gt;&#10;&lt;p&gt;The shock solution is a clever method of obtaining useful information from a problem that could be considered unsolvable. It is a reminder that even the most complex and difficult problem can be analyzed and understood using the correct tools. My objective is to develop these tools so that better decisions can be made when dealing with the complex problems found in the world.&lt;/p&gt;</description></item><item><title>Profiling Python code</title><link>https://shocksolution.com/posts/profiling-python-code/</link><pubDate>Fri, 24 Oct 2008 21:37:24 +0000</pubDate><guid>https://shocksolution.com/posts/profiling-python-code/</guid><description>&lt;p&gt;&amp;ldquo;Speed&amp;rdquo; is a complicated term when used in the context of software.  Does it mean raw speed of execution, or reducing the amount of time until a correct result is obtained?  Python is not the first language that comes to mind when people think of &amp;ldquo;fast software.&amp;rdquo;  It is true that pure Python will usually not execute as quickly as the same algorithm directly coded in C or Fortran.  However, when you define speed as &amp;ldquo;least amount of time until you get the right answer,&amp;rdquo; then Python is pretty fast.  It is so easy to develop correct code in Python, when compared to low-level compiled languages, that Python is often the fastet route to a correct answer, even if the execution time is longer.  Having said that, there &lt;strong&gt;are&lt;/strong&gt;times when code has to execute quickly, and that&amp;rsquo;s why I will introduce you to profiling Python code. Like all things Python, profiling is easier than you think.  Python 2.4 has the &lt;a href="http://%3C%3Cwww.python.org/doc/2.4/lib/profile.html&amp;amp;gt%3E;" title="Python%202.4%20profiler"&gt;profile module&lt;/a&gt;, and Python 2.5 has both &lt;a href="http://%3C%3Cwww.python.org/doc/2.5.2/lib/profile.html&amp;amp;gt%3E;" title="Python%202.5%20profilers"&gt;profile and cProfile&lt;/a&gt;.  cProfile is written in C for lower overhead, and it&amp;rsquo;s the recommended version.  I am stuck with profile, because the cluster that I am working with still uses Python 2.4.  You can read the docs for more details, but I will quickly outline what I find to be the most helpful usage.  For example, say I want to profile the file&lt;strong&gt;run_sim.py&lt;/strong&gt;.  I use the following command line:&lt;/p&gt;</description></item><item><title>Updated: building 64-bit Numpy with Intel compilers (icc)</title><link>https://shocksolution.com/posts/updated-building-64-bit-numpy-with-intel-compilers-icc/</link><pubDate>Fri, 17 Oct 2008 19:36:38 +0000</pubDate><guid>https://shocksolution.com/posts/updated-building-64-bit-numpy-with-intel-compilers-icc/</guid><description>&lt;p&gt;I had to re-build Numpy because our cluster was upgraded and the Intel compilers and libraries were moved to a different directory.  This turned out to be a half-day affair of trial-and-error.  I learned a few important things, which I will try to list here:&lt;/p&gt;&#10;&lt;p&gt;*Delete the numpy-1.0.4/build directory after every build attempt.  Doing &amp;ldquo;python setup.py clean&amp;rdquo; is&lt;strong&gt;not&lt;/strong&gt;effective.  I kept getting errors about undefined symbols when I tried to &amp;ldquo;import numpy&amp;rdquo; on the Python command line.  It was looking for symbols in the old locations, even though I had just rebuilt the code using the new library locations.  It turned out that I needed to delete the build directory in order to force a complete bottom-up rebuild.*The use of &amp;ldquo;setup.py&amp;rdquo; from distutils is not well documented online.  The best thing to do is run &amp;ldquo;python setup.py &amp;ndash;help-commands&amp;rdquo; to get a list of available commands.  Then run &amp;ldquo;python setup.py &amp;lt;cmd&amp;gt; &amp;ndash;help&amp;rdquo; to get help for that specific command.  You can string commands together on the command line, as I will show in the example below.&lt;em&gt;When you test the new numpy, make sure you are&lt;strong&gt;not&lt;/strong&gt;in the numpy-1.0.4 directory!  If you are in the numpy source directory, when you import numpy, you will get the message &amp;ldquo;Running from numpy source directory.&amp;rdquo; and you will not be able to load any symbols from numpy.&lt;/em&gt; On 64-bit architectures, you need to compile position-independent library code.  For some reason, distutils does not do this automatically, and the compilation will fail with an error similar to the following:&lt;/p&gt;</description></item><item><title>Even faster collision detection in Python using Numpy</title><link>https://shocksolution.com/posts/even-faster-collision-detection-in-python-using-numpy/</link><pubDate>Thu, 16 Oct 2008 19:44:15 +0000</pubDate><guid>https://shocksolution.com/posts/even-faster-collision-detection-in-python-using-numpy/</guid><description>&lt;p&gt;Last night, in the shower, I realized that my collision detection routine could be even faster. Here is a representative snippet of code from my previous post:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;&#10; &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; d2 = (x-self.x[0:i])*(x-self.x[0:i]) + (y-self.y[0:i])*(y-self.y[0:i]) + (z-self.z[0:i])*(z-self.z[0:i])&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/div&gt;&lt;p&gt;For some reason, I used the code (x-self.x)*(x-self.x) instead of (x-self.x)**2. Upon further reflection, I realized that (x-self.x)*(x-self.x) computes the difference between array elements twice, and then multiplies the results. Using a &amp;ldquo;power function&amp;rdquo; should enable the interpreter to compute the difference only once, and then multiply each element times itself. Here is the updated code, using Python&amp;rsquo;s power operator:&lt;/p&gt;</description></item><item><title>Haze damages LCD projectors</title><link>https://shocksolution.com/posts/haze-damages-lcd-projectors/</link><pubDate>Tue, 14 Oct 2008 17:24:28 +0000</pubDate><guid>https://shocksolution.com/posts/haze-damages-lcd-projectors/</guid><description>&lt;p&gt;We recently learned the hard way that the use of haze can lead to reliability problems for some LCD projectors. We have two rather large LCD projectors (don&amp;rsquo;t know the specs offhand) permanently mounted to the ceiling, projecting onto the front of screens located on both sides of the stage.  A third LCD projector hits a large rear-projection screen that basically forms the back wall of the stage.  We also have an oil-based hazer mounted above the stage.  We had some old, tired projectors, so we assumed that they were just old and unreliable.  However, after replacing them with new, more powerful models, the reliability issues continued.  After sending the new projectors out for service for the second time in less than a year, the service center informed us that a film of oil had been deposited on the LCD.  You can buy expensive sealed-optics projectors, which should work reliably in dirty environments, but we saved money and bought standard models.  We don&amp;rsquo;t have the budget to replace the &amp;ldquo;new&amp;rdquo; projectors, so we&amp;rsquo;ve had to stop using haze altogether.  The stage doesn&amp;rsquo;t look nearly as good without it, and our moving lights are much less useful. On a side note: you should be aware that haze can also damage moving light fixtures that use a fan to cool the power supply or motors.  The fan sucks in haze and coats the internal components with a film of oil.  Eventually, something overheats and the fixture can actually catch fire.  Fortunately, we have older High End Studiospots and Trackspots that apparently don&amp;rsquo;t use forced-air cooling, so apparently the haze doesn&amp;rsquo;t really get inside.  Be warned!&lt;/p&gt;</description></item><item><title>Speeding up Python math with Numpy: collision detection example</title><link>https://shocksolution.com/posts/speeding-up-python-math-with-numpy-collision-detection-example/</link><pubDate>Sun, 12 Oct 2008 18:10:20 +0000</pubDate><guid>https://shocksolution.com/posts/speeding-up-python-math-with-numpy-collision-detection-example/</guid><description>&lt;p&gt;Python is a very-high-level language.  That makes it easy to write code quickly, but the program may not be as fast as a program compiled from a lower-level language.  For this reason, many scientific programs are written in Fortran or C++.  However, it has always been my experience that the majority of time on a project is spent in writing, modifiying, and debugging code, rather than executing.  Fortunately, if written correctly, the time-critical parts of Python code can execute almost as fast as compiled software.  Here is an example of a collision-detection algorithm which achieved almost a ten-fold increase in speed when written to use &lt;a href="http://numpy.scipy.org/" title="Numpy%20homepage"&gt;Numpy&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>The price of cheap Chauvet LED fixtures</title><link>https://shocksolution.com/posts/the-price-of-cheap-chauvet-led-fixtures/</link><pubDate>Thu, 09 Oct 2008 02:34:49 +0000</pubDate><guid>https://shocksolution.com/posts/the-price-of-cheap-chauvet-led-fixtures/</guid><description>&lt;p&gt;In my previous post about cheap LED fixtures, I didn&amp;rsquo;t mention our &lt;a href="http://%3Cwww.chauvetlighting.com/fixtures/qwashled_fix.shtml%3E" title="Chauvet%20Q-Wash"&gt;Chauvet Q-Wash&lt;/a&gt; intelligent moving light LED fixtures. We bought four at a very discounted price to supplement our conventional movers. They weren&amp;rsquo;t bright enough to stand out in the stage wash, but they made nice little beams in the haze, and they could be used to &amp;ldquo;fill in&amp;rdquo; small dark spots on the stage or set pieces. As wash lights, they lack gobos or beam control, but they do have smooth color RGB mixing (most &amp;ldquo;real&amp;rdquo; wash lights do have some kind of beam width control). So far, you might be thinking that you should pick up a couple, so I should tell you now that they all stopped working within a year or so of installation. One died within a month or two, and after about six months of operation, we lost one every couple of months until they were all gone. The problem wasn&amp;rsquo;t the LEDs&amp;ndash;it was the motors or control circuitry. We were using haze, which is known to shorten the lifespan of moving lights, but that&amp;rsquo;s the standard operating environment for concert lights! The fixtures were also permanently mounted above our stage, so they weren&amp;rsquo;t damaged during handling. They just quietly died on their own&amp;ndash;well, except for the one that went insane and just started moving around on its own until we got up in the lift and unplugged it! Fortunately this didn&amp;rsquo;t happen during a performance, as the motors got very hot and might have started smoking or something. The moral of the story is that a low initial price doesn&amp;rsquo;t always save you money in the long run.&lt;/p&gt;</description></item><item><title>Installing numpy with the Intel Math Kernel Library (mkl)</title><link>https://shocksolution.com/posts/installing-numpy-with-the-intel-math-kernel-library-mkl/</link><pubDate>Fri, 19 Sep 2008 21:24:58 +0000</pubDate><guid>https://shocksolution.com/posts/installing-numpy-with-the-intel-math-kernel-library-mkl/</guid><description>&lt;p&gt;Today I installed numpy on a cluster. Normally, as a Gentoo admin, I just install things with emerge, and all the details are taken care of automagically. However, this cluster runs Red Hat Enterprise, and I don&amp;rsquo;t have admin privileges, so I had to install numpy in my home directory. I installed 1.0.4, to match the version used on another system. You may not need to do this for more recent versions of numpy, which may have an improved setup script. The overall process is:&lt;/p&gt;</description></item><item><title>Python Pickle: Painless binary storage for Python objects</title><link>https://shocksolution.com/posts/python-pickle-painless-binary-storage-for-python-objects/</link><pubDate>Mon, 15 Sep 2008 22:23:18 +0000</pubDate><guid>https://shocksolution.com/posts/python-pickle-painless-binary-storage-for-python-objects/</guid><description>&lt;p&gt;The &lt;a href="http://docs.python.org/lib/module-pickle.html"&gt;pickle&lt;/a&gt; module provided with Python is so useful that I&amp;rsquo;m surprised I haven&amp;rsquo;t used it before. Pickle allows you to save an entire data structure (such as an object) to disk as a binary file in a effortless (and fairly efficient) manner. For example, in my latest project I have created a Monte Carlo simulation that can take quite a bit of time to run. I also need to make multiple runs to get statistics on the results. At the end of each run, I need to dump the resulting data to disk so that it can be read in later by an analysis program. If I had to write data in a format that could be interchanged with other scientific software, I&amp;rsquo;d use the &lt;a href="http://hdf.ncsa.uiuc.edu/HDF5/"&gt;hdf5&lt;/a&gt; format with the &lt;a href="http://%3C%3Cwww.pytables.org/moin&amp;amp;gt%3E;"&gt;pytables&lt;/a&gt; package. However, right now I just need to get something working, and the pickle module is perfect. Here is how I save an object called box:&lt;/p&gt;</description></item><item><title>My first Spore creation</title><link>https://shocksolution.com/posts/my-first-spore-creation/</link><pubDate>Tue, 09 Sep 2008 02:10:22 +0000</pubDate><guid>https://shocksolution.com/posts/my-first-spore-creation/</guid><description>&lt;p&gt;&lt;a href="http://%3Cwww.spore.com/flash/dsDemo/sporeds_widget.swf%3E"&gt;&lt;a href="http://www.spore.com/flash/dsDemo/sporeds_widget.swf"&gt;http://www.spore.com/flash/dsDemo/sporeds_widget.swf&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Python threads are easy (with example)</title><link>https://shocksolution.com/posts/python-threads-are-easy-with-example/</link><pubDate>Tue, 19 Aug 2008 22:50:07 +0000</pubDate><guid>https://shocksolution.com/posts/python-threads-are-easy-with-example/</guid><description>&lt;p&gt;It&amp;rsquo;s remarkably easy to spawn a Python thread.  However, before doing so, I caution you that a Python thread is not the same thing as an OS thread.  Python threads run within the Python interpreter, but the Python interpreter always executes in a single process.  The reasons why have already been explained elsewhere, so I refer you to the &lt;a href="http://docs.python.org/api/threads.html" title="thread%20module%20docs"&gt;thread module documentation&lt;/a&gt; to learn about the Global Interpreter Lock.  You probably have objections to this state of affairs, and I assure you they have already been &lt;a href="http://blog.snaplogic.org/?p=94" title="Objections%20to%20the%20Global%20Interpreter%20Lock"&gt;voiced&lt;/a&gt; by Juergen Brendel and &lt;a href="http://%3C%3Cwww.artima.com/weblogs/viewpost.jsp?thread=214235&amp;amp;gt%3E;" title="Guido%20van%20Rossum's%20response"&gt;responded to&lt;/a&gt; by Guido van Rossum (creator of Python).  Anyway, the upshot is that Python can only utilize one core of a multi-core CPU.  This isn&amp;rsquo;t such a big deal for me because I&amp;rsquo;m a scientific programmer, and if I really need to write parallel code it&amp;rsquo;s going to have to run on a cluster or a grid.  Threads don&amp;rsquo;t help with that. Having said all that, threads in Python are still useful.  I will detail one example in which I spawn a thread to load a large binary file.  While this doesn&amp;rsquo;t spread the work across multiple CPU cores, it does enable the GUI to remain interactive while the file loads. All you have to do to create a Python thread is create a class that is derived from Thread. In the example below, I derived a class called Loader, which &amp;ldquo;wraps&amp;rdquo; the function that actually reads the binary files. The __init__ method accepts the filename and other options as arguments. The run() method is required. Don&amp;rsquo;t call run() directly&amp;ndash;instead, call the start() method (inherited from the base class) to start the thread.&lt;/p&gt;</description></item><item><title>Redirecting text output from Python functions</title><link>https://shocksolution.com/posts/redirecting-text-output-from-python-functions/</link><pubDate>Sat, 16 Aug 2008 20:47:05 +0000</pubDate><guid>https://shocksolution.com/posts/redirecting-text-output-from-python-functions/</guid><description>&lt;p&gt;Two posts ago, I described how I wrote a function in Python that reads in a binary file from Labview. In my last post, I described using wxPython to write a GUI to process the data from those binary files. Naturally, I called the binary-file-reader function from the GUI. The problem is that the file reader prints a lot of information to the terminal, using Python &lt;strong&gt;print&lt;/strong&gt;statements. None of this goes to the GUI, requiring the user to run the GUI from a terminal and keep an eye on the text output, which is inconvenient. However, I don&amp;rsquo;t want to modify the file reader to include GUI-specific code, because that would be less modular and less re-usable. Instead, I learned that Python has a very easy facility to redirect&lt;strong&gt;stdout&lt;/strong&gt;, the default destination of the &lt;strong&gt;print&lt;/strong&gt; statement. I modified the file reader as follows:&lt;/p&gt;</description></item><item><title>Fun with threads in Python and wxPython</title><link>https://shocksolution.com/posts/fun-with-threads-in-python-and-wxpython/</link><pubDate>Mon, 11 Aug 2008 22:12:07 +0000</pubDate><guid>https://shocksolution.com/posts/fun-with-threads-in-python-and-wxpython/</guid><description>&lt;p&gt;I have finally gotten back to programming in the last couple of days.  Our project has finally started to generate a lot of data, so I&amp;rsquo;ve been refactoring and improving my code that &lt;a href="https://shocksolution.com/blog/2008/06/25/reading-labview-binary-files-with-python/" title="Reading%20Labview%20binaries%20with%20Python"&gt;reads data stored in LabView binaries&lt;/a&gt;.  Today I spent a lot of time creating a GUI for browsing data.  Arguably, this wasn&amp;rsquo;t the best use of my time, but I learned a lot about multi-threaded Python GUI programming with wxPython.  You can find a gold mine of &lt;a href="http://wiki.wxpython.org/LongRunningTasks" title="Multi-threading%20with%20wxpython"&gt;information on the multi-threaded wx programming&lt;/a&gt; at the wxPython wiki.  Because the LabView binary data has to be read sequentially, and the files are rather large, it takes a long time to read in a file.  I spawn a thread to handle the file reading,  while allowing the GUI to remain responsive.  The thread posts messages to the GUI window, which are used to update the user on the status of the file reading operation.  When the file is read, a final message containing the data is posted to the window.  It&amp;rsquo;s really pretty slick now that I&amp;rsquo;ve figured out how to do it. I will soon post a clever scheme to capture text output from the file-reading function, and display it in the GUI, without making substantial changes to the file-reading function.&lt;/p&gt;</description></item><item><title>Reading Labview binary files with Python</title><link>https://shocksolution.com/posts/reading-labview-binary-files-with-python/</link><pubDate>Wed, 25 Jun 2008 16:04:46 +0000</pubDate><guid>https://shocksolution.com/posts/reading-labview-binary-files-with-python/</guid><description>&lt;p&gt;My research group uses Labview 7.1 to write custom data acquisition (DAQ) software. I code everything else in Python, so I need to get data from Labview into Python for processing. Our DAQ program produces Labview binary files, so I had to find a way to read them with Python. Binary files are nice because they are a compact way to store numerical data as compared to ASCI or (heaven forbid) XML, but they are much harder to read. The binary format used by Labview is documented only indirectly, so I had to hack a little. The first thing to realize is that the Labview binary file is a direct dump of the data that was stored in RAM. &lt;a href="http://zone.ni.com/reference/en-XX/help/371361A-01/lvconcepts/how_labview_stores_data_in_memory/" title="How%20Labview%20stores%20data%20in%20RAM"&gt;How Labview stores data in memory is documented here.&lt;/a&gt; Indirectly, this documents how binary files are stored on disk. Our DAQ program writes a rather complex &amp;ldquo;cluster&amp;rdquo; (Labview&amp;rsquo;s version of a C structure) to disk. The elements of the cluster are stored contiguously as a sequence of bytes, and there&amp;rsquo;s no way to know which byte goes with which element, unless you know the size of each element and the order in which they are stored in the cluster. So, the first step is to document the cluster that&amp;rsquo;s being written to disk. You can use the context help in Labview to view the data type of the wire that leads to the VI that writes the file. With this in hand, you are ready to write Python code. First, make sure you open the file in binary mode:&lt;/p&gt;</description></item><item><title>Server move completed and general update</title><link>https://shocksolution.com/posts/server-move-completed-and-general-update/</link><pubDate>Sun, 22 Jun 2008 19:37:44 +0000</pubDate><guid>https://shocksolution.com/posts/server-move-completed-and-general-update/</guid><description>&lt;p&gt;The site is back online after a server move.  Actually I can&amp;rsquo;t blame the server move for the downtime, because I went out of town and then had a lot of catching up to do, and as a result I didn&amp;rsquo;t switch the domain to point to the new server. I haven&amp;rsquo;t been blogging much because I haven&amp;rsquo;t done much software development, Linux admin, or lighting design lately.  I have been busy in the lab at work and I&amp;rsquo;ve been supervising a trainee lighting operator instead of running my own shows.  We haven&amp;rsquo;t been moving forward with plans to purchase a new lighting control console, so no update on that, either.  Hopefully, I&amp;rsquo;ll have something interesting to post soon.&lt;/p&gt;</description></item><item><title>Presentation at BarCamp Orlando 2008</title><link>https://shocksolution.com/posts/presentation-at-barcamp-orlando-2008/</link><pubDate>Mon, 07 Apr 2008 03:14:32 +0000</pubDate><guid>https://shocksolution.com/posts/presentation-at-barcamp-orlando-2008/</guid><description>&lt;p&gt;I gave a presentation at BarCamp Orlando on 5 April 2008. Here is a link to my presentation, &lt;a href="https://shocksolution.com/files/dataanalysiswithpython.pdf" title="Data Analysis with Python"&gt;Data Analysis with Python&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Connecting to a Windows file server from a Linux box</title><link>https://shocksolution.com/posts/connecting-to-a-windows-file-server-from-a-linux-box/</link><pubDate>Wed, 23 Jan 2008 18:26:00 +0000</pubDate><guid>https://shocksolution.com/posts/connecting-to-a-windows-file-server-from-a-linux-box/</guid><description>&lt;p&gt;&lt;em&gt;Updated 18 Jan 2013&lt;/em&gt;&lt;/p&gt;&#10;&lt;h2 id="gentoo"&gt;Gentoo&lt;/h2&gt;&#10;&lt;p&gt;There are two basic prerequisites for mounting a Windows share on a Gentoo Linux client. First, your kernel must be compiled with &lt;a href="https://wiki.samba.org/index.php/LinuxCIFS_utils" title="Linux%20CIFS%20utils"&gt;cifs&lt;/a&gt; support. Second, you must emerge the appropriate packages. The package used to be called mount-cifs, but this package is obsolete. You only need to install &lt;a href="http://packages.gentoo.org/package/net-fs/samba" title="Gentoo%20net-fs/samba"&gt;net-fs/samba&lt;/a&gt;, which will pull in &lt;a href="http://packages.gentoo.org/package/net-fs/cifs-utils" title="net-fs/cifs-utils"&gt;net-fs/cifs-utils&lt;/a&gt; and a few other dependencies. The &lt;a href="http://en.gentoo-wiki.com/wiki/Samba" title="Samba%20on%20Gentoo%20Wiki"&gt;Samba page on the Gentoo Wiki&lt;/a&gt; is pretty good. Since you probably need a user name and password to log in to the Windows share, you should create a credentials file. You don&amp;rsquo;t want to specify your password on the command line because it will be saved in your .bash_history file and unauthorized users may be able to see it. I created a file called /etc/credentials.txt and set permissions so that only root can see it. The format is:&lt;/p&gt;</description></item><item><title>Found a bunch of templates</title><link>https://shocksolution.com/posts/found-a-bunch-of-templates/</link><pubDate>Tue, 22 Jan 2008 21:02:05 +0000</pubDate><guid>https://shocksolution.com/posts/found-a-bunch-of-templates/</guid><description>&lt;p&gt;I use XFCE as my window manager, with Thunar as my file manager.  Thunar has always had this &amp;ldquo;Create Document -&amp;gt; from template&amp;rdquo; entry in the File menu, but it didn&amp;rsquo;t come with any templates.  I finally went looking for some templates, and found a good collection at &lt;a href="http://stalefries.googlepages.com/howtosnautilustemplates" title="stalefries'%20document%20templates"&gt;stalefries&lt;/a&gt;.  Just unpack the archive in a directory called &amp;ldquo;Templates&amp;rdquo; in your home directory. BTW, isn&amp;rsquo;t it about time I created a &amp;ldquo;linux&amp;rdquo; category instead of trying to stuff my Linux entries under the &amp;ldquo;software development&amp;rdquo; category?&lt;/p&gt;</description></item><item><title>Cheap LED fixtures</title><link>https://shocksolution.com/posts/cheap-led-fixtures/</link><pubDate>Fri, 11 Jan 2008 05:23:47 +0000</pubDate><guid>https://shocksolution.com/posts/cheap-led-fixtures/</guid><description>&lt;p&gt;Normally, we stay far away from anything marketed to DJ&amp;rsquo;s, but we&amp;rsquo;ve been experimenting with cheap LED fixtures as an inexpensive way to put more colors on stage.  LED fixtures have a few advantages: they efficiently produce light without much heat, they don&amp;rsquo;t require a dimmer, and they can produce multiple colors without gel changes.  They also have some disadvantages.  Color mixing is produced by combining LED&amp;rsquo;s of different colors (RGB) at different intensities, so the color is only &amp;ldquo;mixed&amp;rdquo; at the surface it is illuminating.  It can be difficult to produce white light that matches light from other fixtures.  LED&amp;rsquo;s cannot be dimmed by lowering the voltage, like a conventional light.  Instead the LED is strobed (pulsed) at a rate too fast for your eye to discern.  Unfortunately, the Chauvet ColorPalette fixtures shown below use a pulse rate that is slow enough that it can be picked up on a video camera.  When the fixtures illuminate a set piece like this one, which is in the background of many IMAG shots, the flicker is very distracting if the intensity is run at anything less than 100% &lt;a href="http://%3C%3Cwww.flickr.com/photos/a_mirror_dimly/1527795969/&amp;amp;gt%3E;"&gt;&lt;img src="http://farm3.static.flickr.com/2162/1527795969_b1a81dc2ff_t.jpg" alt="COLORpalette LED washes"&gt;&lt;/a&gt; Practically speaking, when a Color Palette is visible on camera,we can only get seven full-intensity colors: red, blue, green, white, purple, blue-green, and yellow.   We&amp;rsquo;ve since moved them out into the auditorium where they are used to illuminate the walls.  We did find one really cool application for these lights.  We have a number of deep-purple, &amp;ldquo;blacklight&amp;rdquo; Color Palettes mounted backstage to enable people to move in the dark.  They stay on all the time, draw very little power, and are totally invisible to the audience, even during a dead blackout. &lt;a href="http://%3C%3Cwww.flickr.com/photos/a_mirror_dimly/1527795941/&amp;amp;gt%3E;"&gt;&lt;img src="http://farm3.static.flickr.com/2088/1527795941_19043cc3bd_t.jpg" alt="COLORado 1 LED closeup"&gt;&lt;/a&gt; This is a Chauvet COLORado 1, which is meant to replace a small par can. It&amp;rsquo;s mounted on a pipe above and behind the musicians and lights them from behind.  This is the view you get from the front row in the audience.  See the red, blue, and green LEDs?  That&amp;rsquo;s producing white light, but you wouldn&amp;rsquo;t know it from this angle.  That&amp;rsquo;s what happens when the colors don&amp;rsquo;t mix at the light.  We don&amp;rsquo;t have the strobing problem on video with the COLORado&amp;rsquo;s, but I don&amp;rsquo;t know if that&amp;rsquo;s due to their positioning or their design. For more information, see &lt;a href="http://%3C%3Cwww.onstagelighting.co.uk/category/led-stage-lighting/&amp;amp;gt%3E;" title="onstagelighting%20LED%20reviews"&gt;the LED lighting reviews by onstagelighting.co.uk&lt;/a&gt;.  There are also pro-grade LED fixtures that are much better&amp;hellip;but I haven&amp;rsquo;t used them.&lt;/p&gt;</description></item><item><title>Cool set design: Part II</title><link>https://shocksolution.com/posts/cool-set-design-part-ii/</link><pubDate>Fri, 04 Jan 2008 02:07:09 +0000</pubDate><guid>https://shocksolution.com/posts/cool-set-design-part-ii/</guid><description>&lt;p&gt;Here&amp;rsquo;s another cool set design.  What&amp;rsquo;s interesting about these two pictures is that the set is illuminated using the same lights at two different intensity levels, but the color seems different.  That&amp;rsquo;s a neat feature of incandescent lights&amp;ndash;at low intensity you can get deep, saturated colors. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2156413885/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2325/2156413885_5d0715c797_t.jpg" alt="Message Lights"&gt;&lt;/a&gt;&lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2156413887/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2331/2156413887_538e547c2f_t.jpg" alt="walk-in lighting"&gt;&lt;/a&gt; Here is a look in another color. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2156413879/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2119/2156413879_af9a1ca521_t.jpg" alt="Holy Is The Lord"&gt;&lt;/a&gt; I didn&amp;rsquo;t think to take close-up pictures of this set.  It turns out that our set designer likes to have these pictures, so now I&amp;rsquo;m trying to do a more thorough job.   This one is constructed of a wooden frame with a light colored wrinkly fabric stapled to it.  Like I said, I don&amp;rsquo;t design or build these things, but if you want to know the details, I&amp;rsquo;m sure I can find out for you.&lt;/p&gt;</description></item><item><title>Cool set design: part 1</title><link>https://shocksolution.com/posts/cool-set-design-part-1/</link><pubDate>Wed, 02 Jan 2008 03:14:57 +0000</pubDate><guid>https://shocksolution.com/posts/cool-set-design-part-1/</guid><description>&lt;p&gt;After a longer-than-expected holiday break, I&amp;rsquo;m back with a slightly different topic: set design and construction. Someone else designs and builds our sets, but I get to light them, and I&amp;rsquo;m usually tasked with documenting them. Our lighting console evaluations have been on hold for the holidays, but I plan to get back to it later this month. The set I&amp;rsquo;m writing about today is one of the more exotic ones we&amp;rsquo;ve tried. Here&amp;rsquo;s how it looked when lit &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2156324729/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2194/2156324729_075e77bd19_t.jpg" alt="Walkin (16 Sept 2007)"&gt;&lt;/a&gt; Pieces were cut from white Styrofoam and stitched together to make a wall of crazy curves: &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2156324735/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2130/2156324735_4f5d705c42_t.jpg" alt="Set details 2"&gt;&lt;/a&gt;&lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2156324733/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2368/2156324733_4b3020f766_t.jpg" alt="Set details"&gt;&lt;/a&gt; The set was lit from below with cheap LED panels. The black boxes in front of the fixtures are cinder blocks that are basically sitting there to keep people from stepping on or kicking the fixtures as they enter and exit the stage. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/1527795969/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2162/1527795969_b1a81dc2ff_t.jpg" alt="COLORpalette LED washes"&gt;&lt;/a&gt; These LED fixtures are handy, but they have their drawbacks. That will be the subject of another post.&lt;/p&gt;</description></item><item><title>ChamSys MagicQ console review::part I</title><link>https://shocksolution.com/posts/chamsys-magicq-console-reviewpart-i/</link><pubDate>Fri, 07 Dec 2007 03:07:47 +0000</pubDate><guid>https://shocksolution.com/posts/chamsys-magicq-console-reviewpart-i/</guid><description>&lt;p&gt;I don&amp;rsquo;t know how to pronounce it, but I like it!  This review is based on my impressions gathered from a few minutes of hands-on experience at LDI 2007, and the MagicQ PC software that I &lt;a href="http://%3Cwww.chamsys.co.uk/default.asp?p=downloads.asp%3E" title="MagicQ%20Download"&gt;downloaded from ChamSys&lt;/a&gt;. I plan to review a lot of consoles by downloading the offline editors, and hopefully we will get demo units of our favorites. Installation:  Download from the link above.  I&amp;rsquo;m thrilled that it runs natively on Linux.  I made a directory /opt/magicq/  and uncompressed the tarball.  I had to install libftdi as indicated in the instructions (version 0.7 works fine).  In order to run the software as a non-root user, I had to give write permission on the usb device, even though I&amp;rsquo;m not using any wings.  That was the only hitch. Programming: The MagicQ has a programmer and a playback section&amp;ndash;the playback section can be playing cues from lists, while the user is manually setting values in the programmer.  This is similar to the Hog, but different from the ETC Congo.  Like the Hog, there are multiple playback faders, each with a cue list, and the console mixes the outputs using HTP or LTP (highest- or latest-takes-precedence). The MagicQ assigns HTP or LTP per DMX channel.  Conventional lights are usually run HTP, while movers are run LTP.  This overcomes one of the worst features of the Hog&amp;ndash;you can only choose HTP or LTP for an entire cue list, meaning that it&amp;rsquo;s hard to mix conventional lights and moving lights in the same cue list. Neat feature: the manual is available on the console by pressing the Help button. Next time, I will try patching some fixtures and running the demo show.&lt;/p&gt;</description></item><item><title>LDI Report::Part 3::Midrange Lighting Control Consoles</title><link>https://shocksolution.com/posts/ldi-reportpart-3midrange-lighting-control-consoles/</link><pubDate>Thu, 29 Nov 2007 01:40:37 +0000</pubDate><guid>https://shocksolution.com/posts/ldi-reportpart-3midrange-lighting-control-consoles/</guid><description>&lt;p&gt;My real mission at LDI was to review lighting consoles&amp;ndash;management is considering replacing our Hog 1000 in the next year or so.  The Hog is serving our needs well, but we&amp;rsquo;ve already used up both DMX outputs, and Hog programming is not the easiest thing to teach to new lighting operators.  So, we&amp;rsquo;re looking at consoles that match or exceed the capabilities of the Hog 1000, with 4 DMX outputs and hopefully with a more user-friendly design.  We&amp;rsquo;re keeping the price below $30,000&amp;ndash;hopefully well below!  So, without further ado, here are the consoles I got to see in person. Please keep in mind that these are first impressions, and I really need to download the offline emulators before I say anything more. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2070484662/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2012/2070484662_35eb0c8776_t.jpg" alt="Avolites Pearl Expert"&gt;&lt;/a&gt; The Avolites Pearl Expert and Pearl 2008.  The main thing that caught my eye with this console is the fader paging system.  There&amp;rsquo;s basically a big drum embedded in the board above the playback faders.  You use console tape on the drum to label the faders.  To get to a new bank of faders, roll the drum one click and bring up a new set of labels.  It&amp;rsquo;s intuitively obvious when you play with it. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2070484670/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2149/2070484670_ec3d3f7d7d_t.jpg" alt="Chamsys MagicQ"&gt;&lt;/a&gt; The MagicQ is a module console from a new company called ChamSys.  It&amp;rsquo;s being distributed in the US by PRG.  Some of the programmers previously worked on the Hog 2 and 3, so this board runs much like a Hog 2.  It might be described as &amp;ldquo;what the Hog 3 should have been.&amp;rdquo;  Very programmable&amp;ndash;and Linux-based! &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2070484676/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2203/2070484676_a41f23f6eb_t.jpg" alt="Compulite Vector Lite"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2070484666/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2368/2070484666_446b7302d0_t.jpg" alt="Compulite Vector Blue"&gt;&lt;/a&gt; These are Vector consoles from Compulite.  They seem to be reasonably priced and extremely programmable, but retain some of the simplicity of a theater-style console.  I got to talk to a software developer on the project, and although the consoles run a Windows XP operating system, they have taken great pains to maintain realtime hardware response. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2070484694/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2107/2070484694_9f4c8f9693_t.jpg" alt="ETC Congo"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2069717343/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2297/2069717343_d39a41e34c_t.jpg" alt="ETC Congo Jr"&gt;&lt;/a&gt; The Congo and Congo Jr. were originally made by Avab, and somehow acquired by ETC.  Compared to other brands, I was most impressed with the user interface of the Congo.  It&amp;rsquo;s designed like an ETC theater console, but integrates moving light support seamlessly.  There is no separate programmer&amp;ndash;you are always working within a cue.  It&amp;rsquo;s probably too early to say this, but I think this would be the easiest one to teach to a beginner.  Unfortunately, it seems to be one of the more expensive consoles in this lineup. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2069717363/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2038/2069717363_a171ddcdd1_t.jpg" alt="zero88 LeapFrog"&gt;&lt;/a&gt; Here is the LeapFrog from zero88.   I didn&amp;rsquo;t get much chance to use it, but with only 2 built-in DMX outputs, I&amp;rsquo;m not sure this is going to have the horsepower we need. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2069717357/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2369/2069717357_bb4e38eea6_t.jpg" alt="zero88 Frog2"&gt;&lt;/a&gt; The Frog 2 seems to be very much like the Hog 1000 or Hog 2 in terms of its programming style.  I don&amp;rsquo;t think it adds much value when compared to the Hog 1000. Overall, I was impressed with the consoles I saw at LDI.  My impression is that there are many powerful consoles to choose from, but many of them are too programmable for their own good.  I love programming features, but that&amp;rsquo;s because I&amp;rsquo;m a professional programmer who happened to learn lighting.  What about the theater lighting person who needs to run moving lights?  Is it really a good thing that bump button #7 can be programmed to shut off the console?  On another note, a lot of people were very helpful when showing me their consoles.  However, they would have been a lot more effective if they had just shut up and listened to my needs for a minute before going off and describing all kinds of features I don&amp;rsquo;t care about.  Stay tuned for more in-depth reviews!&lt;/p&gt;</description></item><item><title>LDI Report::Part 2::Cool Products</title><link>https://shocksolution.com/posts/ldi-reportpart-2cool-products/</link><pubDate>Fri, 23 Nov 2007 04:26:17 +0000</pubDate><guid>https://shocksolution.com/posts/ldi-reportpart-2cool-products/</guid><description>&lt;p&gt;These are a few interesting products that I saw at LDI.  I spent most of my time at the show looking at and trying out various lighting control consoles.  I didn&amp;rsquo;t have time to prowl around the smaller booths where the most interesting products are sometimes hidden.  These are just the things that caught my eye on the way from one place to the next.  Over the next month, I will go deep into detail on the lighting consoles I saw, so I&amp;rsquo;m excluding that product segment from this post. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2046070070/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2373/2046070070_19d645aa2b_t.jpg" alt="Skyview video balloon"&gt;&lt;/a&gt; Here is a giant video ball from Skyview.  It&amp;rsquo;s inflatable, it will float if filled with helium, and it has a video screen. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2046031370/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2143/2046031370_0aecdc24db_t.jpg" alt="Airstar"&gt;&lt;/a&gt; This is an innovative product for the film industry from &lt;a href="http://%3Cwww.airstar-light.us/%3E"&gt;Airstar&lt;/a&gt;.  It&amp;rsquo;s an inflatable flood light.  The large, inflatable reflector housing seem easy to set up, and compact to store when deflated.   &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2046031364/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2327/2046031364_ab236f96a7_t.jpg" alt="Airstar"&gt;&lt;/a&gt; This is &lt;a href="http://%3Cwww.airstar-light.us/%3E" title="Airstar"&gt;Airstar&lt;/a&gt;&amp;rsquo;s booth.  I was really impressed with these illuminated spheres, which can also be filled with helium to make them float in midair.  Check out their gallery page for cool applications.  I want to rent some of these! &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2046031370/%3E"&gt;&lt;/a&gt;&lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2045263383/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2312/2045263383_c8778fa9b6_t.jpg" alt="Fogscreen"&gt;&lt;/a&gt; Last but not least, the &lt;a href="http://%3Cwww.fogscreen.com%3E" title="fogscreen"&gt;Fogscreen&lt;/a&gt;!  It uses plain water and ultrasonics to produce a very fine fog of water&amp;ndash;the drops are so fine that it doesn&amp;rsquo;t even feel like water, and you don&amp;rsquo;t get wet at all from standing in it.  The fog is forced into a sheet that can be used as a screen for projection.&lt;/p&gt;</description></item><item><title>LDI Report::Part 1::Eye Candy</title><link>https://shocksolution.com/posts/ldi-reportpart-1eye-candy/</link><pubDate>Mon, 19 Nov 2007 04:27:19 +0000</pubDate><guid>https://shocksolution.com/posts/ldi-reportpart-1eye-candy/</guid><description>&lt;p&gt;&lt;a href="http://%3C%3Cwww.ldishow.com/LDI07/public/enter.aspx&amp;amp;gt%3E;" title="LDI"&gt;LDI&lt;/a&gt; is where lighting designers go to dream. Companies spend big bucks to bring their products and show them off in the most spectacular fashion. Ironically, some of the less-reputable names have some of the largest booths. High End was completely absent&amp;ndash;a source told me that they don&amp;rsquo;t spend money on trade shows because they introduce new products directly to key designers (not because they are having financial difficulties). In this post I&amp;rsquo;m going to highlight a few photos of the show in general. For more, check out my &lt;a href="http://%3C%3Cwww.flickr.com/photos/a_mirror_dimly/&amp;amp;gt%3E;"&gt;Flickr photostream&lt;/a&gt;. In future posts, I plan to focus on reviewing some lighting consoles. First, some spectacular booths from &lt;a href="http://%3C%3Cwww.ldishow.com/LDI07/public/enter.aspx&amp;amp;gt%3E;" title="Chauvet"&gt;Chauvet&lt;/a&gt; and &lt;a href="http://%3C%3Cwww.robe.cz/&amp;amp;gt%3E;" title="Robe"&gt;Robe&lt;/a&gt;--it appears they are trying hard to be taken seriously by lighting professionals. &lt;a href="http://%3C%3Cwww.flickr.com/photos/a_mirror_dimly/2046031404/&amp;amp;gt%3E;"&gt;&lt;img src="http://farm3.static.flickr.com/2103/2046031404_f1a50d48d3_t.jpg" alt="Chauvet booth"&gt;&lt;/a&gt;&lt;a href="http://%3C%3Cwww.flickr.com/photos/a_mirror_dimly/2046070058/&amp;amp;gt%3E;"&gt;&lt;img src="http://farm3.static.flickr.com/2409/2046070058_de21e61a46_t.jpg" alt="Robe booth"&gt;&lt;/a&gt; At the &lt;a href="http://%3C%3Cwww.ldishow.com/LDI07/public/enter.aspx&amp;amp;gt%3E;" title="Chauvet"&gt;Chauvet&lt;/a&gt; booth, note the array of 96 mini-movers! I was also impressed with the booth from &lt;a href="http://%3C%3Cwww.xtremestructures.com/&amp;amp;gt%3E;" title="XST"&gt;XST:&lt;/a&gt; &lt;a href="http://%3C%3Cwww.flickr.com/photos/a_mirror_dimly/2046070098/&amp;amp;gt%3E;"&gt;&lt;img src="http://farm3.static.flickr.com/2147/2046070098_c10462d13b_t.jpg" alt="Xtreme Structures and Fabrication"&gt;&lt;/a&gt;&lt;a href="http://%3C%3Cwww.flickr.com/photos/a_mirror_dimly/2046070100/&amp;amp;gt%3E;"&gt;&lt;img src="http://farm3.static.flickr.com/2050/2046070100_fb2657284e_t.jpg" alt="Xtreme Structures and Fabrication"&gt;&lt;/a&gt; I&amp;rsquo;m not a rigger, but it sure looks like they know what they&amp;rsquo;re doing with truss. Cyberhoist also had a really sweet booth. The trusses moved up and down at changing angles in various coordinated patterns.&lt;/p&gt;</description></item><item><title>Lighting design review: Mutemath in Orlando, FL</title><link>https://shocksolution.com/posts/lighting-design-review-mutemath-in-orlando-fl/</link><pubDate>Fri, 16 Nov 2007 18:46:38 +0000</pubDate><guid>https://shocksolution.com/posts/lighting-design-review-mutemath-in-orlando-fl/</guid><description>&lt;p&gt;I don&amp;rsquo;t go to many concerts.  I don&amp;rsquo;t want to spend the money to hear a band play a poor version of their CD.  But I heard from several people that Mutemath was a great live act, and it turns out that the rumors were true.  I saw them on November 2 at House of Blues in Orlando, FL.  Not only were the music and showmanship excellent, the lighting design was first-class.  Too many rock bands have a cloud of haze, a bunch of colored par cans, and some moving beams.   Mutemath is not  your average rock band, and I have the poor-quality cell-phone-camera pictures to prove it. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2036090163/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2053/2036090163_ad3cd262d4_t.jpg" alt="Mutemath"&gt;&lt;/a&gt; First, we have an overall shot of the stage.  Nothing too special about the lighting in this view.  Note that there was almost no front lighting. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2036090171/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2209/2036090171_e04ac2f758_t.jpg" alt="Mutemath"&gt;&lt;/a&gt; Here is a creative look.  Notice the beams coming from below the video screens, illuminating everything within three feet of the floor.  The LD told me they are MAC 250&amp;rsquo;s that tour with the band.  These lights were only used for floor-level illumination.  Most of the lights on the truss overhead were wash lights and par cans belonging to HOB.  In this picture you can just barely make out that the drummer has taped his headphones to his head with gaffers&amp;rsquo; tape. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/2036090173/%3E"&gt;&lt;img src="http://farm3.static.flickr.com/2323/2036090173_3ad7d4f18b_t.jpg" alt="Mutemath"&gt;&lt;/a&gt; A blinding, cold white look.  Notice the vertical white stripes visible below the video screen panels.  Those are fluorescent light bulbs, rigged to turn on and off instantly in chase sequences.   The LD told me there is one brand of bulb in one specific fixture that will do that.  I wish I had gotten a good pic showing how effectively the fluorescents provide cold, dynamic light.   Another interesting thing about this photo is that the bass player is sitting behind the drums, the lead singer/keyboard player is also playing drums, and the drummer is doing some improvised percussion on top of the keyboard.  This is part of what makes Mutemath so much fun to watch. I didn&amp;rsquo;t get a picture of one of my favorite looks.  They managed to find some huge, clear incandescent bulbs and hang a couple of them on either side of the video screen.  With the stage nearly dark and filled with haze, the bare bulbs were turned on to a low intensity, allowing the glowing filaments to illuminate the haze with an eerie warm glow. This was easily the most creative lighting I&amp;rsquo;ve ever seen in my limited concert experiences.  I did stop by after the show to compliment the LD, but I didn&amp;rsquo;t get his name, and there are so many things I want to ask him!&lt;/p&gt;</description></item><item><title>My current Gentoo Linux setup</title><link>https://shocksolution.com/posts/my-current-gentoo-linux-setup/</link><pubDate>Mon, 12 Nov 2007 22:15:03 +0000</pubDate><guid>https://shocksolution.com/posts/my-current-gentoo-linux-setup/</guid><description>&lt;p&gt;This post is a reminder to myself more than it is intended for anyone else.  Well, that&amp;rsquo;s most of this blog.  Gentoo is a great distribution of Linux, but you have to install everything yourself. This is a good thing, because you get a very lean system, but the downside is that you are re-inventing the wheel somewhat with every install. So, without further ado, here is my current favorite configuration: &lt;strong&gt;Global USE flags:&lt;strong&gt;X cups dbus hal jpeg png gs dvi gif tiff mpeg bzip2 gtk lapack tetex -gnome -kde&lt;/strong&gt;Package list (basic software):&lt;/strong&gt;* dbus (&lt;a href="http://%3Cwww.freedesktop.org/wiki/Software/dbus%3E" title="dbus"&gt;message bus system&lt;/a&gt;)* hal  (&lt;a href="http://%3Cwww.freedesktop.org/wiki/Software/hal%3E" title="HAL"&gt;Hardware Abstraction Layer&lt;/a&gt;)&#10;&lt;em&gt;gentoolkit&lt;/em&gt; vim/gvim&#10;&lt;em&gt;x.org&lt;/em&gt; xfce4&#10;&lt;em&gt;thunar&lt;/em&gt; mozilla-firefox&#10;&lt;em&gt;acroread&lt;strong&gt;Package list (technical software):&lt;/strong&gt;&lt;/em&gt; blas-atlas* lapack-reference&#10;&lt;em&gt;numpy (unstable 0.90.1)&lt;/em&gt; matplotlib (Matlab-like plotting package for Python)&#10;&lt;em&gt;texlive (experimental, hard-masked)&lt;/em&gt; lyx&#10;&lt;em&gt;evince (dvi, ps, pdf viewer)&lt;/em&gt; paraview (3D visualization of datasets, unstable)&lt;/p&gt;</description></item><item><title>Blog infrastructure update</title><link>https://shocksolution.com/posts/blog-infrastructure-update/</link><pubDate>Mon, 08 Oct 2007 01:48:30 +0000</pubDate><guid>https://shocksolution.com/posts/blog-infrastructure-update/</guid><description>&lt;p&gt;During the past week, the blog engine was updated and a few things were tweaked &amp;ldquo;under the hood.&amp;rdquo;  You may have already noticed that the theme has been totally changed.  It&amp;rsquo;s a modified version of the &lt;a href="http://%3Cwww.blogohblog.com/wordpress-theme-blue-box/%3E" title="Blue%20Box%20theme"&gt;Blue Box theme&lt;/a&gt; by Bob&amp;ndash;the header photo is mine.&lt;/p&gt;</description></item><item><title>Hog Programming: Cuelists vs. Palettes</title><link>https://shocksolution.com/posts/hog-programming-cuelists-vs-palettes/</link><pubDate>Wed, 03 Oct 2007 17:40:00 +0000</pubDate><guid>https://shocksolution.com/posts/hog-programming-cuelists-vs-palettes/</guid><description>&lt;p&gt;I&amp;rsquo;ve always programmed the Hog 1000 lighting console using cue lists.  Why?  My prior lighting experience involved HogPC, which is essentially the same software running on a standard Windows PC.  The HogPC software emulates the hardware of the Hog console with graphical buttons and wheels on the computer monitor, which can be manipulated with the mouse.  This works, but it is much more awkward than having a physical console with real buttons.  Using HogPC, it makes sense to pre-program as much as possible, because doing complicated things &amp;ldquo;live&amp;rdquo; is difficult using only a mouse (especially on a smaller monitor.)  When I moved to the Hog 1000,  I continued to rely on cue lists, mostly because I didn&amp;rsquo;t feel comfortable enough with the console to do things &amp;ldquo;live.&amp;rdquo;  As I&amp;rsquo;ve grown more familiar with the console, I have begun to experiment with running moving lights off of palettes, rather than pre-programming cue lists. Cue lists have a couple of problems.  On the Hog, a cue list can have either &amp;ldquo;latest takes precedence&amp;rdquo; (LTP) or &amp;ldquo;highest takes precedence&amp;rdquo; (HTP) as the priority scheme.  HTP makes sense for conventional dimming-onlyfixtures (desk channels) and LTP makes sense for movers.  Things get tricky when you mix desk channels and movers on one cue list.  Another obvious problem is flexibility&amp;ndash;when you have a pre-programmed list of cues and something changes at the last minute, you have to do some fast editing and hope you didn&amp;rsquo;t screw up something later in the cue list. Palettes offer the flexibility of running &amp;ldquo;on-the-fly&amp;rdquo;: choose fixture(s), color,  position, and hit ENTER.  That&amp;rsquo;s great when you don&amp;rsquo;t know what to expect.  One disadantage is complexity&amp;ndash;you have to hit a lot of buttons quickly, and do it again for every transition.  It&amp;rsquo;s easy to mess up.  Another difficulty is adjusting the rate of the transition&amp;ndash;it&amp;rsquo;s hard to make two movers do a slow sweep across the stage while eight others snap into position.  This is also a problem for smooth color fades on LED fixtures. So far, the best strategy I&amp;rsquo;ve found is to mix the methods.  Program cue lists for rehearsed shows with known, fixed programs.  For a more fluid situation, program cue lists with only position and fade time for moving lights.  Use the cue list(s)  for position (and maybe focus) and manually set color and gobo on the fly using palettes.  Keep movers and desk channels on separate cue lists.  That&amp;rsquo;s my best practice so far&amp;hellip;but I&amp;rsquo;m always learning and open to ideas.&lt;/p&gt;</description></item><item><title>ODEPACK re-released</title><link>https://shocksolution.com/posts/odepack-re-released/</link><pubDate>Wed, 26 Sep 2007 03:44:58 +0000</pubDate><guid>https://shocksolution.com/posts/odepack-re-released/</guid><description>&lt;p&gt;Minutes ago I uploaded a tarball containing my &lt;a href="https://shocksolution.com/math_tools/odepack/index.html" title="ODEPACK"&gt;re-release of ODEPACK&lt;/a&gt;, a standard numerical tool for the solution of systems of ordinary differential equations. The algorithms and numerical code are identical to the distribution &lt;a href="http://%3Cwww.netlib.org/odepack/%3E" title="ODEPACK%20home"&gt;found on Netlib&lt;/a&gt;, but everything has been placed into an organized &amp;ldquo;package&amp;rdquo; with Makefiles, examples, documentation, etc. The code is set up to be compiled as a shared library that you can link to your code. Download and enjoy! And tell me if you&amp;rsquo;re using it!&lt;/p&gt;</description></item><item><title>Direct access to C++ containers from Python</title><link>https://shocksolution.com/posts/direct-access-to-c-containers-from-python/</link><pubDate>Thu, 13 Sep 2007 16:31:01 +0000</pubDate><guid>https://shocksolution.com/posts/direct-access-to-c-containers-from-python/</guid><description>&lt;p&gt;In previous examples, I&amp;rsquo;ve shown how to pass Python lists into C++ using Boost.python. Because Python lists can contain a mixture of objects of different types, C++ has to use extract&amp;lt;type&amp;gt; to determine what kind of data to get from a list item. This approach works well, but it has its faults. In the C++ code, you might need to have duplicate data structures (a boost.python list to interchange data with Python and a C++ container such as a vector to process the data) and the code to convert between them. If you want to use your C++ library with languages other than Python, you want a non-Python-specific interface. Wouldn&amp;rsquo;t it be great to define your core data structures using a standard C++ container (like vector) and then access and modify them in Python? You can, but it&amp;rsquo;s non-obvious and it&amp;rsquo;s not well explained in the Boost.python docs. Read the &lt;a href="http://%3Cwww.boost.org/libs/python/doc/v2/indexing.html%3E" title="Boost%20indexing%20suite%20docs"&gt;docs for the indexing suite&lt;/a&gt; and take a look at my &lt;a href="https://shocksolution.com/files/Demo_Exposing_Cplusplus_Vectors.zip"&gt;demonstration code for exposing C++ vectors to Python&lt;/a&gt;, and you should be able to figure it out. Once you get it working, it&amp;rsquo;s a very clean way of doing things. Just remember, because you&amp;rsquo;re working with C++ containers that accept only the specified type of object Python will throw a TypeError if you try to append the wrong kind of object.&lt;/p&gt;</description></item><item><title>Mixing objects of different types in a Boost.python list</title><link>https://shocksolution.com/posts/mixing-objects-of-different-types-in-a-boostpython-list/</link><pubDate>Wed, 08 Aug 2007 15:35:26 +0000</pubDate><guid>https://shocksolution.com/posts/mixing-objects-of-different-types-in-a-boostpython-list/</guid><description>&lt;p&gt;&lt;a href="https://shocksolution.com/files/ExtractMultipleClasses.zip" title="Demo Code"&gt;Demonstration Code&amp;ndash;mixing objects of different types in a Boost.python list&lt;/a&gt; In Python, a list is allowed to contain objects of various types. Using Python&amp;rsquo;s introspection capabilities, it&amp;rsquo;s easy to process a mixed list because you can just test each list member to see what kind it is, using isinstance(objectA, TypeB). This creates a problem when the list is passed into C++, where arrays and containers are designed to hold objects of one type. I encountered this problem when writing a small module to parse mathematical expressions. The expression is entered as a string in Python, which is parsed and &amp;ldquo;compiled&amp;rdquo; into a stack of objects. The compiled stack is passed to C++ using boost.python, where it is processed when needed. The stack consists of two or more fundamentally different objects: numerical constants and operators. The evaluation routine pops an object. If it&amp;rsquo;s a numerical constant, the value is placed on the operand stack. If it&amp;rsquo;s an operator, the appropriate operation is performed on the values at the top of the operand stack. With help from Alex Mohr and Christopher Woods on the &lt;a href="http://mail.python.org/pipermail/c++-sig/" title="C++-sig"&gt;C++-sig mailing list&lt;/a&gt;, I developed a method that is illustrated in the example. In C++, define a polymorphic base class (has at least one virtual method) and several classes that are derived from the base class. These classes are exposed to Python using &lt;a href="http://%3Cwww.boost.org/libs/python/doc/%3E" title="Boost.python"&gt;Boost.python&lt;/a&gt; so that objects can be created in Python. A list of mixed objects is then passed back to C++ for processing. When trying to access a member of the list, C++ doesn&amp;rsquo;t know what kind of object to expect, so we have to use the Boost.python function extract&amp;lt;&amp;gt;() (see previous post for an introduction to &lt;em&gt;extract&lt;/em&gt;). Now we extract a pointer to the base class using: object = extract &amp;lt;BaseClass*&amp;gt; (list[index]); This works because every object in the list is derived from the base class. As shown in the example, I first tried to do this with references (to avoid the whole pointer mess) but it did not work, so it seems that pointers are unavoidable here. It seems that this use of introspection is relatively rare in OOP, and is &lt;a href="http://%3Cwww.canonical.org/~kragen/isinstance/%3E" title="Discouraging%20use%20of%20isinstance()"&gt;sometimes actively discouraged&lt;/a&gt;. However, for this type of problem it seems like the most logical design. Is there a different design pattern that would work better?&lt;/p&gt;</description></item><item><title>USPTO tries peer review for software patents</title><link>https://shocksolution.com/posts/uspto-tries-peer-review-for-software-patents/</link><pubDate>Wed, 04 Jul 2007 21:55:06 +0000</pubDate><guid>https://shocksolution.com/posts/uspto-tries-peer-review-for-software-patents/</guid><description>&lt;p&gt;The US Patent and Trademark Office (USPTO) has launched a trial program to subject software patents to &lt;a href="http://%3Cwww.peertopatent.org/%3E"&gt;peer review online&lt;/a&gt;.  Naturally, the big software companies aren&amp;rsquo;t exactly publicizing this.  We all know that a lot of stupid patents get issued.  Well, stop complaining and start reviewing!  Let&amp;rsquo;s make this trial successful!&lt;/p&gt;</description></item><item><title>Truss warmers</title><link>https://shocksolution.com/posts/truss-warmers/</link><pubDate>Sun, 03 Jun 2007 22:39:29 +0000</pubDate><guid>https://shocksolution.com/posts/truss-warmers/</guid><description>&lt;p&gt;Truss warmers are lights used to illuminate truss. Truss is fun to light because it&amp;rsquo;s semi-reflective and has a neutral color, so it easily reflects whatever color is used to light it. We used a little par light on one end of a section of truss to turn it blue, with a &amp;ldquo;cap&amp;rdquo; taped on the other end to keep the light from spilling out onto other stage objects. We also had some Trackspot lights sitting on the floor. Because the hazer wasn&amp;rsquo;t working they were pretty much useless, so I positioned two of them to point into the ends of truss that didn&amp;rsquo;t have blue lights. The Trackspots have a dozen or so colors built in, so it was possible to change the color of the center truss. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/516246972/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/200/516246972_e8840be708_m.jpg" alt="Empty Stage"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/516260392/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/192/516260392_b5571ba7d1_m.jpg" alt="Instrumental"&gt;&lt;/a&gt; Rumor has it we have some small LED color-changing fixtures on order&amp;hellip;those should be great fun as truss warmers!&lt;/p&gt;</description></item><item><title>April 22, 2007: The importance of haze</title><link>https://shocksolution.com/posts/april-22-2007-the-importance-of-haze/</link><pubDate>Sun, 27 May 2007 16:34:20 +0000</pubDate><guid>https://shocksolution.com/posts/april-22-2007-the-importance-of-haze/</guid><description>&lt;p&gt;If you are not &amp;ldquo;into&amp;rdquo; lighting, then you may not have paid any attention to the beams of light that seem to descend from the lighting fixtures towards the stage. There&amp;rsquo;s nothing special about the lights &amp;ndash;the beams are produced when the light is reflected from millions of tiny drops of haze. Haze is produced by a machine that&amp;rsquo;s located above the stage behind the teaser (upper curtain). Haze is distinct from &amp;ldquo;fog.&amp;rdquo; A fog machine produces clouds of visible, dense, rolling fog, while haze is supposed to hang unobtrusively in the air until it&amp;rsquo;s hit with a light beam. Ideally, you would never see the haze being produced, but because of the location of our hazer, it sometimes looks more like fog when it gets blown around by the air handlers. The reason I&amp;rsquo;m writing about haze this week is because on April 22 our haze machine was out of commission. Look at the photos from this week and compare them to previous weeks.  The haze adds color and depth to the stage. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/516246984/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/254/516246984_2043e5e675_m.jpg" alt="All We Need"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/516246988/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/230/516246988_5b4cb22ad2_m.jpg" alt="Love The Lord"&gt;&lt;/a&gt; I&amp;rsquo;m excited that we&amp;rsquo;re finally adding color to the front of the stage.  For Easter, we added three pars near the front on each side of the stage, with blue gels.  They were a critical part of achieving this look: &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/516246990/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/236/516246990_c6ad6952ea_m.jpg" alt="You Are My Shield"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/516246994/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/219/516246994_bd47c7d887_m.jpg" alt="You Are My Shield 2"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/516246998/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/205/516246998_9cdc31429e_m.jpg" alt="You Are My Shield 3"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/516260392/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/192/516260392_b5571ba7d1_m.jpg" alt="Instrumental"&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Why the people are blurry</title><link>https://shocksolution.com/posts/why-the-people-are-blurry/</link><pubDate>Mon, 21 May 2007 03:50:00 +0000</pubDate><guid>https://shocksolution.com/posts/why-the-people-are-blurry/</guid><description>&lt;p&gt;This is a simple post to explain why the people are usually blurry inmy lighting photographs. As an illustration, I took three photos of a speaker on stage, using different exposure times. An exposure time of 1/40 second produces a sharp speaker, but an overally ugly picture because of the noise in the image. Look at the graininess that is visible in the full-size image. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/496812665/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/232/496812665_23dd4d24a1_m.jpg" alt="Message_1over40"&gt;&lt;/a&gt; Exposure time 1/15 second: &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/496812677/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/214/496812677_4220fce4c1_m.jpg" alt="Message_1over15"&gt;&lt;/a&gt; Exposure time 1/5 second: &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/496812681/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/222/496812681_aa3b05f76d_m.jpg" alt="Message_1over5"&gt;&lt;/a&gt; At 1/5 second the noise is gone, but now the exposure is so long that the speaker moves during the exposure, producing the &amp;ldquo;halo&amp;rdquo; effect. Since my goal in taking these picture is to showcase the lighting, I use a longer exposure to capture the darker parts of the image, and I live with the fuzzy people. Another option is to get a more expensive camera with a more sensitive sensor and a broader range of apertures (my camera only supports two).&lt;/p&gt;</description></item><item><title>April 1, 2007 Lighting for solo vocalists</title><link>https://shocksolution.com/posts/april-1-2007-lighting-for-solo-vocalists/</link><pubDate>Sun, 13 May 2007 21:21:23 +0000</pubDate><guid>https://shocksolution.com/posts/april-1-2007-lighting-for-solo-vocalists/</guid><description>&lt;p&gt;This weekend, two songs started with a solo vocalist.  I used the front lights to highlight the solos and provide a transition when the rest of the singers and the band joined in. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/496778806/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/221/496778806_35a5f305db_m.jpg" alt="Open The Gates"&gt;&lt;/a&gt; In the following song, the female vocalist at stage left leads the song, so I highlighted her for the first look by dimming the front lights on the rest of the band and singers. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/496778770/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/227/496778770_ae3323da70_m.jpg" alt="Endlessly"&gt;&lt;/a&gt; I then brought up front lights on the other singers and band members. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/496778778/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/230/496778778_fd3860cac6_m.jpg" alt="Endlessly 2"&gt;&lt;/a&gt; I did the same thing for this song, but with a different lead vocalist. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/496812647/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/217/496812647_025bace479_m.jpg" alt="The Stand"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/496812651/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/222/496812651_d634d2b2ee_m.jpg" alt="The Stand"&gt;&lt;/a&gt; And three more songs&amp;hellip; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/496778754/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/202/496778754_56793e3e9d_m.jpg" alt="Awesome God"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/496778758/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/221/496778758_de48183305_m.jpg" alt="Beautiful The Blood"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/496778764/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/200/496778764_d65221ec46_m.jpg" alt="Carried To The Table"&gt;&lt;/a&gt; We did one cool thing that I didn&amp;rsquo;t photograph.  We have six pars on the ceiling throughout the auditorium that light the walls.  With blue gels, we used them as &amp;ldquo;house lights&amp;rdquo; while communion was being served.&lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/496778770/%3E"&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Example: using an extractor class in Boost.Python</title><link>https://shocksolution.com/posts/example-using-an-extractor-class-in-boostpython/</link><pubDate>Mon, 16 Apr 2007 03:12:23 +0000</pubDate><guid>https://shocksolution.com/posts/example-using-an-extractor-class-in-boostpython/</guid><description>&lt;p&gt;The &lt;a href="http://%3Cwww.boost.org/libs/python/doc/v2/Extractor.html%3E"&gt;documentation for the Boost.Python extractor class&lt;/a&gt; is not terribly enlightening for a new user. The examples given in the tutorial are code fragments, and it&amp;rsquo;s never clear exactly what the context is or what they are supposed to accomplish. That&amp;rsquo;s a shame, because the extractor classes are really cool and easy to use, so people should use them! Here is a &lt;a href="https://shocksolution.com/files/TestExtractor.tgz"&gt;Boost Python extractor example&lt;/a&gt; that should make things clear.&lt;/p&gt;</description></item><item><title>How do you say "bye bye Ubuntu" in Zulu?</title><link>https://shocksolution.com/posts/how-do-you-say-bye-bye-ubuntu-in-zulu/</link><pubDate>Wed, 11 Apr 2007 18:48:46 +0000</pubDate><guid>https://shocksolution.com/posts/how-do-you-say-bye-bye-ubuntu-in-zulu/</guid><description>&lt;p&gt;I finally had enough and wiped Ubuntu off of my computer at work, and now Gentoo is happily running.  Maybe I could have gotten Ubuntu to do what I wanted if I had spent more time with it, but I was sick of playing with it instead of getting work done.  To be fair to Ubuntu, maybe I&amp;rsquo;m just more familiar with how to do strange things with Gentoo.  Things like installing and using my open-source toolchain:&lt;/p&gt;</description></item><item><title>Climate change catastrophe: filler for a slow news day</title><link>https://shocksolution.com/posts/climate-change-catastrophe-filler-for-a-slow-news-day/</link><pubDate>Sat, 07 Apr 2007 19:41:40 +0000</pubDate><guid>https://shocksolution.com/posts/climate-change-catastrophe-filler-for-a-slow-news-day/</guid><description>&lt;p&gt;When there&amp;rsquo;s a slow news day, and no interesting disaster has taken place to make a good headline, you can always count on global climate change to fill in the gaps.  Yesterday we learned about  &lt;a href="http://%3Cwww.cnn.com/2007/TECH/science/04/06/natural.treasures.ap/index.html%3E"&gt;&amp;ldquo;natural wonders&amp;rdquo; that are being destroyed by climate change&lt;/a&gt;.  Of course, this is a press release from the World Wildlife Fund, not a peer-reviewed scientific paper and in fact not even issued by the IPCC.  I think the most interesting aspect of this article is the implied viewpoint that climate change can somehow be prevented.  WWF&amp;rsquo;s chief scientist said, &amp;ldquo;&amp;hellip;more attention will have to be paid to adapting to change, not only trying to prevent it&amp;hellip;&amp;rdquo;  In the controversy over whether or not humans are causing global warming, environmentalists seem to have forgotten that the global climate has been changing, all on its own, for millions of years.  Probably millions of species have been wiped out, and natural wonders destroyed, by past climate change long before humans came along.  The  &amp;ldquo;natural wonders&amp;rdquo; that are familiar to us exist because they happen to thrive in the particular climate conditions that occured in the past several thousand years&amp;ndash;geologically speaking, a very short time.  When conditions change, nature will change.  Even if we can prevent one component of climate change that &lt;em&gt;is&lt;/em&gt; caused by humans, the world will change, species will die out, and people will suffer.  Welcome to life on Earth&amp;ndash;adapt or go extinct. On a side note: &amp;ldquo;&amp;hellip;diplomats and scientists were negotiating the text of a 21-page summary of the full 1,572-page scientific report.&amp;rdquo;  Now &lt;em&gt;that&lt;/em&gt; sounds like formula guaranteed to achieve accuracy and exclude bias. Also, now available for download: &lt;a href="http://ipcc-wg1.ucar.edu/index.html"&gt;the executive summary of the 4th Report&lt;/a&gt;, 1st Working Group, from the International Panel on Climate Change.  Unfortunately, we&amp;rsquo;ll have to wait for May to get the full report and see what it really says.&lt;/p&gt;</description></item><item><title>Science by press release</title><link>https://shocksolution.com/posts/science-by-press-release/</link><pubDate>Sat, 31 Mar 2007 15:44:22 +0000</pubDate><guid>https://shocksolution.com/posts/science-by-press-release/</guid><description>&lt;p&gt;There&amp;rsquo;s a reason that the scientific community uses a peer-review process to validate publications.  Unfortunately, the &amp;ldquo;global warming&amp;rdquo; branch of climate science doesn&amp;rsquo;t operate this way.   Recently, excerpts of a report from the UN International Panel on Climate Change (IPCC) &lt;a href="http://news.yahoo.com/s/afp/20070330/sc_afp/unclimatewarmingaustralia_070330063342"&gt;were leaked to the press&lt;/a&gt; ahead of the release of the full report.  As usual, they released the most scandalous and exciting bits and left out all the qualifiers and complexity that make for good science but poor headlines.  In this case, &amp;ldquo;Australia will suffer more droughts, fires, floods and storms&amp;rdquo; and the &amp;ldquo;Great Barrier Reef will be devastated by 2030.&amp;rdquo;  We&amp;rsquo;re not supposed to ask how they came up with these predictions.  Further, with a report prepared by more than 2000 scientists and beaurocrats, nobody actually has to face consequences if their predictions don&amp;rsquo;t hold true. I wish I had time to get into the details of climate models and explain how these things work, and expose their strengths and weaknesses&amp;hellip;.&lt;/p&gt;</description></item><item><title>Discovery Lights, 17-18 March 2007</title><link>https://shocksolution.com/posts/discovery-lights-17-18-march-2007/</link><pubDate>Mon, 26 Mar 2007 02:38:45 +0000</pubDate><guid>https://shocksolution.com/posts/discovery-lights-17-18-march-2007/</guid><description>&lt;p&gt;Challenges for this week: The set has been the same for over a month, so I had to come up with something to distinguish it from previous weeks. In addition, a couple of weeks ago our four Trackspots were transferred to another venue, leaving us with two Studiospots as the only intelligent lights. We have two more that have been backstage awaiting repairs for months. I&amp;rsquo;d like to see them back up and running, but we &lt;em&gt;are&lt;/em&gt; a church, and if we&amp;rsquo;re using our budget to help poor people instead of fixing our lights, I&amp;rsquo;m okay with that. The first look is the one I used before the band went onstage. The next look was used when the band started playing an instrumental intro to the first song. The center screen showed an eye-candy video while the side screen showed announcements. Both Studiospots were set to white, with open gobo and a random effect so that their beams moved around the front of stage. Here they are shown hitting the drummer and guitar player. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/432996325/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/184/432996325_5222526775_t.jpg" alt="Walk-in"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/433581913/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/178/433581913_748496a065_t.jpg" alt="Walk-in look"&gt;&lt;/a&gt; The first song was a continuation of the intro, so I used the same colors but brought up the front lights.  I used the red lights on the backdrop, and blue lights on the truss, to provide transitions in this song.  I was saving the movers for a later song&amp;hellip; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/434486469/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/165/434486469_0d121dff85_t.jpg" alt="The Time Has Come, Look 2"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/434486499/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/187/434486499_c4f4756935_t.jpg" alt="The Time Has Come, Look 3"&gt;&lt;/a&gt; I used a totally different color to distinguish the next song, with two different looks. It was a cool day outside, so the air conditioner wasn&amp;rsquo;t running much and the haze hung in the air beautifully. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/433564654/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/161/433564654_bcaf51959c_t.jpg" alt="Holy Is The Lord, Look 1"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/433564658/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/178/433564658_e54ab5d8b6_t.jpg" alt="Holy Is The Lord, Look 2"&gt;&lt;/a&gt; I used the Lava gobo with a very slow rotation in the two Studiospots for this song. To provide transitions within the song, I moved the lights from the lead singer, to the backdrop, to the guitarist/drummer for a solo, and back to the singer. It doesn&amp;rsquo;t show up that well in the photos, but it was a nice effect. For the finale, I lit up the truss in the back. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/434473530/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/182/434473530_7d29fe8817_t.jpg" alt="From The Inside Out, Look 1"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/434473534/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/152/434473534_5b97893869_t.jpg" alt="From The Inside Out, Look 2"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/434473536/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/173/434473536_ce56d7639f_t.jpg" alt="From The Inside Out, Look 3"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/434473542/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/167/434473542_aa21d95679_t.jpg" alt="From The Inside Out, Look 4"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/434473552/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/163/434473552_ce59c1d4f1_t.jpg" alt="From The Inside Out, Look 5"&gt;&lt;/a&gt; I used two basic looks (with the fixed lights) for the final song. The band continued to play an instrumental version while the audience greeted one another, so I dimmed the front lights for the third look. It doesn&amp;rsquo;t show up in the pictures, but I used the studiospots to hit the white draped fabric with a subtle rotating gobo effect. I like using the gobos on irregular surfaces where you can&amp;rsquo;t tell that it has a cheesy shape. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/433581919/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/152/433581919_414f5f0083_t.jpg" alt="Lord Reign In Me, Look 1"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/433581925/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/166/433581925_050ae2bac4_t.jpg" alt="Lord Reign In Me, Look 2"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/432996323/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/186/432996323_666cf63e90_t.jpg" alt="Lord Reign In Me&amp;ndash;Offering"&gt;&lt;/a&gt; Announcements and message. For the announcements, I pointed the studiospots across the stage to illuminate the backdrop with a deep blue/purple gobo. During most of the service, the stage is too brightly lit to achieve these highly saturated colors. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/432996311/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/186/432996311_0291bbdf23_t.jpg" alt="Announcements"&gt;&lt;/a&gt; &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/432996315/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/167/432996315_b32842b827_t.jpg" alt="Message"&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Who got fired for this?</title><link>https://shocksolution.com/posts/who-got-fired-for-this/</link><pubDate>Mon, 19 Mar 2007 02:34:32 +0000</pubDate><guid>https://shocksolution.com/posts/who-got-fired-for-this/</guid><description>&lt;p&gt;What an unusual pine tree! Who would have guessed that this is actually a &lt;em&gt;giant&lt;/em&gt; &lt;em&gt;antenna&lt;/em&gt;, cleverly disguised as a tree? &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/426125676/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/179/426125676_14a3e297aa_m.jpg" alt="New Pine Species"&gt;&lt;/a&gt; I just hope that my taxpayer dollars weren&amp;rsquo;t used on this monstrosity.&lt;/p&gt;</description></item><item><title>How the E815 dies</title><link>https://shocksolution.com/posts/how-the-e815-dies/</link><pubDate>Mon, 19 Mar 2007 00:21:30 +0000</pubDate><guid>https://shocksolution.com/posts/how-the-e815-dies/</guid><description>&lt;p&gt;I have a Motorola E815 cell phone.  This morning, I was reminded why it hasn&amp;rsquo;t been an entirely satisfying experience.  The E815 has excellent reception (on Verizon&amp;rsquo;s network) and lots of software features that work really well. Unfortunately the mechanical quality leaves a lot to be desired.  The E815&amp;rsquo;s weakness is the socket where the wall charger attaches.  My first E815 crashed as I was unplugging the charger.  I unplugged it and the phone rebooted.  This had happened several times before, but this time the phone got to a certain point in its boot cycle and rebooted again.  I couldn&amp;rsquo;t even turn it off using the end/power key&amp;ndash;I had to remove the battery.  Fortunately there were about three weeks left on the warranty, and Verizon eventually got me a new one that worked (on the third try).  Last night, I plugged in my phone before bed and set the alarm.  Early this morning the alarm went off, so I opened the phone and hit the &amp;ldquo;end&amp;rdquo; key to shut it up.  The phone rebooted and came back to the alarm screen.  I unplugged it and hit &amp;ldquo;end&amp;rdquo; again, and it worked.  Moral of the story&amp;ndash;be VERY careful when plugging/unplugging your E815 charger, and try not to do anything with the phone when it&amp;rsquo;s plugged in.  Also, sign up for Verizon&amp;rsquo;s free backup service to save your contacts in case the phone dies, and transfer your photos and ringtones to a micro-SD card.&lt;/p&gt;</description></item><item><title>"Ubuntu" actually means "eats your config files"</title><link>https://shocksolution.com/posts/ubuntu-actually-means-eats-your-config-files/</link><pubDate>Wed, 14 Mar 2007 20:08:52 +0000</pubDate><guid>https://shocksolution.com/posts/ubuntu-actually-means-eats-your-config-files/</guid><description>&lt;p&gt;The Dapper-to-Edgy upgrade was surprisingly smooth, once I figured out how to do it. Unfortunately, the new version overwrote my &amp;ldquo;/boot/grub/menu.lst&amp;rdquo; so I could not boot Windows. I have enough experience with Linux that this was a five-minute fix, but it could be pretty scary for an inexperienced person. Who knows what else got over-written and I just didn&amp;rsquo;t realize it. I was further disappointed to find out that the version of &lt;a href="http://pida.co.uk/"&gt;PIDA&lt;/a&gt; in Edgy is broken.&lt;/p&gt;</description></item><item><title>Ubuntu is an African word that means "devours your soul"</title><link>https://shocksolution.com/posts/ubuntu-is-an-african-word-that-means-devours-your-soul/</link><pubDate>Mon, 12 Mar 2007 22:57:45 +0000</pubDate><guid>https://shocksolution.com/posts/ubuntu-is-an-african-word-that-means-devours-your-soul/</guid><description>&lt;p&gt;When it comes to Linux, I&amp;rsquo;m a &lt;a href="http://%3Cwww.gentoo.org%3E" title="Gentoo"&gt;Gentoo&lt;/a&gt; guy. Go ahead, make fun of me and call me a ricer. Then go try to do something difficult on Redhat or Ubuntu, and come back and tell me what you think. I needed a Linux development environment at work, so I took my Windows machine and added a Linux partition. Since Ubuntu has been getting a lot of good press, and I wanted something that would install &lt;em&gt;fast&lt;/em&gt;, I tried Ubuntu. Specifically, I installed Kubuntu, because &lt;a href="http://linux.slashdot.org/article.pl?sid=05/12/13/1340215"&gt;Linus Torvalds doesn&amp;rsquo;t use Gnome&lt;/a&gt;. It really did install quickly and everything worked great out of the box. I installed a number of packages, and they worked too! Too good to be true? Absolutely! It all started when I wanted to compile something. Silly me, I thought &lt;a href="http://gcc.gnu.org/" title="gcc"&gt;gcc&lt;/a&gt; was a basic part of a basic Linux installation&amp;hellip;but no, that must be a Gentoo bias, so I installed gcc. Then I decided to install &lt;a href="http://numpy.scipy.org/" title="numpy"&gt;numpy&lt;/a&gt;, the latest numerical toolkit for Python. It&amp;rsquo;s been around for a couple of years as a beta, so I figured there must be an &amp;ldquo;unstable&amp;rdquo; build out there. Nope. To get numpy, you have to upgrade from Ubuntu 6.06 &amp;ldquo;Dapper&amp;rdquo; to 6.10 &amp;ldquo;Edgy&amp;rdquo;. &amp;lt;sarcasm&amp;gt;Because it makes sense to upgrade gcc, KDE, Firefox, etc just to get a new Python package.&amp;lt;/sarcasm&amp;gt; Now, go find instructions on how to upgrade the Ubuntu distribution. Then try those instructrions and realize that they won&amp;rsquo;t work at all for Kubuntu because the package managers are totally different. While you&amp;rsquo;re there, read the horror stories on the forums from people who followed the &amp;ldquo;official&amp;rdquo; upgrade instructions and ended up with less-than-functioning systems. FYI, the Kubuntu &lt;a href="http://kubuntu.org/announcements/6.10-release.php"&gt;upgrade instructions&lt;/a&gt; are actually easy to find once you know where to look. Kubuntu 6.10 is installing right now, so tomorrow we&amp;rsquo;ll see how it went.&lt;/p&gt;</description></item><item><title>Python calling C++ calling Fortran</title><link>https://shocksolution.com/posts/python-calling-c-calling-fortran/</link><pubDate>Fri, 09 Mar 2007 04:40:03 +0000</pubDate><guid>https://shocksolution.com/posts/python-calling-c-calling-fortran/</guid><description>&lt;p&gt;I got it working a while ago, but I haven&amp;rsquo;t had a chance to update my eager audience.  I built a simple simple simulation tool using this crazy combination of languages.  It&amp;rsquo;s a library written in C++ that uses the finite volume method to simulate diffusion in one dimenstion. What&amp;rsquo;s cool is that it&amp;rsquo;s designed to be called from Python using Boost.  Furthermore, it then uses Boost Bindings (not officially part of Boost) to call LAPACK (a Fortran library) to solve linear equations (as shown in a previous post).  It&amp;rsquo;s pretty cool that all this stuff actually works together.  Why did I do this?  Python is my favorite very-high-level language for doing scientific programming.  Compared to C++ or Fortran, it&amp;rsquo;s just so &lt;em&gt;easy&lt;/em&gt; to do things in Python, like making plots or reading in an xml file.  I chose C++ for the numerical codes because it&amp;rsquo;s faster than Python and the Boost library connects the two.  I could have used Fortran, but the Python interfaces doesn&amp;rsquo;t seem to be as clean, probably because Fortran isn&amp;rsquo;t object-oriented.  Finally, since the reference implementation of LAPACK is still in Fortran, I just used the Boost bindings to call it.  I might switch to a native C++ linear algebra library if a clear leader emerges from the confusing alternatives that are available today.  More complaints on that later&amp;hellip;&lt;/p&gt;</description></item><item><title>Theme construction in progress</title><link>https://shocksolution.com/posts/theme-construction-in-progress/</link><pubDate>Tue, 06 Mar 2007 04:11:06 +0000</pubDate><guid>https://shocksolution.com/posts/theme-construction-in-progress/</guid><description>&lt;p&gt;I&amp;rsquo;m working on a new and improved theme for the lighting page.  It&amp;rsquo;s still a bit rough because I don&amp;rsquo;t have time to finish it today, but I think it looks promising!&lt;/p&gt;</description></item><item><title>Subtle aspects of using Boost and LAPACK</title><link>https://shocksolution.com/posts/subtle-aspects-of-using-boost-and-lapack/</link><pubDate>Tue, 27 Feb 2007 23:43:59 +0000</pubDate><guid>https://shocksolution.com/posts/subtle-aspects-of-using-boost-and-lapack/</guid><description>&lt;p&gt;I spent part of the afternoon wrestling with LAPACK integration in a C++ program, using the unofficial Boost bindings. I learned a couple of interesting things. &lt;a href="https://shocksolution.com/files/test.C" title="test.C"&gt;test.C&lt;/a&gt; is a file that demonstrates them. 1. You need to create column-major matrices to pass to LAPACK. The subtle part about this is that the matrices are internally stored as column-major (like Fortran) but are &lt;em&gt;accessed&lt;/em&gt; like row-major matrices (like C). In other words, even when you declare A as column-major, A(3,5) refers to the third row and fifth column of A. This was not obvious to me. 2. The LAPACK routines may modify the matrices that are passed to them. For example, when using gesv(A,B) to solve a system of linear equations, the matrix B is modified to contain the solution values&amp;ndash;this is obvious. It is not obvious, at first, that the matrix A is also modified (and I don&amp;rsquo;t know what useful information it contains). 3. There does not seem to be any binding to the specialized LAPACK solvers for banded and tri-diagonal matrices. I would like to know why, since my matrix is tri-diagonal and it can probably be solved considerable more quickly.&lt;/p&gt;</description></item><item><title>The need for 3D technical drawing software</title><link>https://shocksolution.com/posts/the-need-for-3d-technical-drawing-software/</link><pubDate>Mon, 26 Feb 2007 21:42:17 +0000</pubDate><guid>https://shocksolution.com/posts/the-need-for-3d-technical-drawing-software/</guid><description>&lt;p&gt;Today I was reminded again of the need for a new kind of technical drawing software.  Here is the problem I am facing: I want to create a vector drawing of a three dimensional structure.  Right now, I can either create it in CAD and export a bitmap, or I can manually draw a 3-D representation using 2-D vector software such as Dia or Xfig.  For publication-quality graphics, the first approach is usually out.  The second approach works, but what if I spend an hour drawing, only to realize that I should have chosen a different perspective or viewpoint to show a critical feature of the drawing?  I have to modify the entire drawing just to change the viewpoint.  Or, what if I need to show two views to capture all the details? I have to create both from scratch. I envion a new type of tool, or CATD (Computer Aided Technical Drawing).  My vision starts with a 3-D CAD tool, which could be built around lines, points, and surfaces (like AutoCAD) or a solid modeling kernel (like SolidWorks).  The user should have the ability to choose surfaces to be transparent or solid, and create cut planes to show internal features.  However, the 3-D model is only the first step. Once the user has created the model and chosen a viewpoint that shows its important features, the 3-D model is projected onto a 2D surface to create a vector drawing that can be further manipulated.  Ideally, the 2-D vectors created from each &amp;ldquo;object&amp;rdquo; in the CAD model would remain grouped together for easy manipulation.  The final output would be a publication-quality PostScript, PDF, or SVG file. I don&amp;rsquo;t know if this is commercially available, but it certainly isn&amp;rsquo;t available as open source.  As a starting point, I propose creating a plugin for Blender that fulfills this purpose.  It would take the 3-D model, as displayed on the screen, and create a vector 2-D representation that can be imported into other software for manipulation. Ultimately, the tool should allow users to import different types of CAD models.  The text should be somehow integrated with LaTeX for seamless typesetting of equations and numbers.&lt;/p&gt;</description></item><item><title>LISP is cool but annoying</title><link>https://shocksolution.com/posts/lisp-is-cool-but-annoying/</link><pubDate>Mon, 26 Feb 2007 05:09:14 +0000</pubDate><guid>https://shocksolution.com/posts/lisp-is-cool-but-annoying/</guid><description>&lt;p&gt;I spent today organizing my personal finances in GnuCash. I also spent a few hours customizing a report, which unfortunately means hacking in Scheme, a &amp;ldquo;dialect&amp;rdquo; of LISP. Don&amp;rsquo;t get me wrong, I actually &lt;em&gt;like&lt;/em&gt; LISP/Scheme quite a bit. What I don&amp;rsquo;t like is writing code in &amp;ldquo;normal&amp;rdquo; languages, like C++ and Python, all week long and then switching to Scheme. Scheme has a totally different syntax and requires a different way of thinking about a problem. Normal language: &lt;code&gt;result = myfunction (argument1, argument2)&lt;/code&gt; Scheme code: &lt;code&gt;(myfunction (argument1 argument2))&lt;/code&gt; If you have never seen a LISP language, find one and check it out. Here are the links I always use:&lt;/p&gt;</description></item><item><title>Lighting for February 11/12</title><link>https://shocksolution.com/posts/lighting-for-february-1112/</link><pubDate>Sat, 17 Feb 2007 22:25:15 +0000</pubDate><guid>https://shocksolution.com/posts/lighting-for-february-1112/</guid><description>&lt;p&gt;Nothing too exciting this weekend in the lighting department. In a change from last time, two Studiospots were flown from a pipe just in front of the stage. I don&amp;rsquo;t think they&amp;rsquo;re real useful in that position because they&amp;rsquo;re too close to the stage to really light a person, and we normally don&amp;rsquo;t use enough haze to make the beams really visible. I used them to create patterns on the white backdrop, but you can&amp;rsquo;t see them very well in this picture.&lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/393068971/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/169/393068971_d86d920768_m.jpg" alt="Indescribable 11 Feb 07"&gt;&lt;/a&gt; We did manage to get some good coordination between the lighting colors and the the background graphics.&lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/393084815/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/50/393084815_9acaafc498_m.jpg" alt="Sacred, look 1, 11 Feb 07"&gt;&lt;/a&gt;&lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/393068958/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/179/393068958_388f8956ac_m.jpg" alt="Breathe, look 1, 11 Feb 07"&gt;&lt;/a&gt; Here&amp;rsquo;s another example of how the camera changes the look of the colors. In this case, the  camera has increased its sensitivity to capture the darker portions of the image, which caused the blue and amber lights on the backdrop to appear much more intense than they actually were. In reality, they were light pastel colors. I need to experiment with my camera to find out if one of the metering modes will improve this. &lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/393068968/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/115/393068968_e42dd5f199_m.jpg" alt="Forever, look 2, 11 Feb 07"&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>The beginning of the lighting blog</title><link>https://shocksolution.com/posts/test/</link><pubDate>Sat, 17 Feb 2007 05:02:40 +0000</pubDate><guid>https://shocksolution.com/posts/test/</guid><description>&lt;p&gt;I&amp;rsquo;m of the lighting operators/designers at &lt;a href="http://discoverychurch.org"&gt;Discovery Church&lt;/a&gt; in Orlando, FL. I&amp;rsquo;ve been doing lighting, off and on, since 2002. Unfortunately I didn&amp;rsquo;t get a digital camera until November 2006 so I don&amp;rsquo;t have much of a record of the early years. Now I&amp;rsquo;m trying to photograph everything I work on. It&amp;rsquo;s partly to help myself improve as a lighting designer, partly for fun, and hopefully somebody else benfits too.  I do try the occasional  &amp;ldquo;artistic&amp;rdquo; shot, but primarily I&amp;rsquo;m concerned with documenting the look rather than taking the perfect photo.  Thus, the performers tend to be blurry because I&amp;rsquo;m using a long exposure (and no flash, of course) to capture the whole stage.&lt;a href="http://%3Cwww.flickr.com/photos/a_mirror_dimly/297697725/%3E"&gt;&lt;img src="http://farm1.static.flickr.com/114/297697725_8be6a88406_m.jpg" alt="Hog1000"&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>About Craig Finch</title><link>https://shocksolution.com/posts/about_craig_finch/</link><pubDate>Fri, 16 Feb 2007 03:27:36 +0000</pubDate><guid>https://shocksolution.com/posts/about_craig_finch/</guid><description>&lt;p&gt;I am a Senior Pre-Sales Cloud Engineer/Solutions Architect with &lt;a href="https://sada.com/"&gt;SADA&lt;/a&gt;, an &lt;a href="https://%3C%3Cwww.insight.com/en_US/home.html&amp;amp;gt%3E;"&gt;Insight&lt;/a&gt; Company. I help customers take full advantage of Google Cloud (Workspace, Maps, and Google Cloud Platform) by providing consultative advice and scoping professional services engagements. I work with mid-sized corporations to large enterprises across a variety of industry verticals, but primarily in high-compliance areas such as fintech and information security.&lt;/p&gt;&#10;&lt;p&gt;Previously, I was a Principal Consultant and co-founder at &lt;a href="http://%3C%3Cwww.rootwork.it&amp;amp;gt%3E;" title="Rootwork%20InfoTech%20LLC"&gt;Rootwork InfoTech LLC&lt;/a&gt;, a professional services business meeting IT infrastructure needs of small to mid-sized organizations. I sold my share of the business to my business parter and co-founder &lt;a href="https://%3C%3Cwww.linkedin.com/in/michaelsoule/&amp;amp;gt%3E;"&gt;Mike Soule&lt;/a&gt;, and he continues to operate the business. If your organization is &amp;ldquo;too small&amp;rdquo; to engage with the major IT services companies, but you need a high level of enterprise-grade infrastructure expertise, please reach out to &lt;a href="https://rootwork.it"&gt;Mike at Rootwork&lt;/a&gt;.&lt;/p&gt;</description></item></channel></rss>