<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Linux on shocksolution.com</title><link>https://shocksolution.com/tags/linux/</link><description>Recent content in Linux on shocksolution.com</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 30 Nov 2021 03:20:26 +0000</lastBuildDate><atom:link href="https://shocksolution.com/tags/linux/index.xml" rel="self" type="application/rss+xml"/><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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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></channel></rss>