<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Sysadmin on galvanist</title>
    <link>/tags/sysadmin/</link>
    <description>Recent content in Sysadmin on galvanist</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Sat, 28 Mar 2020 18:28:48 +0100</lastBuildDate>
    <atom:link href="/tags/sysadmin/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>macOS JavaScript for Automation (JXA) Notes</title>
      <link>/posts/2020-03-28-jxa_notes/</link>
      <pubDate>Sat, 28 Mar 2020 18:28:48 +0100</pubDate>
      <guid>/posts/2020-03-28-jxa_notes/</guid>
      <description>&lt;h1 id=&#34;overview&#34;&gt;Overview&lt;/h1&gt;&#xA;&lt;p&gt;There is a macOS feature called the &lt;a href=&#34;https://en.wikipedia.org/wiki/AppleScript#Open_Scripting_Architecture&#34;&gt;Open Scripting Architecture&lt;/a&gt; (OSA) which provides an infrastructure for intercommunication and automation of macOS software. One of the officially supported OSA languages is JavaScript and its use in this context is called &amp;ldquo;JavaScript for Automation&amp;rdquo; which is often abbreviated to &amp;ldquo;&lt;strong&gt;JXA&lt;/strong&gt;&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;The idea is that instead of using &lt;a href=&#34;https://en.wikipedia.org/wiki/AppleScript&#34;&gt;AppleScript&lt;/a&gt;, you can program &amp;amp; automate macOS using a more modern language like &lt;a href=&#34;https://en.wikipedia.org/wiki/JavaScript&#34;&gt;JavaScript&lt;/a&gt;. This gives the programmer access to the enormous ecosystem of javascript libraries and tools in addition to all the modern optimizations and language features of ES6-ish JavaScript. JXA also provides access to a built-in Objective-C bridge that enables access to the file system and the ability to call into the Cocoa frameworks and plain C functions. JXA can basically do anything native code can. It&amp;rsquo;s a bit like &lt;a href=&#34;https://en.wikipedia.org/wiki/Node.js&#34;&gt;node&lt;/a&gt; without needing to install node.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Security Resources for Your New Website</title>
      <link>/posts/2020-03-11-security-resources/</link>
      <pubDate>Wed, 11 Mar 2020 23:32:43 +0100</pubDate>
      <guid>/posts/2020-03-11-security-resources/</guid>
      <description>&lt;p&gt;Establishing a reasonable amount of security for a website is a non-trivial unending job. Here are some notes and resources that I find helpful.&lt;/p&gt;&#xA;&lt;h1 id=&#34;web-server-config&#34;&gt;Web Server Config&lt;/h1&gt;&#xA;&lt;h2 id=&#34;start-with-tls&#34;&gt;Start with TLS&lt;/h2&gt;&#xA;&lt;p&gt;All public-facing websites need to be protected by &lt;a href=&#34;https://en.wikipedia.org/wiki/Transport_Layer_Security&#34;&gt;Transport Layer Security&lt;/a&gt; (TLS). TLS is a technology which allows web traffic to be encrypted and this encryption helps to protect the privacy and security of the users of a site.&lt;/p&gt;&#xA;&lt;p&gt;Deploying a site with TLS can be accomplished in a free and automated fashion. Services like &lt;a href=&#34;https://en.wikipedia.org/wiki/Let&#39;s_Encrypt&#34;&gt;Let&amp;rsquo;s Encrypt&lt;/a&gt; and the issuance features of large cloud providers (for example &lt;a href=&#34;https://aws.amazon.com/certificate-manager/&#34;&gt;AWS Certificate Manager&lt;/a&gt;) encourage more secure defaults and automatic management. For more information, check out the &lt;a href=&#34;https://letsencrypt.org/getting-started/&#34;&gt;Let&amp;rsquo;s Encrypt Getting Started Guide&lt;/a&gt; or your hosting provider&amp;rsquo;s documentation.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Non-privileged Python Package Installs on OS X</title>
      <link>/posts/2014-12-10-non-privileged-python-package-installs-on-os-x/</link>
      <pubDate>Wed, 10 Dec 2014 04:35:00 +0000</pubDate>
      <guid>/posts/2014-12-10-non-privileged-python-package-installs-on-os-x/</guid>
      <description>&lt;p&gt;Sometimes a virtualenv isn&amp;rsquo;t what you want. I often want my account to have a particular python package (like bpython), but I also like to keep things clean and compartmentalized. One answer is installing the package to a standard place within your user account&amp;rsquo;s home folder. Python is already setup for this, as you can see if you run &lt;code&gt;python -m site&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;sys&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;path&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s1&#34;&gt;&amp;#39;/Users/someuser&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s1&#34;&gt;&amp;#39;/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s1&#34;&gt;&amp;#39;/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s1&#34;&gt;&amp;#39;/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s1&#34;&gt;&amp;#39;/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s1&#34;&gt;&amp;#39;/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s1&#34;&gt;&amp;#39;/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s1&#34;&gt;&amp;#39;/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s1&#34;&gt;&amp;#39;/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s1&#34;&gt;&amp;#39;/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s1&#34;&gt;&amp;#39;/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s1&#34;&gt;&amp;#39;/Library/Python/2.7/site-packages&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;USER_BASE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;/Users/someuser/Library/Python/2.7&amp;#39;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;doesn&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;t exist)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;USER_SITE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;/Users/someuser/Library/Python/2.7/lib/python/site-packages&amp;#39;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;doesn&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;t exist)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;ENABLE_USER_SITE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;True&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You&amp;rsquo;ll see that python is looking for USER_BASE and USER_SITE directories in particular locations. Let&amp;rsquo;s create them:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Strip Time Machine ACLs</title>
      <link>/posts/2014-08-12-strip-time-machine-acls/</link>
      <pubDate>Tue, 12 Aug 2014 19:55:57 +0000</pubDate>
      <guid>/posts/2014-08-12-strip-time-machine-acls/</guid>
      <description>&lt;p&gt;To strip ACLs from all files in the current working directory, run this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;chmod -R -N .&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You might want to do this kind of thing if you&amp;rsquo;ve restored files from a &lt;a href=&#34;https://en.wikipedia.org/wiki/Time_Machine_%28OS_X%29&#34;&gt;Time Machine&lt;/a&gt; backup by hand, preserving permissions. By default Time Machine backup files have this ACL for everyone:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;deny write,delete,append,writeattr,writeextattr,chown&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Don&amp;rsquo;t change your Time Machine volume, just use this to strip the ACLs of files you copied from it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What Processes Are Listening On Your Ports?</title>
      <link>/posts/2014-04-13-what-processes-are-listening-on-your-ports/</link>
      <pubDate>Sun, 13 Apr 2014 22:18:21 +0000</pubDate>
      <guid>/posts/2014-04-13-what-processes-are-listening-on-your-ports/</guid>
      <description>&lt;h2 id=&#34;lsof&#34;&gt;lsof&lt;/h2&gt;&#xA;&lt;p&gt;On OS X you wanna use &lt;code&gt;sudo lsof -nP -iTCP -sTCP:LISTEN&lt;/code&gt;. The output looks like this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ sudo lsof -nP -iTCP -sTCP:LISTEN&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;COMMAND     PID   USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;launchd       &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;   root   23u  IPv6 0xf01241af1b915325      0t0  TCP *:5900 &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;LISTEN&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;launchd       &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;   root   24u  IPv4 0xf01241af1b91732d      0t0  TCP *:5900 &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;LISTEN&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;launchd       &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;   root   28u  IPv6 0xf01241af1b914ee5      0t0  TCP &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;::1&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;:631 &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;LISTEN&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;launchd       &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;   root   29u  IPv4 0xf01241af1b916b45      0t0  TCP 127.0.0.1:631 &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;LISTEN&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;launchd       &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;   root   31u  IPv6 0xf01241af1b914aa5      0t0  TCP *:22 &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;LISTEN&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;launchd       &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;   root   32u  IPv4 0xf01241af1b91f32d      0t0  TCP *:22 &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;LISTEN&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;mtmfs        &lt;span class=&#34;m&#34;&gt;55&lt;/span&gt;   root    4u  IPv4 0xf01241af1b91eb45      0t0  TCP 127.0.0.1:49152 &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;LISTEN&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;mtmfs        &lt;span class=&#34;m&#34;&gt;55&lt;/span&gt;   root    6u  IPv4 0xf01241af1d38cb45      0t0  TCP 127.0.0.1:49153 &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;LISTEN&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;ssh       &lt;span class=&#34;m&#34;&gt;45193&lt;/span&gt; username    5u  IPv6 0xf01241af1b9128a5      0t0  TCP &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;::1&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;:8000 &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;LISTEN&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;ssh       &lt;span class=&#34;m&#34;&gt;45193&lt;/span&gt; username    6u  IPv4 0xf01241af2405eb45      0t0  TCP 127.0.0.1:8000 &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;LISTEN&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;netstat&#34;&gt;netstat&lt;/h2&gt;&#xA;&lt;p&gt;On many types of Linux you can use &lt;code&gt;lsof&lt;/code&gt;, but also &lt;code&gt;sudo netstat -tulpn&lt;/code&gt;.  The output looks like this:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fixing bpython&#39;s delete</title>
      <link>/posts/2014-02-21-fixing-bpythons-delete/</link>
      <pubDate>Fri, 21 Feb 2014 00:21:00 +0000</pubDate>
      <guid>/posts/2014-02-21-fixing-bpythons-delete/</guid>
      <description>&lt;p&gt;A guy named Shironoo &lt;a href=&#34;http://blog.shironoo.org/2012/04/03/216&#34;&gt;found one solution&lt;/a&gt; (&lt;a href=&#34;http://translate.google.com/translate?u=http%3A%2F%2Fblog.shironoo.org%2F2012%2F04%2F03%2F216&amp;amp;act=url&#34;&gt;which I read in english&lt;/a&gt;) to a problem I&amp;rsquo;d been having with &lt;a href=&#34;https://bitbucket.org/bobf/bpython&#34;&gt;bpython&lt;/a&gt; over SSH. Namely that using the delete key &lt;strong&gt;ruins the world&lt;/strong&gt;, or at least kills the current line.&lt;/p&gt;&#xA;&lt;p&gt;My slightly modified (temporary) solution is to make this change:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;in &lt;code&gt;bpython/cli.py&lt;/code&gt;:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;in &lt;code&gt;def p_key(self, key):&lt;/code&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;replace &lt;code&gt;if platform.system() == &#39;Windows&#39;:&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;with &lt;code&gt;if platform.system() in (&#39;Windows&#39;, &#39;Linux&#39;):&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;You can find your bpython install with this kinda thing:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Your Mac&#39;s Serial Number via the Command Line</title>
      <link>/posts/2014-02-20-your-macs-serial-number-via-the-command-line/</link>
      <pubDate>Thu, 20 Feb 2014 23:54:40 +0000</pubDate>
      <guid>/posts/2014-02-20-your-macs-serial-number-via-the-command-line/</guid>
      <description>&lt;p&gt;Here&amp;rsquo;s my first (admittedly ugly) attempt:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;system_profiler SPHardwareDataType &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; grep &lt;span class=&#34;s1&#34;&gt;&amp;#39;Serial&amp;#39;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; sed &lt;span class=&#34;s1&#34;&gt;&amp;#39;s/^.*\:\ //&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&amp;rsquo;s a &lt;a href=&#34;http://apple.stackexchange.com/questions/40243/how-can-i-find-the-serial-number-on-a-mac-programmatically-from-the-terminal&#34;&gt;better one from stack exchange&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;system_profiler SPHardwareDataType &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;/Serial/ {print $4}&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Check your warranty status:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Update: Within a year or two of this post, Apple disabled direct URL links to hardware warranty checks, so the following no-longer works.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;open &lt;span class=&#34;s2&#34;&gt;&amp;#34;https://selfsolve.apple.com/agreementWarrantyDynamic.do?sn=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;system_profiler SPHardwareDataType &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; awk &lt;span class=&#34;s1&#34;&gt;&amp;#39;/Serial/ {print $4}&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;amp;locale=en_US&amp;amp;caller=sp&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>/Users/Shared/adi</title>
      <link>/posts/2013-11-07-userssharedadi/</link>
      <pubDate>Thu, 07 Nov 2013 22:28:00 +0000</pubDate>
      <guid>/posts/2013-11-07-userssharedadi/</guid>
      <description>&lt;p&gt;This is one for the search engines.&lt;/p&gt;&#xA;&lt;p&gt;If you&amp;rsquo;re running Mac OS X ~v10.8 (or later), you&amp;rsquo;ve probably got a folder at the path &lt;code&gt;/Users/Shared/adi&lt;/code&gt;. Like me, you might be wondering what it is. I did some googling and got nothing. I dug a little further and found (part of) the answer: &lt;strong&gt;It is used by the Mac App Store and the new iBooks app.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;In case you&amp;rsquo;re interested, here are the steps I took to arrive at this answer:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Direct SMTP Nagios Notifications</title>
      <link>/posts/2013-09-16-direct-smtp-nagios-notifications/</link>
      <pubDate>Mon, 16 Sep 2013 22:13:18 +0000</pubDate>
      <guid>/posts/2013-09-16-direct-smtp-nagios-notifications/</guid>
      <description>&lt;p&gt;If you want &lt;a href=&#34;http://www.nagios.org/&#34;&gt;nagios&lt;/a&gt; email notifications but don&amp;rsquo;t want to run a local MTA (like postfix, exim, qmail, or sendmail), you&amp;rsquo;ll need a command-line SMTP client. Such a program can connect to an SMTP server, authenticate, and generate a message based on input arguments and file handles. One such program is &lt;a href=&#34;http://caspian.dotconf.net/menu/Software/SendEmail/&#34;&gt;sendEmail&lt;/a&gt; (note, not &amp;ldquo;sendmail&amp;rdquo;).&lt;/p&gt;&#xA;&lt;p&gt;I found myself wanting to use sendEmail with nagios, and I found these helpful resources:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://exchange.nagios.org/directory/Addons/Notifications/Notifications-using-ISP-SMTP-server-with-Authentication/details&#34;&gt;http://exchange.nagios.org/directory/Addons/Notifications/Notifications-using-ISP-SMTP-server-with-Authentication/details&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://danxlog.blogspot.com/2010/07/nagios-use-external-smtp-server-to-send.html&#34;&gt;http://danxlog.blogspot.com/2010/07/nagios-use-external-smtp-server-to-send.html&lt;/a&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
