<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DigitalFormula</title>
	<atom:link href="https://www.digitalformula.net/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.digitalformula.net</link>
	<description>Creating stuff since yesterday</description>
	<lastBuildDate>Sat, 30 Apr 2022 13:55:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2</generator>
	<item>
		<title>Fix Music on Console (moc) on Arch Linux</title>
		<link>https://www.digitalformula.net/2022/software/fix-music-on-console-moc-on-arch-linux/</link>
					<comments>https://www.digitalformula.net/2022/software/fix-music-on-console-moc-on-arch-linux/#respond</comments>
		
		<dc:creator><![CDATA[chris]]></dc:creator>
		<pubDate>Fri, 22 Apr 2022 08:42:59 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[arch]]></category>
		<category><![CDATA[moc]]></category>
		<category><![CDATA[mocp]]></category>
		<category><![CDATA[patch]]></category>
		<guid isPermaLink="false">https://www.digitalformula.net/?p=1001189</guid>

					<description><![CDATA[<p>The Problem In this quick article I&#8217;ll go over the process to fix moc (Music on Console) not starting properly on Arch Linux. Firstly, at the time of writing this article the current &#60;a href=&#34;https://wiki.archlinux.org/title/MOC&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34;&#62;moc&#60;/a&#62; version is moc-1:2.5.2-5. Future releases may fix the issue described below. Usually, installing moc on Arch Linux [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2022/software/fix-music-on-console-moc-on-arch-linux/">Fix Music on Console (moc) on Arch Linux</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">The Problem</h2>



<p>In this quick article I&#8217;ll go over the process to fix <code>moc</code> (Music on Console) not starting properly on Arch Linux.</p>



<p>Firstly, at the time of writing this article the current <code>&lt;a href=&quot;https://wiki.archlinux.org/title/MOC&quot; target=&quot;_blank&quot; rel=&quot;noreferrer noopener&quot;&gt;moc&lt;/a&gt;</code> version is <code>moc-1:2.5.2-5</code>.  Future releases may fix the issue described below.</p>



<p>Usually, installing moc on Arch Linux should be a simple case of running the following command:</p>



<pre class="wp-block-prismatic-blocks"><code class="language-">sudo pacman -S moc</code></pre>



<p>And, in fact, installing <code>moc</code> with pacman will appear to succeed without any issues:</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="631" src="https://www.digitalformula.net/wp-content/uploads/2022/04/image-1024x631.png" alt="" class="wp-image-1001191" srcset="https://www.digitalformula.net/wp-content/uploads/2022/04/image-1024x631.png 1024w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-300x185.png 300w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-768x473.png 768w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-1200x740.png 1200w, https://www.digitalformula.net/wp-content/uploads/2022/04/image.png 1262w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Installing moc using Pacman &#8230; looks good, right?</figcaption></figure>



<p>Unfortunately, when you now try to run <code>mocp</code>, the following exception is immediately thrown:</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="153" src="https://www.digitalformula.net/wp-content/uploads/2022/04/image-1-1024x153.png" alt="" class="wp-image-1001192" srcset="https://www.digitalformula.net/wp-content/uploads/2022/04/image-1-1024x153.png 1024w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-1-300x45.png 300w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-1-768x114.png 768w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-1-1200x179.png 1200w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-1.png 1261w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Immediate exception when running <code>mocp</code> for the first time</figcaption></figure>



<p>&#8230; what the hell?</p>



<h2 class="wp-block-heading">The Fix</h2>



<p>Due to a bug in <code>glibc</code> 2.35, a patch needs to be applied to the <code>moc</code> package build files, after which the package can be rebuilt and the resulting binaries + docs + libs copied over those installed by <code>pacman</code>.</p>



<p>Because this is an Arch Linux article, I&#8217;ll assume you already have <code>git</code> installed.  Let&#8217;s go.</p>



<ul><li>Firstly, grab the moc package build files</li></ul>



<pre class="wp-block-prismatic-blocks"><code class="language-bash">git clone -b packages/moc --single-branch https://github.com/archlinux/svntogit-packages</code></pre>



<ul><li>Enter the main source directory and open the PKGBUILD file for editing (use any editor that suits you)</li></ul>



<pre class="wp-block-prismatic-blocks"><code class="language-bash">vim PKGBUILD</code></pre>



<ul><li>Modify the <code>source</code> array as follows, making sure to keep the quotes intact:</li></ul>



<pre class="wp-block-prismatic-blocks"><code class="language-bash">source=(http://ftp.daper.net/pub/soft/moc/stable/${pkgname}-${pkgver}.tar.bz2{,.sig}
        moc-ffmpeg4.patch
        moc-https.patch
        &quot;glibc-2.35.patch::https://bugs.archlinux.org/task/74041?getfile=21255&quot;)</code></pre>



<ul><li>Modify the <code>prepare()</code> function as follows:</li></ul>



<pre class="wp-block-prismatic-blocks"><code class="language-bash">prepare() {
  cd $pkgname-$pkgver
  patch -p0 -i ../moc-ffmpeg4.patch # Fix build with ffmpeg 4
  patch -p0 -i ../moc-https.patch  # Allow https for urls https://moc.daper.net/node/1872
  patch -p0 -i ../glibc-2.35.patch # FS74041
}</code></pre>



<ul><li>Save the PKGBUILD file and close the editor</li><li>Build the package, making sure to tell the process to skip integrity checks.</li></ul>



<pre class="wp-block-prismatic-blocks"><code class="language-bash">makepkg --skipinteg</code></pre>



<p>The <code>man</code> page for the <code>makepkg --skipinteg</code> parameter is as follows:</p>



<blockquote class="wp-block-quote"><p>Do not perform any integrity checks (checksum and PGP) on source files.</p><cite>makepkg man page, &#8211;skipinteg parameter info</cite></blockquote>



<p>When an error occurs indicating the current file being patched can&#8217;t be found, it&#8217;s a simple case of entering <code>utf8.c</code> and pressing enter:</p>



<pre class="wp-block-prismatic-blocks"><code class="language-bash">patching file files.c
can&#039;t find file to patch at input line 32
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
&lt;TRIMMED&gt;
File to patch: utf8.c</code></pre>



<p>If the build process is successful, the output will end something like this:</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="302" src="https://www.digitalformula.net/wp-content/uploads/2022/04/image-2-1024x302.png" alt="" class="wp-image-1001193" srcset="https://www.digitalformula.net/wp-content/uploads/2022/04/image-2-1024x302.png 1024w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-2-300x88.png 300w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-2-768x226.png 768w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-2-1200x354.png 1200w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-2.png 1262w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption><code>makepkg --skipinteg</code> completed, including entering <code>utf8.c</code> when prompted</figcaption></figure>



<h2 class="wp-block-heading">Updating moc Installation</h2>



<p>A successful build will result in a new <code>moc</code> package in the <code>pkg</code> directory.  The contents of the package&#8217;s root directory are nothing more than a <code>usr</code> directory, as follows:</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="194" src="https://www.digitalformula.net/wp-content/uploads/2022/04/image-3-1024x194.png" alt="" class="wp-image-1001194" srcset="https://www.digitalformula.net/wp-content/uploads/2022/04/image-3-1024x194.png 1024w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-3-300x57.png 300w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-3-768x146.png 768w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-3-1200x228.png 1200w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-3.png 1260w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Contents of new <code>moc</code> package</figcaption></figure>



<p>The last step is to copy those files into place, overwriting existing files.  This assumes you&#8217;ve already changed to the <code>pkg/moc</code> directory.</p>



<pre class="wp-block-prismatic-blocks"><code class="language-bash">cd usr
sudo cp -R * /usr</code></pre>



<p>By default there&#8217;s no output after copying these files:</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="201" src="https://www.digitalformula.net/wp-content/uploads/2022/04/image-4-1024x201.png" alt="" class="wp-image-1001195" srcset="https://www.digitalformula.net/wp-content/uploads/2022/04/image-4-1024x201.png 1024w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-4-300x59.png 300w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-4-768x151.png 768w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-4-1200x235.png 1200w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-4.png 1259w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Copying newly built <code>moc</code> files into place</figcaption></figure>



<h2 class="wp-block-heading">Test moc</h2>



<p>So now there&#8217;s only one thing left to do &#8230; run <code>mocp</code>!</p>



<pre class="wp-block-prismatic-blocks"><code class="language-bash">mocp</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="405" src="https://www.digitalformula.net/wp-content/uploads/2022/04/image-5-1024x405.png" alt="" class="wp-image-1001197" srcset="https://www.digitalformula.net/wp-content/uploads/2022/04/image-5-1024x405.png 1024w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-5-300x119.png 300w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-5-768x304.png 768w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-5-1200x475.png 1200w, https://www.digitalformula.net/wp-content/uploads/2022/04/image-5.png 1261w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption><code>mocp</code> running after being patched and rebuilt</figcaption></figure>



<h2 class="wp-block-heading">Disclaimer</h2>



<p>Thanks to the participants in the <a href="https://bugs.archlinux.org/task/74041" target="_blank" rel="noreferrer noopener">Arch Linux bug tracker</a> for this info.  Given the time I spent finding a process that actually worked (poor Google fu, maybe), I&#8217;m keeping a record of it here so I can refer back later, if required.</p>



<p>Hope it helps someone.</p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2022/software/fix-music-on-console-moc-on-arch-linux/">Fix Music on Console (moc) on Arch Linux</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.digitalformula.net/2022/software/fix-music-on-console-moc-on-arch-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Pop OS/Ubuntu: Detecting USB Security Key Events</title>
		<link>https://www.digitalformula.net/2021/linux/pop-os-ubuntu-detecting-usb-security-key-insert-removal/</link>
					<comments>https://www.digitalformula.net/2021/linux/pop-os-ubuntu-detecting-usb-security-key-insert-removal/#respond</comments>
		
		<dc:creator><![CDATA[chris]]></dc:creator>
		<pubDate>Wed, 25 Aug 2021 04:36:23 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[udev]]></category>
		<category><![CDATA[yubikey]]></category>
		<guid isPermaLink="false">https://www.digitalformula.net/?p=1001073</guid>

					<description><![CDATA[<p>Security keys such as the Yubikey from Yubico have become much more popular in recent times, showing an increased focus on security best practices. Many people are already aware of Multi-Factor Authentication or MFA, since many secure online services (e.g. banks, government portals) have mandated the use of a physical device or one-time access codes [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2021/linux/pop-os-ubuntu-detecting-usb-security-key-insert-removal/">Pop OS/Ubuntu: Detecting USB Security Key Events</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Security keys such as the <a rel="noreferrer noopener" href="https://www.yubico.com/" target="_blank">Yubikey from Yubico</a> have become much more popular in recent times, showing an increased focus on security best practices.  Many people are already aware of Multi-Factor Authentication or MFA, since many secure online services (e.g. banks, government portals) have mandated the use of a physical device or one-time access codes before using their services.  To learn more about MFA, please check out the <a rel="noreferrer noopener" href="https://en.wikipedia.org/wiki/Multi-factor_authentication" target="_blank">Wikipedia article on MFA</a>.</p>



<p>Since you&#8217;re here, you know what MFA is so let&#8217;s look at what I needed to achieve.  Simply:</p>



<blockquote class="wp-block-quote"><p>Upon USB security key insertion or removal, detect that event and &#8220;do something&#8221; in response.</p><cite>&#8211; My requirements  <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></cite></blockquote>



<p>My environment:</p>



<ul><li><a rel="noreferrer noopener" href="https://blog.system76.com/post/655369428109869056/popos-2104-a-release-of-cosmic-proportions" target="_blank">Pop OS 21.04</a> Linux (based on Ubuntu)</li><li>Yubikey USB security key</li></ul>



<p>What I&#8217;m not going to cover:</p>



<ul><li>How to configure your Yubikey for use in Linux.  To learn more, please see the <a rel="noreferrer noopener" href="https://www.yubico.com/setup/" target="_blank">official Yubico documentation</a></li><li>Which Linux distributions use or don&#8217;t use <code>udev</code> &#8211; that&#8217;s on you</li></ul>



<h2 class="wp-block-heading">Get Info About Security Key</h2>



<p>For all this to work, we&#8217;ll rely on <code>udev</code>.  Using the built-in tools that are provided with various Linux distributions, we first need to get some info about your security key.  Your output will vary greatly depending on events happening in your system and also on the model of security key you are using.</p>



<ul><li>Disconnect/remove your security key from your system</li><li>Open a terminal and start monitoring <code>udev</code> events:</li></ul>



<pre class="wp-block-prismatic-blocks"><code class="language-bash">udevadm monitor --property</code></pre>



<p>Successfully starting the monitor will show this:</p>



<pre class="wp-block-prismatic-blocks"><code class="language-bash">~ ❯
~ ❯ udevadm monitor --property
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent</code></pre>



<p><strong>Note</strong>: In the output below, I&#8217;ve removed some info and replaced it with <strong>[removed]</strong>.</p>



<ul><li>Insert your security key and note the extensive output shown in your terminal window.  The specific section looks like this on my system:</li></ul>



<pre class="wp-block-prismatic-blocks"><code class="language-bash">UDEV  [52954.592536] add      /devices/pci0000:40/0000:40:01.1/0000:41:00.0/0000:42:08.0/0000:48:00.3/usb9/9-4/9-4:1.0/0003:1050:0407.001C/input/input40/event6 (input)
ACTION=add
DEVPATH=/devices/pci0000:40/0000:40:01.1/0000:41:00.0/0000:42:08.0/0000:48:00.3/usb9/9-4/9-4:1.0/0003:1050:0407.001C/input/input40/event6
SUBSYSTEM=input
DEVNAME=/dev/input/event6
SEQNUM=28039
USEC_INITIALIZED=52954592318
ID_INPUT=1
ID_INPUT_KEY=1
ID_INPUT_KEYBOARD=1
ID_VENDOR=Yubico
ID_VENDOR_ENC=Yubico
ID_VENDOR_ID=1050
ID_MODEL=[COPY_THIS_VALUE]
ID_MODEL_ENC=[removed]
ID_MODEL_ID=[removed]
ID_REVISION=[removed]
ID_SERIAL=[removed]
ID_TYPE=hid
ID_BUS=usb
ID_USB_INTERFACES=:030101:030000:0b0000:
ID_USB_INTERFACE_NUM=00
ID_USB_DRIVER=usbhid
.INPUT_CLASS=kbd
ID_PATH=pci-0000:48:00.3-usb-0:4:1.0
ID_PATH_TAG=pci-0000_48_00_3-usb-0_4_1_0
XKBLAYOUT=au
BACKSPACE=guess
XKBMODEL=pc105
XKBVARIANT=
XKBOPTIONS=
ID_SECURITY_TOKEN=1
ID_FOR_SEAT=input-pci-0000_48_00_3-usb-0_4_1_0
.LOCAL_ifNum=00
LIBINPUT_DEVICE_GROUP=3/1050/407:usb-0000:48:00.3-4
MAJOR=13
MINOR=70
DEVLINKS=[removed]
TAGS=:uaccess:power-switch:seat:
CURRENT_TAGS=:uaccess:power-switch:seat:</code></pre>



<ul><li>Three things are of particular interest here:<ul><li><code>ACTION</code> is <code>add</code></li><li><code>SUBSYSTEM</code> is <code>input</code> </li><li><code>ID_MODEL</code> is <code>YubiKey_[some_stuff_here]</code> &#8211; note down the value of this property now, as you&#8217;ll need it shortly</li></ul></li><li>Remove your security key and again note the extensive output shown in the terminal.  The relevant block looks similar to before but with one main difference:<ul><li><code>ACTION</code> is <code>remove</code></li></ul></li><li>Hit Ctrl-C to stop the udev monitoring</li></ul>



<p>Now that we have the necessary info about our security key, we can proceed.</p>



<h2 class="wp-block-heading">The &#8220;Do Something&#8221; Part</h2>



<p>The &#8220;do something&#8221; part of this article will be different for everyone, meaning the scripts below are examples only.  Here are the components of this setup:</p>



<ul><li>Script called <code>yubikey</code>, located in my home directory:</li></ul>



<pre class="wp-block-prismatic-blocks"><code class="language-">#!/bin/bash

if [ &quot;$1&quot; == &quot;removed&quot; ]
then
    echo &quot;Oi, Yubikey has been removed!&quot; &gt; /home/me/yubikey_status.txt
else
    echo &quot;K, Yubikey found.  Secure all the things!&quot; &gt; /home/me/yubikey_status.txt
fi</code></pre>



<ul><li>Text file named <code>yubikey_status.txt</code> in my home directory:</li></ul>



<pre class="wp-block-prismatic-blocks"><code class="language-bash">unknown</code></pre>



<ul><li>The <code>watch</code> command can be used  to monitor file contents:</li></ul>



<pre class="wp-block-prismatic-blocks"><code class="language-bash">watch cat ~/yubikey_status.txt</code></pre>



<p>Reacting to a security key removal event will likely be accompanied with an action such as locking the screen, sending an email or displaying a message.  For now, this is what we&#8217;ll see:</p>



<pre class="wp-block-prismatic-blocks"><code class="language-bash">Every 2.0s: cat /home/me/yubikey_status.txt

unknown</code></pre>



<h2 class="wp-block-heading">Detecting Security Key Insertion/Removal</h2>



<p><code>udev</code> will be used to handle the USB insertion/removal events, using custom <code>udev</code> rules stored in <code>/etc/udev/rules.d</code>.</p>



<p>Privilege escalation via <code>sudo</code> (or similar) will be required to create and edit these files.</p>



<p>To learn more about how these files are named, please see the official <a rel="noreferrer noopener" href="https://www.freedesktop.org/software/systemd/man/udev.html" target="_blank">udev documentation</a>.</p>



<ul><li>Create a file named <code>/etc/udev/rules.d/90-yubikey.rules</code>, containing the following content:</li></ul>



<pre class="wp-block-prismatic-blocks"><code class="language-">ACTION==&quot;add&quot;, SUBSYSTEM==&quot;input&quot;, ENV{ID_MODEL}==&quot;[ID_MODEL_COPIED_EARLIER_GOES_HERE]&quot;, RUN+=&quot;/home/me/yubikey inserted&quot;
ACTION==&quot;remove&quot;, SUBSYSTEM==&quot;input&quot;, ENV{ID_MODEL}==&quot;[ID_MODEL_COPIED_EARLIER_GOES_HERE]&quot;, RUN+=&quot;/home/me/yubikey removed&quot;</code></pre>



<p>These <code>udev</code> rules complete the following actions:</p>



<ul><li>Watches for both <code>add</code> and <code>remove</code> events</li><li>Matching events must occur in the <code>INPUT</code> subsystem</li><li>The matching events must occur for devices matching the specified <code>ID_MODEL</code></li><li>When a matching event occurs, the <code>~/yubikey</code> script executes<ul><li><code>inserted</code> command-line parameter if the device was added</li><li><code>removed</code> command-line parameter if the device was removed</li></ul></li><li>The <code>~/yubikey</code> script will write content to the <code>~/yubikey_status.txt</code> file depending on the value of the <code>$1</code> parameter i.e. the first parameter on the command line</li></ul>



<h2 class="wp-block-heading">Reloading <code>udev</code> Configuration</h2>



<p>We can dynamically reload the udev rules by running the following command:</p>



<pre class="wp-block-prismatic-blocks"><code class="language-bash">sudo udevadm control --reload</code></pre>



<h2 class="wp-block-heading">Testing</h2>



<ul><li>Run the <code>watch</code> command above if it&#8217;s not already running</li><li>Insert your security key</li><li>If everything has been configured correctly and your <code>udev</code> rules have been reloaded, you&#8217;ll see the <code>watch</code> command output change as follows:</li></ul>



<pre class="wp-block-prismatic-blocks"><code class="language-bash">Every 2.0s: cat /home/me/yubikey_status.txt

K, Yubikey found.  Secure all the things!</code></pre>



<ul><li>Conversely, removing the security key will run the script again, causing the output to change as follows, as the contents of the <code>~/yubikey_status.txt</code> file changes:</li></ul>



<pre class="wp-block-prismatic-blocks"><code class="language-bash">Every 2.0s: cat /home/me/yubikey_status.txt

Oi, Yubikey has been removed!</code></pre>



<h2 class="wp-block-heading">Wrapping Up</h2>



<p>That&#8217;s all there is to it.  Hopefully this was useful for someone.</p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2021/linux/pop-os-ubuntu-detecting-usb-security-key-insert-removal/">Pop OS/Ubuntu: Detecting USB Security Key Events</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.digitalformula.net/2021/linux/pop-os-ubuntu-detecting-usb-security-key-insert-removal/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Packagist &#038; Github &#8211; How-To Guide</title>
		<link>https://www.digitalformula.net/2014/uncategorized/packagist-github-guide/</link>
					<comments>https://www.digitalformula.net/2014/uncategorized/packagist-github-guide/#respond</comments>
		
		<dc:creator><![CDATA[chris]]></dc:creator>
		<pubDate>Sun, 11 May 2014 08:44:19 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[packagist]]></category>
		<category><![CDATA[php]]></category>
		<guid isPermaLink="false">http://digitalformula.net/?p=1000763</guid>

					<description><![CDATA[<p>I&#8217;ve got a few PHP libraries and classes that I use regularly and, since making the decision to base all my projects on the Laravel framework, have gotten fairly used to installing packages using Composer. I battled occasionally with getting my libraries to work with Laravel, mostly because of the way I&#8217;d written them, but [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2014/uncategorized/packagist-github-guide/">Packagist &#038; Github &#8211; How-To Guide</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve got a few PHP libraries and classes that I use regularly and, since making the decision to base all my projects on the Laravel framework, have gotten fairly used to installing packages using Composer.</p>
<p>I battled occasionally with getting my libraries to work with Laravel, mostly because of the way I&#8217;d written them, but I figured the smart way forward would be to make them available to other Composer users.  For PHP, this means structuring the libraries in a specific way and making them available through Packagist, &#8220;The PHP package archivist&#8221;.  You probably know this already, but when you add a package to your project&#8217;s composer.json file, Packagist is where it gets downloaded from.</p>
<p>Anyway, after some searching around, I found a bunch of articles that covered how to do *some* of the things needed to create Packagist packages, but no decent end-to-end guide.</p>
<p>So here we go &#8211; I&#8217;m going to write one.  Hopefully it comes in useful.</p>
<h2>Pre-requisites &amp; initial steps</h2>
<ul>
<li>Sign up for Github.  It&#8217;s free until you need to go beyond their basic account limitations.  Packagist packages are based on Github repository *releases* (or tags).</li>
<li>Get familiar with <a href="http://semver.org" title="Semantic Versioning">Semantic Versioning</a>, if you haven&#8217;t already.</li>
<li>Sign up for Packagist.  It&#8217;s also free.</li>
<li>Decide on your *vendor* name &#8211; mine is &#8216;digitalformula&#8217;.</li>
<li><a href="https://getcomposer.org/doc/00-intro.md" title="Install Composer">Install Composer</a></li>
</ul>
<p>It&#8217;s an excellent idea to have the same usernames on Github and Packagist, if possible.</p>
<h2>Creating the base package structure</h2>
<p>Create the directory structure for your package.  There&#8217;s no &#8220;right&#8221; way to do this, but I&#8217;m following the structure used by almost every Packagist package I&#8217;ve installed so far.  The structure below is for the package we&#8217;ll be creating in this article.</p>
<p><img decoding="async" loading="lazy" src="http://www.digitalformula.net/wp-content/uploads/2014/05/packagist-structure1.jpg" alt="Packagist directory structure" width="325" height="288" class="alignnone size-full wp-image-1000780"></p>
<p>Here&#8217;s a basic explanation of what each part is.</p>
<ul>
<li>digitalformula &#8211; your *vendor* name, your Github username and your Packagist username.</li>
<li>hello-world &#8211; the name of the package, following proper directory naming guidelines.</li>
<li>.git &#8211; Git repository information.  This gets generated by git when you run &#8216;git init&#8217; below.</li>
<li>.gitignore &#8211; list of files that should be ignored during git adds and commits.  Each line should contain a filename, path or pattern.</li>
<li>src &#8211; the &#8216;root&#8217; directory for your package.  It&#8217;s also where we&#8217;ll tell the PSR-0 autoloader to look &#8211; we&#8217;ll get to that in a bit.</li>
<li>DigitalFormula &#8211; the first segment of the PHP namespace we&#8217;ll use.  This must match your vendor name although at this point you&#8217;re free to use appropriate capitalisation, if you like.</li>
<li>HelloWorld &#8211; the second segment of the PHP namespace we&#8217;ll use.</li>
<li>HelloWorld.php &#8211; the PHP file containing our package&#8217;s code.  Obviously more complex packages will have multiple files, but a single file will suit us just fine for now.</li>
<li>LICENSE &#8211; the license that covers usage of your package.</li>
<li>README.md &#8211; information about your package.  Every Github repository should have one.</li>
<li>composer.json &#8211; probably the most important file here.  It describes your package, what it&#8217;s for, who worked on it, dependencies and how PSR-0 autoloading will work.  Unless you&#8217;re interested in the technicalities (I&#8217;m not), don&#8217;t worry about how PSR-0 works.  It just works, I promise.</li>
</ul>
<p>For those wondering, the complete PHP namespace will be *DigitalFormula\HelloWorld*.</p>
<p>Hold on &#8230; namespace?  What&#8217;s that?  If you&#8217;re not already familiar with PHP namespacing, I highly recommend reading Dayle Rees&#8217; excellent <a href="http://daylerees.com/php-namespaces-explained" title="PHP Namespaces Explained">PHP Namespaces Explained</a> article.</p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2014/uncategorized/packagist-github-guide/">Packagist &#038; Github &#8211; How-To Guide</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.digitalformula.net/2014/uncategorized/packagist-github-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Set network interface IP address with Powershell</title>
		<link>https://www.digitalformula.net/2012/uncategorized/set-network-interface-ip-address-with-powershell/</link>
					<comments>https://www.digitalformula.net/2012/uncategorized/set-network-interface-ip-address-with-powershell/#respond</comments>
		
		<dc:creator><![CDATA[chris]]></dc:creator>
		<pubDate>Wed, 25 Jan 2012 11:38:08 +0000</pubDate>
				<category><![CDATA[Archived]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://digitalformula4.local/?p=110</guid>

					<description><![CDATA[<p>The Problem While setting up our partner technology centre recently, I found myself switching back and forth between networks so often that I was constantly having to change my laptop’s IP address. For reasons that are outside the scope of this article I’m unable to use the option for an alternate network configuration. Powershell to [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2012/uncategorized/set-network-interface-ip-address-with-powershell/">Set network interface IP address with Powershell</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2 id="theproblem">The Problem</h2>
<p>While setting up our partner technology centre recently, I found myself switching back and forth between networks so often that I was constantly having to change my laptop’s IP address. For reasons that are outside the scope of this article I’m unable to use the option for an alternate network configuration.</p>
<h2 id="powershelltotherescue">Powershell to the rescue</h2>
<p>The solution? Two small Powershell scripts &#8211; one to setup my network connection for our corporate LAN, the other to setup my network connection for the PTC. The scripts are shown below &#8211; feel free to use them in any way you like.</p>
<h2>PTC configuration script {#ptcconfigurationscript} </p>
<pre class="brush: powershell; title: ; notranslate"> $index = (gwmi Win32_NetworkAdapter | where {$&#95;.netconnectionid -eq “Local Area Connection”}).InterfaceIndex $NetInterface = Get-WmiObject Win32&#95;NetworkAdapterConfiguration | where {$_.InterfaceIndex -eq $index} $NetInterface.EnableStatic(“10.0.0.10”, “255.255.255.0”) $NetInterface.SetDynamicDNSRegistration(“FALSE”) </pre>
</h2>
<h2 id="corporatelanconfigurationscript">Corporate LAN configuration script</h2>
<p>This script just resets the network adapter back to DHCP </p>
<pre class="brush: powershell; title: ; notranslate"> $index = (gwmi Win32_NetworkAdapter | where {$&#95;.netconnectionid -eq “Local Area Connection”}).InterfaceIndex $NetInterface = Get-WmiObject Win32&#95;NetworkAdapterConfiguration | where {$_.InterfaceIndex -eq $index} $NetInterface.EnableDHCP() $NetInterface.SetDynamicDNSRegistration(“TRUE”) </pre>
</p>
<h2 id="extrastuff">Extra stuff</h2>
<p>Although I don’t need them in my PTC environment (it’s internal only, with no internet access), you can also use the snippets below to add some extra functionality. Set gateway: </p>
<pre class="brush: powershell; title: ; notranslate"> $NetInterface.SetGateways($gateway) </pre>
<p> Set DNS server search order: </p>
<pre class="brush: powershell; title: ; notranslate"> $NetInterface.SetDNSServerSearchOrder($dns) # (e.g. “10.10.1.1” for single server or “10.10.1.1,10.10.1.2” for multiple servers) </pre>
<p> Enable dynamic DNS registration (e.g. in AD environment): </p>
<pre class="brush: powershell; title: ; notranslate"> $NetInterface.SetDynamicDNSRegistration($registerDns) </pre></p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2012/uncategorized/set-network-interface-ip-address-with-powershell/">Set network interface IP address with Powershell</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.digitalformula.net/2012/uncategorized/set-network-interface-ip-address-with-powershell/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>ExpressionEngine Plugin &#8211; Entry Age</title>
		<link>https://www.digitalformula.net/2011/uncategorized/expressionengine-plugin-entry-age/</link>
					<comments>https://www.digitalformula.net/2011/uncategorized/expressionengine-plugin-entry-age/#respond</comments>
		
		<dc:creator><![CDATA[chris]]></dc:creator>
		<pubDate>Sat, 16 Jul 2011 12:33:54 +0000</pubDate>
				<category><![CDATA[Archived]]></category>
		<category><![CDATA[ExpressionEngine]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://digitalformula4.local/?p=106</guid>

					<description><![CDATA[<p>Today I threw together a quick plugin as I couldn&#8217;t find an easy way of doing what I wanted without putting JavaScript in my templates.&#160;&#160;The plugin, called &#8216;Entry Age&#8217;, allows you to specify a message that can be displayed if the entry being viewed is older than a certain age. Why a plugin? I&#8217;m assuming [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2011/uncategorized/expressionengine-plugin-entry-age/">ExpressionEngine Plugin &#8211; Entry Age</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>
Today I threw together a quick plugin as I couldn&#8217;t find an easy way of doing what I wanted without putting JavaScript in my templates.&nbsp;&nbsp;The plugin, called &#8216;Entry Age&#8217;, allows you to specify a message that can be displayed if the entry being viewed is older than a certain age.
</p>
<h2>Why a plugin?</h2>
<p>
I&#8217;m assuming that someone else out there will find this useful.&nbsp;&nbsp;I&#8217;m sure plugins like this exist already but, if they do, I can&#8217;t find them.
</p>
<p>
For an example of what the plugin looks like when it finds an outdated entry, please see this article: <a href="http://www.digitalformula.net/articles/move-expressionengine-to-a-different-server" title="Move ExpressionEngine to a different server" target="_blank">Move ExpressionEngine to a different server</a> (and yes, the content there is actually outdated).</p>
<h2>Can I get it?</h2>
<p>
Of course you can.&nbsp;&nbsp;If you want to download Entry Age and try it out, you can head over to my GitHub page any time.  <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" />  <a href="https://github.com/digitalformula/ee-entry-age" title="Entry Age 1.0 on GitHub">Entry Age 1.0 on GitHub</a>.
</p>
<p>
Hope it helps someone.</p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2011/uncategorized/expressionengine-plugin-entry-age/">ExpressionEngine Plugin &#8211; Entry Age</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.digitalformula.net/2011/uncategorized/expressionengine-plugin-entry-age/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Pimp My Desktop using GeekTool</title>
		<link>https://www.digitalformula.net/2011/uncategorized/pimp-my-desktop-using-geektool/</link>
					<comments>https://www.digitalformula.net/2011/uncategorized/pimp-my-desktop-using-geektool/#respond</comments>
		
		<dc:creator><![CDATA[chris]]></dc:creator>
		<pubDate>Sat, 21 May 2011 06:33:29 +0000</pubDate>
				<category><![CDATA[Archived]]></category>
		<category><![CDATA[Mac & OS X]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://digitalformula4.local/?p=102</guid>

					<description><![CDATA[<p>Continuing with the theme of pimping various aspects of the OS X system configuration, today&#8217;s article covers how to use GeekTool 3 to display useful info on your OS X desktop.&#160;&#160;For those that missed it, one of my recent articles, &#34;Pimp My Prompt &#8230; like Paul Irish covered using the .bash_profile script to add some [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2011/uncategorized/pimp-my-desktop-using-geektool/">Pimp My Desktop using GeekTool</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>
Continuing with the theme of pimping various aspects of the OS X system configuration, today&#8217;s article covers how to use <a href="http://projects.tynsoe.org/en/geektool/" target="_blank" title="GeekTool">GeekTool 3</a> to display useful info on your OS X desktop.&nbsp;&nbsp;For those that missed it, one of my recent articles, &quot;<a href="http://www.digitalformula.net/articles/pimp-my-prompt-like-paul-irish" title="Pimp My Prompt ... like Paul Irish">Pimp My Prompt &#8230; like Paul Irish</a> covered using the <em>.bash_profile</em> script to add some geek bling to your bash prompt &#8211; check it out.
</p>
<p>
The idea of GeekTool is to use the often under-utilised desktop area of OS X to display useful info.&nbsp;&nbsp;Some people use it to display images but most use it to run Bash shell commands to interrogate and display various system-level statistics.&nbsp;&nbsp;For example, my desktop looks like this (click for larger version):
</p>
<figure>
<a href="http://images.digitalformula.net/entries/2011-05-21-geektool-desktop/2011-05-21-desktop-large.jpg" class="lightbox"><img decoding="async" src="http://images.digitalformula.net/entries/2011-05-21-geektool-desktop/2011-05-21-desktop.jpg" title="My GeekTool Desktop" alt="My GeekTool Desktop" /></a><figcaption>My GeekTool Desktop</figcaption></figure>
<p>
Before you ask, the desktop background is an InterfaceLift image called <a href="http://interfacelift.com/wallpaper/details/2455/the_solutionist.html" target="_blank" title="The Solutionist">The Solutionist</a>.&nbsp;&nbsp;<img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" />
</p>
<p>
Now, I’m going to assume that you’ve already downloaded and installed GeekTool 3 from the <a href="http://projects.tynsoe.org/en/geektool/" target="_blank" title="GeekTool">GeekTool homepage</a>.&nbsp;&nbsp;If you haven’t done that already, do it now, please.
</p>
<p>
Once you’ve got it installed, open System Preferences and click the GeekTool preference pane that should now be available.&nbsp;&nbsp;For this article, please drag a &quot;Shell&quot; Geeklet onto your desktop.&nbsp;&nbsp;Configure it any way you’d like in terms of position &#8211; for the sake of comparison, the screenshot below shows the settings for my date and weather Geeklet.
</p>
<figure>
<a href="http://images.digitalformula.net/entries/2011-05-21-geektool-desktop/2011-05-21-desktop-labelled-large.jpg" class="lightbox"><img decoding="async" src="http://images.digitalformula.net/entries/2011-05-21-geektool-desktop/2011-05-21-geeklet-config.jpg" title="Date and weather Geeklet settings" alt="Date and weather Geeklet settings" /></a><figcaption>Date and weather Geeklet settings</figcaption></figure>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2011/uncategorized/pimp-my-desktop-using-geektool/">Pimp My Desktop using GeekTool</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.digitalformula.net/2011/uncategorized/pimp-my-desktop-using-geektool/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>A couple more BASH prompt examples</title>
		<link>https://www.digitalformula.net/2011/uncategorized/a-couple-more-bash-prompt-examples/</link>
					<comments>https://www.digitalformula.net/2011/uncategorized/a-couple-more-bash-prompt-examples/#respond</comments>
		
		<dc:creator><![CDATA[chris]]></dc:creator>
		<pubDate>Mon, 09 May 2011 11:41:24 +0000</pubDate>
				<category><![CDATA[Archived]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac & OS X]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://digitalformula4.local/?p=101</guid>

					<description><![CDATA[<p>Yesterday I published an article called &#34;Pimp My Prompt &#8230; like Paul Irish&#34; in which I showed how to make your BASH prompt similar to the one used by Paul Irish. I also included a couple of sample prompts that you could use for reference so I figured I’d write a follow-up article that shows [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2011/uncategorized/a-couple-more-bash-prompt-examples/">A couple more BASH prompt examples</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>
Yesterday I published an article called <a href="http://www.digitalformula.net/articles/pimp-my-prompt-like-paul-irish" target="_blank" title="Pimp My Prompt ... like Paul Irish">&quot;Pimp My Prompt &#8230; like Paul Irish&quot;</a> in which I showed how to make your BASH prompt similar to the one used by <a href="http://www.paulirish.com/" target="_blank" title="Paul Irish">Paul Irish</a>.
</p>
<p>
I also included a couple of sample prompts that you could use for reference so I figured I’d write a follow-up article that shows what they look like.&nbsp;&nbsp;So, without any further ado, here they are.
</p>
<p>Example 1 &#8211; Green username, blue host, magenta working directory, white git branch:</p>
<pre class="brush: bash; title: ; notranslate">
PS1='${GREEN}u${BLACK}@${CYAN}h:${MAGENTA}w${WHITE}`__git_ps1 &quot; (%s)&quot;`$ ‘
</pre>
<p>
The example above uses the short colour codes outlined in the original article and looks like the screenshot below.
</p>
<figure>
<img decoding="async" src="http://images.digitalformula.net/entries/2011-05-09-a-couple-more-bash-prompt-examples/2011-05-09-prompt-green.jpg" title="Green username, blue host, magenta working directory" alt="Green username, blue host, magenta working directory" /><figcaption>Green username, blue host, magenta working directory</figcaption></figure>
<p>Example 2 &#8211; Blue user and host, magenta working directory, white git branch:</p>
<pre class="brush: bash; title: ; notranslate">
PS1='[33[0;36m]u@h[33[01m]:[33[0;35m]w[33[00m][33[1;30m][33[0;37m]`__git_ps1 &quot; (%s)&quot;`[33[00m][33[0;37m]$ '
</pre>
<p>
The example above uses the built-in colour codes but can be harder to read.&nbsp;&nbsp;It looks like the screenshot below.
</p>
<figure>
<img decoding="async" src="http://images.digitalformula.net/entries/2011-05-09-a-couple-more-bash-prompt-examples/2011-05-09-prompt-cyan.jpg" title="Blue user and host, magenta working directory, white git branch" alt="Blue user and host, magenta working directory, white git branch" /><figcaption>Blue user and host, magenta working directory, white git branch</figcaption></figure>
<p>
Don’t forget to read the original article, <a href="http://www.digitalformula.net/articles/pimp-my-prompt-like-paul-irish" target="_blank" title="Pimp My Prompt ... like Paul Irish">&quot;Pimp My Prompt &#8230; like Paul Irish&quot;</a>, if you’re unsure about how to enable the <em>__git_ps1</em> and short colour code commands.</p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2011/uncategorized/a-couple-more-bash-prompt-examples/">A couple more BASH prompt examples</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.digitalformula.net/2011/uncategorized/a-couple-more-bash-prompt-examples/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Pimp My Prompt &#8230; like Paul Irish</title>
		<link>https://www.digitalformula.net/2011/uncategorized/pimp-my-prompt-like-paul-irish/</link>
					<comments>https://www.digitalformula.net/2011/uncategorized/pimp-my-prompt-like-paul-irish/#comments</comments>
		
		<dc:creator><![CDATA[chris]]></dc:creator>
		<pubDate>Sun, 08 May 2011 11:41:43 +0000</pubDate>
				<category><![CDATA[Archived]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac & OS X]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://digitalformula4.local/?p=100</guid>

					<description><![CDATA[<p>There’s been a lot of talk lately about those cool colours that Paul Irish uses in his videos.&#160;&#160;If you don&#8217;t know who Paul Irish is and you dabble in a bit of web design &#8230; well &#8230; shame on you!&#160;&#160;😉&#160;&#160;The things referenced in this article, including the prompt, can be found in Paul&#8217;s YouTube video [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2011/uncategorized/pimp-my-prompt-like-paul-irish/">Pimp My Prompt &#8230; like Paul Irish</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>
There’s been a lot of talk lately about those cool colours that <a href="http://www.paulirish.com/" target="_blank" title="Paul Irish">Paul Irish</a> uses in his videos.&nbsp;&nbsp;If you don&#8217;t know who Paul Irish is and you dabble in a bit of web design &#8230; well &#8230; shame on you!&nbsp;&nbsp;<img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" />&nbsp;&nbsp;The things referenced in this article, including the prompt, can be found in Paul&#8217;s YouTube video entitled <a href="http://www.youtube.com/watch?v=OXpCB3U_4Ig" target="_blank" title="The Build Script of HTML5 Boilerplate: An Introduction">&quot;The Build Script of HTML5 Boilerplate: An Introduction&quot;</a>.&nbsp;&nbsp;Anyway, I think the prompt colours are pretty useful, especially if you’re speedy at navigating your way around the CLI/shell in Linux or OS X and want to see where you are very quickly..&nbsp;&nbsp;They help identify where you are in the file system, whether or not your current working directory is a git branch and, depending on what options you set, whether or not there are untracked files present etc.
</p>
<p>
Here’s what Paul’s prompt looks like (screenshot from the video linked above).
</p>
<figure>
<img decoding="async" src="http://images.digitalformula.net/entries/2011-05-08-pimp-my-prompt-like-paul-irish/2011-05-08-paul-irish-prompt.jpg" title="“Paul" alt="Paul Irish’s OS X prompt" /><figcaption>Paul Irish’s OS X prompt</figcaption></figure>
<p>
I believe Paul is using <a href="http://iterm.sourceforge.net/" target="_blank" title="iTerm">iTerm</a>, as am I.&nbsp;&nbsp;Combined with the stuff below, my iTerm configuration looks like this:
</p>
<figure>
<img decoding="async" src="http://images.digitalformula.net/entries/2011-05-08-pimp-my-prompt-like-paul-irish/2011-05-08-iterm.jpg" title="“iTerm" alt="iTerm Configuration" /><figcaption>iTerm Configuration</figcaption></figure>
<h2>Pimp my prompt!</h2>
<p>
Ok, so you want your prompt to look like that?&nbsp;&nbsp;It’s not that hard, actually.&nbsp;&nbsp;You have to grant me a little latitude, though, as I’m guessing what Paul uses the various CLI prefix symbols for.&nbsp;&nbsp;In this example I’m using an &quot;o&quot; to indicate a working outside a git branch and a <span style="text-decoration: underline">+</span> to indicate that the current working directory is a git branch.
</p>
<p>
This only works if you’re running an OS X or Linux shell &#8211; I’m sure you can do it with Windows but I’m not going to cover that here.
</p>
<h2>Step 1</h2>
<p>
If you haven’t got one already, open or create a file called <em>.bash_profile</em> in your home (~) folder.&nbsp;&nbsp;You might be asking why not use <em>.bashrc</em>?&nbsp;&nbsp;We want the command we’re adding to apply to interactive login shells &#8211; <em>.bashrc</em> only applies to interactive non-login shells.&nbsp;&nbsp;There is an exception to this if you&#8217;re using OS X (like me) &#8211; <em>.bash_profile</em> is run for each new Terminal.app window, by default.
</p>
<p>
If a file with that name already exists, make sure you don’t remove anything from it that you want to keep.&nbsp;&nbsp;From here I’m going to explain what each part of my <em>.bash_profile</em> does.&nbsp;&nbsp;The complete file will be shown at the end, including a couple of extra bits.
</p>
<p><strong>Note:</strong>&nbsp;If you’re going to include the git parts, you’ll need to <a href="http://git-scm.com/download" target="_blank" title="Download git source">download the git source</a> and put the file <em>.git-completion</em> somewhere (mine is in my home directory).</p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2011/uncategorized/pimp-my-prompt-like-paul-irish/">Pimp My Prompt &#8230; like Paul Irish</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.digitalformula.net/2011/uncategorized/pimp-my-prompt-like-paul-irish/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Brunswick to Sassafras</title>
		<link>https://www.digitalformula.net/2011/uncategorized/brunswick-to-sassafras/</link>
					<comments>https://www.digitalformula.net/2011/uncategorized/brunswick-to-sassafras/#respond</comments>
		
		<dc:creator><![CDATA[chris]]></dc:creator>
		<pubDate>Wed, 27 Apr 2011 02:14:10 +0000</pubDate>
				<category><![CDATA[Archived]]></category>
		<category><![CDATA[Evolution]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://digitalformula4.local/?p=96</guid>

					<description><![CDATA[<p>On Saturday Erin &#38; I went for a drive from our place in Brunswick to Sassafras, a small mountain village up in the Dandenong Ranges near Melbourne.&#160;&#160;Sassafras is a place I had ridden to before, back when I was living in Hawthorn.&#160;&#160;Back then it was a 75k round trip &#8211; not bad for the bike [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2011/uncategorized/brunswick-to-sassafras/">Brunswick to Sassafras</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>
On Saturday Erin &amp; I went for a drive from our place in Brunswick to Sassafras, a small mountain village up in the Dandenong Ranges near Melbourne.&nbsp;&nbsp;Sassafras is a place I had ridden to before, back when I was living in Hawthorn.&nbsp;&nbsp;Back then it was a 75k round trip &#8211; not bad for the bike I was on at the time (bone-charring aluminium, for those in the know).
</p>
<p>
After spending the day in the hills I was reminded of how nice the area is up there, and also of the beautiful road conditions.&nbsp;&nbsp;They&#8217;re smooth, flowing, relatively low-traffic and, on the Mountain Highway side, really not very steep at all.&nbsp;&nbsp;Needless to say, this was enough to get me thinking about biking up there the following day.&nbsp;&nbsp;I knew it&#8217;d be close to 100km return but hey, if you don&#8217;t go, you&#8217;ll never know what you&#8217;re missing, right?
</p>
<p>
A good dinner and what seemed to be a pretty good sleep that night prepared me for the 7:30 a.m. start on Sunday morning.&nbsp;&nbsp;The conditions were like nothing I&#8217;ve seen in Melbourne before.&nbsp;&nbsp;It was pretty cold (around 8 degrees Celcius) and completely calm but man &#8230; the mist and fog?&nbsp;&nbsp;Nuts!&nbsp;&nbsp;Visibility at sea level was no more than about 50 metres at any time during the first 2 hours of the ride, making the use of my usual cycling glasses completely redundant.&nbsp;&nbsp;The fog and mist was so thick, in fact, that I just took my glasses off and rode without any until about 45 minutes before arriving home.
</p>
<p>
Riding up Mountain Highway from The Basin to Sassafras really was something else.&nbsp;&nbsp;It’s an easy climb by any standards despite its profile (see below) but the mist caused the sun to be heavily diffused and to cast those amazing shadowy rays that happen when bright sunlight is filtered through trees.&nbsp;&nbsp;Simply awesome and I found myself wishing I had a camera with me.
</p>
<h2>
The Climb<br />
</h2>
<figure>
<img decoding="async" src="http://images.digitalformula.net/entries/2011-04-27-brunswick-to-sassafras/climb.jpg" title="The climb from The Basin to Sassafras" alt="The climb from The Basin to Sassafras" /><figcaption>The climb from The Basin to Sassafras</figcaption></figure>
<p>
Re the ride itself?&nbsp;&nbsp;In all honesty I was half expecting to get some of the way back and hit the wall since 100km is a long ride for me right now.&nbsp;&nbsp;Maybe it was the decent rest but I felt pretty damn good throughout the whole thing.&nbsp;&nbsp;The route from my house to Sassafras is technically uphill the whole way but does roll a lot; that allows for some recovery during the ride.&nbsp;&nbsp;The climb was no problem and I found myself cranking through the middle section at a pretty easy pace.
</p>
<p>
I’ll definitely be doing this ride again very soon and plan to try and make it a regular weekend thing.&nbsp;&nbsp;If you’re in Melbourne and want to join me, fire me an email and I’ll be more than happy to ride with you.&nbsp;&nbsp;<img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" />
</p>
<p>
<strong>NB:</strong> After posting this and having heard of a hill climb called the &quot;1 in 20&quot; near Melbourne, I realised that the road climb from The Basin shops to Sassafras <strong>is</strong> the &quot;1 in 20&quot; ride &#8230; lol.&nbsp;&nbsp;Next time I go out there I&#8217;ll have to try it under 20 mins &#8211; this time was around 21 mins through the &#8216;official&#8217; timed section, I think.
</p>
<h2>
The Ride<br />
</h2>
<p>
Here’s the ride itself from Garmin Connect.&nbsp;&nbsp;The climb from The Basin to Sassafras is pretty obvious, huh?&nbsp;&nbsp;Cool.
</p></p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2011/uncategorized/brunswick-to-sassafras/">Brunswick to Sassafras</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.digitalformula.net/2011/uncategorized/brunswick-to-sassafras/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>A couple of deviantART submissions</title>
		<link>https://www.digitalformula.net/2011/uncategorized/a-couple-of-deviantart-submissions/</link>
					<comments>https://www.digitalformula.net/2011/uncategorized/a-couple-of-deviantart-submissions/#respond</comments>
		
		<dc:creator><![CDATA[chris]]></dc:creator>
		<pubDate>Sat, 26 Feb 2011 08:32:02 +0000</pubDate>
				<category><![CDATA[Archived]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Mac & OS X]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://digitalformula4.local/?p=88</guid>

					<description><![CDATA[<p>Over the last couple of days I&#8217;ve been hacking about with theming in OS X.&#160;&#160;It&#8217;s something I&#8217;ve always quite liked since back in the day when WindowBlinds used to be the way forward on Windows. The first theme setup I tried incorporated the Gill Sans Text Dock Icons available from deviantART.&#160;&#160;Because the icon collection didn&#8217;t [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2011/uncategorized/a-couple-of-deviantart-submissions/">A couple of deviantART submissions</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>
Over the last couple of days I&#8217;ve been hacking about with theming in OS X.&nbsp;&nbsp;It&#8217;s something I&#8217;ve always quite liked since back in the day when WindowBlinds used to be the way forward on Windows.
</p>
<p>
The first theme setup I tried incorporated the <a href="http://arctictransfuse.deviantart.com/art/Gill-Sans-Text-Dock-Icons-154466636" target="_blank" title="Gill Sans Text Dock Icons">Gill Sans Text Dock Icons</a> available from <a href="http://digitalformula.deviantart.com" target="_blank" title="digitalformula on deviantART">deviantART</a>.&nbsp;&nbsp;Because the icon collection didn&#8217;t have icons for some of the apps I use, I made my own and submitted them for others people to use.&nbsp;&nbsp;The first collection extension is available on deviantART by going to <a href="http://digitalformula.deviantart.com/#/d3a9xyy" target="_blank" title="digitalformula on deviantART">Gill Sans Text &#8211; More Icons</a>.&nbsp;&nbsp;I&#8217;ve also made an icon for Traktor Scratch Pro after another user requested it &#8211; it can be downloaded from <a href="http://digitalformula.deviantart.com/#/d3acgs0" target="_blank" title="Traktor Scratch Pro icon for Gill Sans Text">Traktor Scratch Pro for Gill Sans Text</a> on deviantART.
</p>
<h2>New theme?</h2>
<p>
I then tried the <a href="http://macthemes.net/forum/viewtopic.php?id=16784360&amp;p=1" target="_blank" title="Float Dock Icons">Float Dock Icons</a> that I found on a MacThemes forum &#8211; they&#8217;re awesome!&nbsp;&nbsp;That didn&#8217;t have icons for some of the most popular apps, either, so I made some for the best-known Adobe apps.&nbsp;&nbsp;The icons can be downloaded from <a href="http://digitalformula.deviantart.com/#/d3achh1" target="_blank" title="Round shiny Adobe dock icons">Round shiny Adobe dock icons</a> on deviantART.&nbsp;&nbsp;Cool.&nbsp;&nbsp;<img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" />
</p>
<h2>What did I come up with?</h2>
<p>
After playing about with a ton of different combinations I came up with one that I quite like.&nbsp;&nbsp;It&#8217;s simple (in my opinion) yet functional without being overly garish &#8211; check it out.
</p>
<figure>
<a href="http://images.digitalformula.net/entries/a-couple-of-deviantart-submissions/desktop-large.jpg" class="lightbox"><img decoding="async" src="http://images.digitalformula.net/entries/a-couple-of-deviantart-submissions/desktop-small.jpg" title="Modified OS X desktop" alt="Modified OS X desktop" /></a><figcaption>Modified OS X desktop</figcaption></figure>
<h2>Why?</h2>
<p>
Why did I do this?&nbsp;&nbsp;There&#8217;s really no good reason other than being a bit of a geek and needing an excuse to dive back in the graphics software that I&#8217;ve been missing lately.&nbsp;&nbsp;I&#8217;m no designer (obvious, huh) but doing this stuff is pretty relaxing.&nbsp;&nbsp;<img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" />
</p>
<h2>How?</h2>
<p>
I&#8217;m in the process of writing up how I made those changes now so if you&#8217;re interested in doing this yourself, stay tuned.</p>
<p>The post <a rel="nofollow" href="https://www.digitalformula.net/2011/uncategorized/a-couple-of-deviantart-submissions/">A couple of deviantART submissions</a> appeared first on <a rel="nofollow" href="https://www.digitalformula.net">DigitalFormula</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.digitalformula.net/2011/uncategorized/a-couple-of-deviantart-submissions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
