<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>computer engineering, linux, and technology banter for the masses</description><title>/dev/null</title><generator>Tumblr (3.0; @chmod755)</generator><link>http://chmod755.tumblr.com/</link><item><title>digitalvanity:

XMonad + Arch Linux + Xinerama by...</title><description>&lt;img src="http://24.media.tumblr.com/d4d1227057cdbb3b160050177f93167c/tumblr_mn85ml34nM1qb1fy3o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a class="tumblr_blog" href="http://digitalvanity.me/post/51107941485/xmonad-arch-linux-xinerama-by-earspl1t"&gt;digitalvanity&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://earspl1t.deviantart.com/art/XMonad-Arch-Linux-Xinerama-373211846"&gt;XMonad + Arch Linux + Xinerama&lt;/a&gt;&lt;span&gt; by &lt;/span&gt;&lt;a href="http://earspl1t.deviantart.com/"&gt;Earspl1t&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;thats me!&lt;/p&gt;</description><link>http://chmod755.tumblr.com/post/51108500938</link><guid>http://chmod755.tumblr.com/post/51108500938</guid><pubDate>Wed, 22 May 2013 20:13:54 -0400</pubDate><category>arch</category><category>desktop</category><category>linux</category><category>xmonad</category><category>nerd</category><category>computer</category><category>programming</category><category>hack</category></item><item><title>Arch Linux + Xmonad
Check out the animated gif on Reddit and...</title><description>&lt;img src="http://25.media.tumblr.com/c5e803fa949e5abd8c04de9e4024bcf7/tumblr_mjyy61i3cP1rw14t5o1_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://25.media.tumblr.com/da268aedc9bb25c049218c4eb7e1ce69/tumblr_mjyy61i3cP1rw14t5o2_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;p&gt;Arch Linux + Xmonad&lt;/p&gt;
&lt;p&gt;Check out the animated gif on Reddit and pass me some karma if you approve!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.reddit.com/r/unixporn/comments/1ao7vg/arch_xmonad_flowers_grow_neckbeards_in_the_spring/"&gt;&lt;a href="http://www.reddit.com/r/unixporn/comments/1ao7vg/arch_xmonad_flowers_grow_neckbeards_in_the_spring/"&gt;http://www.reddit.com/r/unixporn/comments/1ao7vg/arch_xmonad_flowers_grow_neckbeards_in_the_spring/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://chmod755.tumblr.com/post/45842890030</link><guid>http://chmod755.tumblr.com/post/45842890030</guid><pubDate>Wed, 20 Mar 2013 13:06:00 -0400</pubDate><category>linux</category><category>archlinux</category><category>artwork</category><category>desktop</category><category>wallpaper</category><category>screenshot</category><category>computers</category><category>programming</category><category>nerd</category><category>spring</category><category>springtime</category></item><item><title>Springtime… Arch Linux +...</title><description>&lt;img src="http://24.media.tumblr.com/b551402b7d8d8517f01702ac71526a39/tumblr_mizq44mEC91rw14t5o2_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://25.media.tumblr.com/71aba541c5cafb6721c4d982e3d5437c/tumblr_mizq44mEC91rw14t5o1_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;p&gt;Springtime… Arch Linux + XMONAD&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/windelicato/dotfiles"&gt;&lt;a href="https://github.com/windelicato/dotfiles"&gt;https://github.com/windelicato/dotfiles&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://chmod755.tumblr.com/post/44299332709</link><guid>http://chmod755.tumblr.com/post/44299332709</guid><pubDate>Fri, 01 Mar 2013 11:36:00 -0500</pubDate><category>linux</category><category>desktop</category><category>wallpaper</category><category>nerd</category><category>computer</category><category>os</category><category>haskell</category><category>artwork</category><category>painting</category><category>archlinux</category><category>programming</category><category>hack</category><category>hacking</category><category>digital-vanity</category></item><item><title>And both together as...</title><description>&lt;img src="http://24.media.tumblr.com/c890acf4f5a909056ab728785543887e/tumblr_mhvgamVWpm1rw14t5o4_r1_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://24.media.tumblr.com/2d4c5c55d96c7287f306245d77396b52/tumblr_mhvgamVWpm1rw14t5o1_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://24.media.tumblr.com/eec4ed1df2954d3c9cdd42958c82ff1c/tumblr_mhvgamVWpm1rw14t5o2_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://24.media.tumblr.com/4b0fec3ddcf71c13b9449681bceff1d2/tumblr_mhvgamVWpm1rw14t5o3_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;p&gt;And both together as one…&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/windelicato/dotfiles" title="configs on github" target="_blank"&gt;&lt;a href="https://github.com/windelicato/dotfiles"&gt;https://github.com/windelicato/dotfiles&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://chmod755.tumblr.com/post/42532265159</link><guid>http://chmod755.tumblr.com/post/42532265159</guid><pubDate>Thu, 07 Feb 2013 17:39:00 -0500</pubDate><category>xmonad</category><category>archlinux</category><category>linux</category><category>wallpaper</category><category>digital-vanity</category><category>haskell</category><category>programming</category><category>code</category><category>nerd</category><category>hack</category><category>computer</category><category>screenshot</category><category>desktop</category></item><item><title>Same box, Ubuntu 12.10, Cinnamon, TMUX</title><description>&lt;img src="http://25.media.tumblr.com/6f60ca311a55c9c90c2efbc3c68bf9d3/tumblr_mhrzagEi0L1rw14t5o4_r1_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://24.media.tumblr.com/edac179fbc5ca0b9000f6a4dced65a60/tumblr_mhrzagEi0L1rw14t5o1_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://25.media.tumblr.com/417827c2300c582cc96b6a87aaf36b25/tumblr_mhrzagEi0L1rw14t5o3_r1_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;p&gt;Same box, Ubuntu 12.10, Cinnamon, TMUX&lt;/p&gt;</description><link>http://chmod755.tumblr.com/post/42395724631</link><guid>http://chmod755.tumblr.com/post/42395724631</guid><pubDate>Tue, 05 Feb 2013 20:39:00 -0500</pubDate><category>screenshot</category><category>desktop</category><category>wallpaper</category><category>linux</category><category>ubuntu</category><category>cinnamon</category><category>tmux</category><category>programming</category><category>irc</category><category>digital-vanity</category></item><item><title>Arch Linux + XMONAD</title><description>&lt;img src="http://25.media.tumblr.com/38ca4c9dd06bae5d12d8f93ffce2c830/tumblr_mhonn3ykiY1rw14t5o1_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://25.media.tumblr.com/8ca51b8b454a009ba363d5d821a29d13/tumblr_mhonn3ykiY1rw14t5o2_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://24.media.tumblr.com/b6d97ea98cb8b61c6434fcab51c79975/tumblr_mhonn3ykiY1rw14t5o3_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://25.media.tumblr.com/cf8777a92c9184f59207367a70267c46/tumblr_mhonn3ykiY1rw14t5o4_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;p&gt;Arch Linux + XMONAD&lt;/p&gt;</description><link>http://chmod755.tumblr.com/post/42260411348</link><guid>http://chmod755.tumblr.com/post/42260411348</guid><pubDate>Mon, 04 Feb 2013 01:35:27 -0500</pubDate><category>linux</category><category>archlinux</category><category>xmonad</category><category>haskell</category><category>programming</category><category>nerd</category><category>desktop</category><category>digital-vanity</category></item><item><title>Arch Linux + Openbox</title><description>&lt;img src="http://25.media.tumblr.com/9e4e8c7fdd8941c3b8f2be9701382695/tumblr_mh2a6kbBxC1rw14t5o1_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://25.media.tumblr.com/2a6aee50a1129c80ca58859a231d7113/tumblr_mh2a6kbBxC1rw14t5o2_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;p&gt;Arch Linux + Openbox&lt;/p&gt;</description><link>http://chmod755.tumblr.com/post/41256242816</link><guid>http://chmod755.tumblr.com/post/41256242816</guid><pubDate>Tue, 22 Jan 2013 23:37:31 -0500</pubDate></item><item><title>24 Pull Requests: An Open Source Participation Advent</title><description>&lt;a href="https://github.com/andrew/24pullrequests"&gt;24 Pull Requests: An Open Source Participation Advent&lt;/a&gt;: &lt;p&gt;&lt;a class="tumblr_blog" href="http://thechangelog.com/post/36886891928/24-pull-requests-an-open-source-participation-advent"&gt;thechangelog&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Looking for a way to get involved with open source? &lt;a href="http://24pullrequests.com/"&gt;24 Pull Requests&lt;/a&gt; will help you find projects and track your contributions:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There are loads of ways to get involved in an open source project, improving documentation, helping fix existing issues and bugs, improving code quality and test coverage or adding missing features.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;[&lt;a href="http://24pullrequests.com/"&gt;site&lt;/a&gt;] [&lt;a href="https://github.com/andrew/24pullrequests"&gt;source on GitHub&lt;/a&gt;]&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://chmod755.tumblr.com/post/36888176198</link><guid>http://chmod755.tumblr.com/post/36888176198</guid><pubDate>Fri, 30 Nov 2012 12:51:17 -0500</pubDate></item><item><title>Goodbye summer.  Still Arch Linux + Xmonad.
Archey + HTOP +...</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_md7h9cnCb21rw14t5o1_500.png"/&gt;&lt;br/&gt; Floating&lt;br/&gt;&lt;br/&gt; &lt;img src="http://24.media.tumblr.com/tumblr_md7h9cnCb21rw14t5o2_500.png"/&gt;&lt;br/&gt; Tiled&lt;br/&gt;&lt;br/&gt; &lt;p&gt;Goodbye summer.  Still Arch Linux + Xmonad.&lt;/p&gt;
&lt;p&gt;Archey + HTOP + IRSSI + NCMPCPP + VIM + GMRUN&lt;/p&gt;</description><link>http://chmod755.tumblr.com/post/35324209242</link><guid>http://chmod755.tumblr.com/post/35324209242</guid><pubDate>Fri, 09 Nov 2012 00:44:00 -0500</pubDate></item><item><title>Encrypted Password Generator for /etc/shadow</title><description>&lt;p&gt;Generates encrypted keys for the following encryption algorithms:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;MD5&lt;/li&gt;
&lt;li&gt;Blowfish&lt;/li&gt;
&lt;li&gt;SHA-256&lt;/li&gt;
&lt;li&gt;SHA-512&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Compile with&lt;/p&gt;
&lt;pre class="prettyprint"&gt;gcc pwgen.c -lcrypt -o pwgen
&lt;/pre&gt;
&lt;pre class="prettyprint"&gt;#define _XOPEN_SOURCE
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;unistd.h&amp;gt;
#include &amp;lt;pwd.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;lt;time.h&amp;gt;

int main(int argc, const char *argv[])
{
	// Generate a pseudo random seed for crypt()
	const char * seedchars =
		"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
		"abcdefghijklmnopqrstuvwxyz"
		"123456789./";
	const int len 	= strlen(seedchars);
	int i;

	char seed[11] = "$.$........";
	srand((unsigned int) time(NULL));
	for (i = 3; i &amp;lt; 12; i++) {
		int r = rand() %len;
		seed[i] = seedchars[r];
	}
	

	char *password, *lock, *key;
	int selection;

	printf("********************************\n");
	printf("|	Choose Algorithm	|\n");
	printf("|				|\n");
	printf("|  1. MD5			|\n");
	printf("|  2. Blowfish			|\n");
	printf("|  3. SHA-2%6			|\n");
	printf("|  4. SHA-512			|\n");
	printf("|				|\n");
	printf("|******************************|\n");

	printf("\nSelection:\t");
	scanf("%d", &amp;amp;selection);
	password = getpass("Password:\t");

	if (selection == 1) {
		seed[1] = '1';
		lock = seed;
		key = crypt(password,lock);
	}
	else if (selection == 2) {
		seed[1] = '2';
		lock = seed;
		key = crypt(password,lock);
	}
	else if (selection == 3) {
		seed[1] = '5';
		lock = seed;
		key = crypt(password,lock);
	}
	else if (selection == 4) {
		seed[1] = '6';
		lock = seed;
		key = crypt(password,lock);
	}
	else{
		printf("Invalid selection. Exiting");
	}

	printf("\nEncrypted Key:\n%s\n", key);
	
	return 0;
}
&lt;/pre&gt;</description><link>http://chmod755.tumblr.com/post/33875110673</link><guid>http://chmod755.tumblr.com/post/33875110673</guid><pubDate>Thu, 18 Oct 2012 23:24:13 -0400</pubDate></item><item><title>Espresso Heuristic Logic Minimizer</title><description>&lt;p&gt;I bundled up the old espresso program from 1989 and repackaged it. This thing took me a while to find, so I figured I&amp;#8217;d post it incase anyone else searching for it could find it a bit easier. It is bundled with the original manpages and examples.  This program got me through 2 semesters of digital design. The example is from a project to design the logic behind a 4-way stoplight.&lt;/p&gt;
&lt;p&gt;USAGE:&lt;/p&gt;
&lt;p&gt;Format truth table to include:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;.i = number of inputs&lt;/li&gt;
&lt;li&gt;.o = number of outputs&lt;/li&gt;
&lt;li&gt;.ilb = input names&lt;/li&gt;
&lt;li&gt;.ob = output names &lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;Example:&lt;/div&gt;
&lt;pre class="prettyprint"&gt;~$ cat input.tt

# Truth Table for Stoplight FSM
.i 14
.o 11

.ilb NS ES turn NSR NSY NSG EWR EWY EWG TR TY TG dir0 dir1
.ob NSR NSY NSG EWR EWY EWG TR TY TG dir0 dir1

000--1--------01000000000
000-----1-----00001000001
000--------1--00000001010
001--1--------01000000001
001-----1-----00001000001
001--------1--00000001001
010--1--------01000000000
010-----1-----00001000000
010--------1--00000001000
011--1--------01000000000
011-----1-----00001000001
011--------1--00000001000
100--1--------01000000010
100-----1-----00001000010
100--------1--00000001010
101--1--------01000000001
101-----1-----00001000001
101--------1--00000001010
110--1--------01000000000
110-----1-----00001000010
110--------1--00000001010
111--1--------01000000000
111-----1-----00001000001
111--------1--00000001010
----1-------0010010010000
----1-------0110010010001
----1-------1010010010010
-------1----0010010010000
-------1----0110010010001
-------1----1010010010010
----------1-0010010010000
----------1-0110010010001
----------1-1010010010010
---1--1--1--0000000100000
---1--1--1--0100000000101
---1--1--1--1000100000010
.e
&lt;/pre&gt;
&lt;pre class="prettyprint"&gt;~$ espresso -o eqntott input.tt

NSR = (TY&amp;amp;!dir0&amp;amp;dir1) | (EWY&amp;amp;!dir0&amp;amp;dir1) | (NSY&amp;amp;!dir0&amp;amp;dir1) | (TY&amp;amp;!dir1) | (
    EWY&amp;amp;!dir1) | (NSY&amp;amp;!dir1);

NSY = (NSG);

NSG = (NSR&amp;amp;EWR&amp;amp;TR&amp;amp;dir0&amp;amp;!dir1);

EWR = (TY&amp;amp;!dir0&amp;amp;dir1) | (EWY&amp;amp;!dir0&amp;amp;dir1) | (NSY&amp;amp;!dir0&amp;amp;dir1) | (TY&amp;amp;!dir1) | (
    EWY&amp;amp;!dir1) | (NSY&amp;amp;!dir1);

EWY = (EWG);

EWG = (NSR&amp;amp;EWR&amp;amp;TR&amp;amp;!dir0&amp;amp;!dir1);

TR = (TY&amp;amp;!dir0&amp;amp;dir1) | (EWY&amp;amp;!dir0&amp;amp;dir1) | (NSY&amp;amp;!dir0&amp;amp;dir1) | (TY&amp;amp;!dir1) | (
    EWY&amp;amp;!dir1) | (NSY&amp;amp;!dir1);

TY = (TG);

TG = (NSR&amp;amp;EWR&amp;amp;TR&amp;amp;!dir0&amp;amp;dir1);

dir0 = (NSR&amp;amp;EWR&amp;amp;TR&amp;amp;dir0&amp;amp;!dir1) | (NS&amp;amp;!ES&amp;amp;!turn&amp;amp;NSG) | (NS&amp;amp;!turn&amp;amp;EWG) | (
    !ES&amp;amp;!turn&amp;amp;TG) | (TY&amp;amp;dir0&amp;amp;!dir1) | (EWY&amp;amp;dir0&amp;amp;!dir1) | (NSY&amp;amp;dir0&amp;amp;!dir1) | (
    NS&amp;amp;TG);

dir1 = (NSR&amp;amp;EWR&amp;amp;TR&amp;amp;!dir0&amp;amp;dir1) | (!NS&amp;amp;!ES&amp;amp;turn&amp;amp;TG) | (!NS&amp;amp;!ES&amp;amp;EWG) | (!ES
    &amp;amp;turn&amp;amp;NSG) | (turn&amp;amp;EWG) | (TY&amp;amp;!dir0&amp;amp;dir1) | (EWY&amp;amp;!dir0&amp;amp;dir1) | (NSY
    &amp;amp;!dir0&amp;amp;dir1);

&lt;/pre&gt;
&lt;p&gt;And VOILA! Simplified boolean expressions.&lt;/p&gt;

&lt;p&gt;To install, simply run the INSTALL script, or look through this script to do it yourself. Make sure to make the script executable by running&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;chmod 755 INSTALL&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="http://static.tumblr.com/4unybmd/DUzma97s5/espresso-modern.tar.gz" title="espresso tarball" target="_self"&gt;espresso-modern.tar.gz&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</description><link>http://chmod755.tumblr.com/post/31417234230</link><guid>http://chmod755.tumblr.com/post/31417234230</guid><pubDate>Wed, 12 Sep 2012 17:02:00 -0400</pubDate><category>linux</category><category>programming</category><category>bash</category><category>boolean</category><category>unix</category><category>ubuntu</category><category>debian</category><category>mint</category><category>digital design</category><category>logic</category><category>technology</category></item><item><title>Power of WGET</title><description>&lt;p&gt;There&amp;#8217;s a server here at school with hundreds of jazz records streaming in real media (.rm) formats. This script crawls the server and downloads the records, converts them to mp3, and id3 tags them in an organized directory system.&lt;/p&gt;
&lt;p&gt;This script displays the true power of WGET.&lt;/p&gt;
&lt;pre class="prettyprint"&gt;#!/bin/bash

URL="http://www.departments.COLLEGE.edu/music/courses/musc"
COURSE="$1/music/"
CODE="$2-T"
ADDRESS="$URL$COURSE$CODE"
TRACK=("01" "02" "03" "04" "05" "06" "07" "08" "09" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "20" "21" "22" "23")
i=0

echo "Enter artist name"
read artist
echo "Enter record name"
read record

cd ~/Music/

if [ ! -d "$artist" ]; then
	mkdir "$artist"
fi
cd "$artist"
mkdir "$record"
cd "$record"


for j in "" 1 2 3 4
do
	wget -q "$ADDRESS$j${TRACK[$i]}.rm"

	while [ $? -eq 0 ]
	do
	       echo 'CONVERTING RM FORMAT TO WAV'
	       inputfile="$2-T${j}${TRACK[$i]}.rm"
	       outputfile="$j${TRACK[$i]}.mp3"
	       mplayer -really-quiet $inputfile -ao pcm	&amp;amp;&amp;gt; /dev/null
	       echo 'CONVERTING WAV FORMAT TO MP3'
	       lame -h -b 256 --quiet audiodump.wav $outputfile


	       i=$(($i+1))
	       id3v2 -a "$artist" -A "$record" -T $i $outputfile
	       rm -f audiodump.wav
	       rm -f $inputfile

	       echo "DOWNLOADING TRACK $(($i+1))"
	       wget -q  "$ADDRESS${TRACK[$i]}.rm"
	done

	i=0;
done

for f in *.mp3
do
	echo "Song title for $f"
	read title
	id3v2 -t "$title" $f
done

exit
&lt;/pre&gt;</description><link>http://chmod755.tumblr.com/post/30747589103</link><guid>http://chmod755.tumblr.com/post/30747589103</guid><pubDate>Sun, 02 Sep 2012 16:29:32 -0400</pubDate><category>linux</category><category>programming</category><category>bash</category><category>boolean</category><category>unix</category><category>ubuntu</category><category>debian</category><category>mint</category><category>digital design</category><category>logic</category><category>technology</category></item><item><title>devallday:

VIM Clutch
VIM Clutch is a hardware pedal for...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_m60w0m8pIb1r6zy40o1_400.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://24.media.tumblr.com/tumblr_m60w0m8pIb1r6zy40o2_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://25.media.tumblr.com/tumblr_m60w0m8pIb1r6zy40o3_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;p&gt;&lt;a class="tumblr_blog" href="http://develop.alldayeveryday.com/post/25646005415/vim-clutch-vim-clutch-is-a-hardware-pedal-for"&gt;devallday&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://github.com/alevchuk/vim-clutch"&gt;VIM Clutch&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;VIM Clutch is a hardware pedal for improved text editing speed for users of the magnificent VIM text editor (1, 2). When the pedal is pressed down, the pedal types “i” causing VIM to go into Insert Mode. When released, it types and you are back in Normal Mode.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;We don’t use VIM…. :-(&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I can’t tell if this is a joke or for serious. Too funny.&lt;/p&gt;</description><link>http://chmod755.tumblr.com/post/25719124914</link><guid>http://chmod755.tumblr.com/post/25719124914</guid><pubDate>Sat, 23 Jun 2012 11:41:36 -0400</pubDate></item><item><title>Delete files owned by root, without being root</title><description>&lt;p&gt;&lt;a class="tumblr_blog" href="http://paksoy.net/post/25231322320/delete-files-owned-by-root-without-being-root"&gt;paksoy&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Unix permits non-root users to delete files that they do not own including files owned by the super-user, aka root. You can create a file, change its ownership to root and delete it.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ touch foo $ chmod 600 foo # make the file only read-writable by owner &lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;$ sudo chown root:0 foo # change ownership of file to root &lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;$ ls -l foo &lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;-rw------- 1 root root 0 2011-01-24 12:18 foo &lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;$ rm foo &lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;$ ls -l foo ls: cannot access foo: No such file or directory &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Obviously there’s a catch, you can only delete files in directories that you have write access to. In fact, &lt;strong&gt;write permission to the parent directory, and only write permission to parent directory, controls which files you may or may not delete.&lt;/strong&gt; So, you can also create a file, remove write permissions to the parent directory, and you will be unable to delete the file you created and still own.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ mkdir test $ touch test/foo $ chmod -w test $ rm test/foo rm: test/foo: Permission denied &lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Blame inodes&lt;/h2&gt;
&lt;p&gt;Metadata for a Unix file is stored in the file inode. The inode contains useful info such as ownership information, access timestamps and pointers to the actual disk blocks that contain the file contents. What the inode does not contain is information about file name or parent directory.&lt;/p&gt;
&lt;p&gt;Only Directories map file names to inodes. And multiple files can map to the same inode at that (you can create such hard-links using the &lt;code&gt;ln&lt;/code&gt; command). Running &lt;code&gt;rm&lt;/code&gt; simply &lt;strong&gt;r&lt;/strong&gt;e&lt;strong&gt;m&lt;/strong&gt;oves one such reference from a single directory, so it only requires write-access to the directory in question. The disk blocks for the inode will only be reclaimed when the last reference to it is removed.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Start removing dem references!&lt;/p&gt;</description><link>http://chmod755.tumblr.com/post/25233940677</link><guid>http://chmod755.tumblr.com/post/25233940677</guid><pubDate>Sat, 16 Jun 2012 13:12:00 -0400</pubDate></item><item><title>the-urban-shaman:

mohandasgandhi:

dceiver:

ryanbrown:

holyshi...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_m5h2v2UGqu1qz73syo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a class="tumblr_blog" href="http://the-urban-shaman.tumblr.com/post/24917870824/mohandasgandhi-dceiver-ryanbrown"&gt;the-urban-shaman&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a class="tumblr_blog" href="http://mohandasgandhi.tumblr.com/post/24917644032/dceiver-ryanbrown-holyshit-and-the-people"&gt;mohandasgandhi&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a class="tumblr_blog" href="http://dceiver.tumblr.com/post/24916185333/ryanbrown-holyshit-and-the-people-bowed-and"&gt;dceiver&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a class="tumblr_blog" href="http://ryanbrown.tumblr.com/post/24908288611/holyshit"&gt;ryanbrown&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;holyshit.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And the people bowed and prayed to the neon god they made.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Capitalism is so gross.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;^^This&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://chmod755.tumblr.com/post/24969451256</link><guid>http://chmod755.tumblr.com/post/24969451256</guid><pubDate>Tue, 12 Jun 2012 15:33:50 -0400</pubDate></item><item><title>Using dmenu to open files in Vim</title><description>&lt;a href="http://leafo.net/posts/using_dmenu_to_open_quickly.html"&gt;Using dmenu to open files in Vim&lt;/a&gt;: &lt;p&gt;&lt;a class="tumblr_blog" href="http://onethingwell.org/post/24610844555/dmenu-vim"&gt;onethingwell&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;An interesting alternative to the various file finding/opening plugins for Vim using the excellent &lt;a href="http://onethingwell.org/post/874948262/dmenu"&gt;dmenu&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This blog rules. This will be an excellent addition alongside Nerdtree &lt;a href="http://www.vim.org/scripts/script.php?script_id=1658"&gt;&lt;a href="http://www.vim.org/scripts/script.php?script_id=1658"&gt;http://www.vim.org/scripts/script.php?script_id=1658&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://chmod755.tumblr.com/post/24622978643</link><guid>http://chmod755.tumblr.com/post/24622978643</guid><pubDate>Thu, 07 Jun 2012 14:56:26 -0400</pubDate></item><item><title>onethingwell:


dvtm brings the concept of tiling window...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_m4la1gVAQh1qbsh2yo1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a class="tumblr_blog" href="http://onethingwell.org/post/24468479626/dvtm"&gt;onethingwell&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://www.brain-dump.org/projects/dvtm/"&gt;dvtm&lt;/a&gt; brings the concept of tiling window management, popularized by X11-window managers like &lt;a href="http://onethingwell.org/post/584609397/dwm"&gt;dwm&lt;/a&gt; to the console. As a console window manager it tries to make it easy to work with multiple console based programs…&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I was reminded of &lt;code&gt;dvtm&lt;/code&gt; by How-To Geek’s &lt;a href="http://www.howtogeek.com/114582/2-alternatives-to-gnu-screen-for-linux-terminal-multitasking/"&gt;2 Alternatives to GNU Screen for Terminal Multitasking&lt;/a&gt;, an intro to &lt;code&gt;dvtm&lt;/code&gt;/&lt;a href="http://onethingwell.org/post/543409209/dtach"&gt;&lt;code&gt;dtach&lt;/code&gt;&lt;/a&gt; and &lt;a href="http://onethingwell.org/post/455644179/tmux"&gt;&lt;code&gt;tmux&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Interesting. Screen’s keybindings suck ass. This looks very nice. Alt = xmonad, mod4 = dvtm?&lt;/p&gt;</description><link>http://chmod755.tumblr.com/post/24527754386</link><guid>http://chmod755.tumblr.com/post/24527754386</guid><pubDate>Wed, 06 Jun 2012 03:08:12 -0400</pubDate></item><item><title>New colorscheme / wallpaper for summer… thanks to...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_m54r74FQQJ1rw14t5o1_500.png"/&gt;&lt;br/&gt; floating&lt;br/&gt;&lt;br/&gt; &lt;img src="http://25.media.tumblr.com/tumblr_m54r74FQQJ1rw14t5o2_500.png"/&gt;&lt;br/&gt; tiled&lt;br/&gt;&lt;br/&gt; &lt;p&gt;New colorscheme / wallpaper for summer… thanks to gutterslob on .dotshare for the color scheme and &lt;span&gt;rstrcogburn on deviantart for the photo.  Still using Xmonad.&lt;/span&gt;&lt;/p&gt;</description><link>http://chmod755.tumblr.com/post/24457430455</link><guid>http://chmod755.tumblr.com/post/24457430455</guid><pubDate>Tue, 05 Jun 2012 01:57:03 -0400</pubDate><category>linux</category><category>haskell</category><category>xmonad</category><category>screenshot</category><category>desktop</category></item><item><title>Digital Logic Design with /dev/zero and /dev/null</title><description>&lt;p&gt;Found this on HN today&amp;#8230; thought it was pretty interesting. I&amp;#8217;m gonna try to build a full adder.&lt;/p&gt;
&lt;p&gt;Original source: &lt;a href="http://www.linusakesson.net/programming/pipelogic/index.php"&gt;&lt;a href="http://www.linusakesson.net/programming/pipelogic/index.php"&gt;http://www.linusakesson.net/programming/pipelogic/index.php&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Written by &lt;span&gt;Linus Åkesson &lt;/span&gt;&lt;/p&gt;
&lt;h1&gt;Pipe Logic&lt;/h1&gt;
&lt;p&gt;&lt;span class="blurb"&gt;Delightfully useless epiphany: Suppose the null-byte is an electron. Then, /dev/zero provides an infinite supply of electrons and /dev/null has an infinite appetite for them. Let&amp;#8217;s call these devicesVss and Vdd, respectively.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In this model, a &lt;a href="http://en.wikipedia.org/wiki/Named_pipe"&gt;UNIX pipe&lt;/a&gt; acts like a wire, that is, a &lt;a href="http://en.wikipedia.org/wiki/Electrical_conductor"&gt;conductor&lt;/a&gt; with &lt;a href="http://en.wikipedia.org/wiki/Parasitic_capacitance"&gt;parasitic capacitance&lt;/a&gt;. If the pipe is connected to Vss, its pipe buffer in kernel space quickly fills up with null-bytes, and the pipe acts like a negatively charged metal plate. If it is connected to Vdd, the pipe buffer is drained, and the pipe acts like a positively charged metal plate.&lt;/p&gt;
&lt;p&gt;Pipes may thus carry &lt;a href="http://en.wikipedia.org/wiki/Logic_level"&gt;logic signals&lt;/a&gt;: A pipe that is filled with null-bytes corresponds to a logic zero, and a pipe that is completely empty corresponds to a logic one. A pipe that contains some null-bytes, but is neither full nor empty, corresponds to a voltage in the undefined range, and will act as a one or a zero depending on how we measure it.&lt;/p&gt;
&lt;h2&gt;Transistors&lt;/h2&gt;
&lt;div&gt;
&lt;div&gt;&lt;img src="http://www.linusakesson.net/programming/pipelogic/nmosfet.png"/&gt;&lt;p class="stamp"&gt;nMOSFET&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;img src="http://www.linusakesson.net/programming/pipelogic/pmosfet.png"/&gt;&lt;p class="stamp"&gt;pMOSFET&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;So how &lt;em&gt;do&lt;/em&gt; we measure it? In order to build logic, we&amp;#8217;re going to need some kind of &lt;a href="http://en.wikipedia.org/wiki/Transistor"&gt;transistor&lt;/a&gt;. Consider the &lt;a href="http://en.wikipedia.org/wiki/Field-effect_transistor"&gt;field-effect transistor&lt;/a&gt;: An &lt;a href="http://en.wikipedia.org/wiki/MOSFET#Modes_of_operation"&gt;enhancement-mode nMOSFET&lt;/a&gt;allows electrons to pass from the source pin to the drain pin when a logic one is present at the gate pin. Conversely, a pMOSFET allows electrons to pass from the drain pin to the source pin when a logic zero is present at the gate. However, no current flows through the gate pin; like a charged balloon sticking to the ceiling, the electrons at the gate just sit there and affect the transistor by means of the electromagnetic force.&lt;/p&gt;
&lt;p&gt;Pipes have &lt;a href="http://en.wikipedia.org/wiki/Flow_control"&gt;flow control&lt;/a&gt;: Writes to a full pipe will block, as will reads from an empty pipe. Hence, our MOSFET would need to sense whether a read or write would block, without actually performing the read or write operation. As far as I know, no standard UNIX command can be forced into this role, but we can write such a program from scratch easily enough:&lt;/p&gt;
&lt;h3&gt;&lt;a href="http://www.linusakesson.net/programming/pipelogic/mosfet.c"&gt;mosfet.c&lt;/a&gt;&lt;/h3&gt;
&lt;div class="otherbg"&gt;
&lt;pre class="prettyprint"&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;limits.h&amp;gt;
#include &amp;lt;err.h&amp;gt;
#include &amp;lt;unistd.h&amp;gt;
#include &amp;lt;sys/select.h&amp;gt;
#include &amp;lt;sys/types.h&amp;gt;
#include &amp;lt;sys/stat.h&amp;gt;
#include &amp;lt;fcntl.h&amp;gt;

int main(int argc, char **argv) {
	int gate, pmos;
	char buf[65536];
	fd_set fds;
	ssize_t size;
	struct stat statbuf;
	char *filename;

	if(argc != 2) errx(1, "Usage: %s [-]gate", argv[0]);

	pmos = (*argv[1] == '-');
	filename = argv[1] + pmos;

	if((gate = open(filename, O_RDWR)) &amp;lt; 0) err(1, "%s", filename);
	if(fstat(gate, &amp;amp;statbuf) &amp;lt; 0) err(1, "stat: %s", filename);
	if(!S_ISFIFO(statbuf.st_mode)) errx(1, "%s: ceci n'est pas une pipe", filename);

	for(;;) {
		FD_ZERO(&amp;amp;fds);
		FD_SET(gate, &amp;amp;fds);
		if(select(gate + 1, (pmos? &amp;amp;fds : 0), (pmos? 0 : &amp;amp;fds), 0, 0) &amp;lt; 0) err(1, "select");
		if(FD_ISSET(gate, &amp;amp;fds)) {
			if((size = read(0, buf, sizeof(buf))) &amp;lt; 0) err(1, "read");
			if((size = write(1, buf, size)) &amp;lt; 0) err(1, "write");
			usleep(20000);
		}
	}
}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;This program acts like a gated cat(1). It connects to a named pipe, and senses whether it currently holds a logic one or a logic zero. Depending on the mode of the program (as indicated by a dash character in front of the argument), this will either enable or disable the continuous transfer of bytes from standard input (presumably a pipe or Vss) to standard output (presumably a pipe or Vdd). The call to usleep(3) ensures that no process will starve in situations where pipes have multiple readers and/or writers. The number 65536 is the Linux &lt;em&gt;pipe capacity&lt;/em&gt;, as documented in pipe(7).&lt;/p&gt;
&lt;p&gt;When the gate voltage is in the undefined range, our MOSFET program will conduct regardless of mode. Thus, whenever a signal switches, there will be a brief period of chaotic activity until the system settles down into a known state, just like with real &lt;a href="http://en.wikipedia.org/wiki/CMOS"&gt;CMOS&lt;/a&gt; circuits.&lt;/p&gt;
&lt;div&gt;&lt;img src="http://www.linusakesson.net/programming/pipelogic/cmosnand.png"/&gt;&lt;p class="stamp"&gt;CMOS NAND gate&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;Logic gates&lt;/h2&gt;
&lt;p&gt;Using only pipes and our small MOSFET program, we should be able to construct arbitrarily complex digital circuits. Let&amp;#8217;s start with a simple &lt;a href="http://en.wikipedia.org/wiki/Nand_gate"&gt;NAND gate&lt;/a&gt;, here in the form of a shell script:&lt;/p&gt;
&lt;h3&gt;&lt;a href="http://www.linusakesson.net/programming/pipelogic/nand.sh"&gt;nand.sh&lt;/a&gt;&lt;/h3&gt;
&lt;div class="otherbg"&gt;
&lt;pre class="prettyprint"&gt;#!/bin/sh

# Usage: nand.sh A B Out

A=$1
B=$2
OUT=$3

VDD=/dev/null
VSS=/dev/zero

./mosfet &amp;lt;$OUT -$A &amp;gt;$VDD &amp;amp;
./mosfet &amp;lt;$OUT -$B &amp;gt;$VDD &amp;amp;

./mosfet &amp;lt;$VSS $B | ./mosfet $A &amp;gt;$OUT&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;We can test it by creating three named pipes, connecting them manually to Vss or Vdd using cat(1), which behaves like a &lt;a href="http://en.wikipedia.org/wiki/Diode"&gt;diode&lt;/a&gt;, and connecting the output to something that acts like a &lt;a href="http://en.wikipedia.org/wiki/Buzzer"&gt;buzzer&lt;/a&gt;or &lt;a href="http://en.wikipedia.org/wiki/Led"&gt;LED&lt;/a&gt;:&lt;/p&gt;
&lt;div&gt;
&lt;div class="otherbg"&gt;
&lt;pre class="prettyprint"&gt;$ mkfifo a b q
$ cat &amp;lt;/dev/zero &amp;gt;a &amp;amp;     # a is low
$ cat &amp;lt;b &amp;gt;/dev/null &amp;amp;     # b is high
$ ./nand.sh a b q &amp;amp;
$ tr '\000' '\a' &amp;lt;q       # q should be high =&amp;gt; no bell&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class="otherbg"&gt;
&lt;pre class="prettyprint"&gt;$ mkfifo a b q
$ cat &amp;lt;a &amp;gt;/dev/null &amp;amp;     # a is high
$ cat &amp;lt;b &amp;gt;/dev/null &amp;amp;     # b is high
$ ./nand.sh a b q &amp;amp;
$ tr '\000' '\a' &amp;lt;q       # q should be low =&amp;gt; bell&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You&amp;#8217;ll want to do killall mosfet after each run.&lt;/p&gt;
&lt;p&gt;Note that we use tr(1) such that it will continuously ring or flash (depending on whether the terminal has an audible or visible bell) when the output q is &lt;em&gt;low&lt;/em&gt;, that is, when both a and b are connected to /dev/null.&lt;/p&gt;
&lt;h2&gt;Control panel&lt;/h2&gt;
&lt;p&gt;This is clearly not practical for large designs, so we could benefit from some kind of control panel program with buttons and indicators: &lt;a href="http://www.linusakesson.net/programming/pipelogic/panel.c"&gt;panel.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You don&amp;#8217;t have to read the code, it&amp;#8217;s pretty straight-forward. But download it and try it out! Each argument corresponds to a named pipe which is treated like a button when prefixed with a dash, and like an indicator otherwise.&lt;/p&gt;
&lt;p&gt;This is what it looks like for the NAND scenario:&lt;/p&gt;
&lt;div class="otherbg"&gt;$ mkfifo a b out&lt;br/&gt;$ ./nand.sh a b out &amp;amp;&lt;br/&gt;$ ./panel -a -b out&lt;br/&gt;[a]  b  (&lt;span class="inverse"&gt;out&lt;/span&gt;)&lt;/div&gt;
&lt;p&gt;The inverted out indicates that out is currently high. By moving the cursor (the [ ] brackets) you can select any button and toggle its value using the space key. Press q to quit the program. Don&amp;#8217;t forget to kill all mosfet processes when you&amp;#8217;re done.&lt;/p&gt;
&lt;div&gt;&lt;img src="http://www.linusakesson.net/programming/pipelogic/mirroradder.png"/&gt;&lt;p class="stamp"&gt;CMOS Mirror Adder&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;Adding integers&lt;/h2&gt;
&lt;p&gt;The next step is to implement a &lt;a href="http://en.wikipedia.org/wiki/Full_adder#Full_adder"&gt;full adder&lt;/a&gt; (a 1-bit adder with carry in and carry out). Now, of course, every &lt;a href="http://en.wikipedia.org/wiki/Combinational_logic"&gt;combinational function&lt;/a&gt; can be realised using NAND gates, but that&amp;#8217;s not very transistor efficient. This is how a typical CMOS full adder is constructed:&lt;/p&gt;
&lt;h3&gt;&lt;a href="http://www.linusakesson.net/programming/pipelogic/fa.sh"&gt;fa.sh&lt;/a&gt;&lt;/h3&gt;
&lt;div class="otherbg"&gt;
&lt;pre class="prettyprint"&gt;#!/bin/sh

# Usage: fa.sh A B Cin Cout Sum

A=$1
B=$2
CIN=$3
COUT=$4
SUM=$5

T1=tmp.fa.t1.$$
T2=tmp.fa.t2.$$
T3=tmp.fa.t3.$$
T4=tmp.fa.t4.$$
NCOUT=tmp.fa.ncout.$$
NSUM=tmp.fa.nsum.$$

VSS=/dev/zero
VDD=/dev/null

rm -f $T1 $T2 $T3 $T4 $NCOUT $NSUM
mkfifo $T1 $T2 $T3 $T4 $NCOUT $NSUM

# Mirror Adder

./mosfet &amp;lt;$T1 -$A &amp;gt;$VDD &amp;amp;
./mosfet &amp;lt;$T1 -$B &amp;gt;$VDD &amp;amp;
./mosfet &amp;lt;$NCOUT -$CIN &amp;gt;$T1 &amp;amp;
./mosfet &amp;lt;$NCOUT -$A | ./mosfet -$B &amp;gt;$VDD &amp;amp;

./mosfet &amp;lt;$VSS $A &amp;gt;$T2 &amp;amp;
./mosfet &amp;lt;$VSS $B &amp;gt;$T2 &amp;amp;
./mosfet &amp;lt;$T2 $CIN &amp;gt;$NCOUT &amp;amp;
./mosfet &amp;lt;$VSS $B | ./mosfet $A &amp;gt;$NCOUT &amp;amp;

./mosfet &amp;lt;$T3 -$A &amp;gt;$VDD &amp;amp;
./mosfet &amp;lt;$T3 -$B &amp;gt;$VDD &amp;amp;
./mosfet &amp;lt;$T3 -$CIN &amp;gt;$VDD &amp;amp;
./mosfet &amp;lt;$NSUM -$NCOUT &amp;gt;$T3 &amp;amp;
./mosfet &amp;lt;$NSUM -$CIN | ./mosfet -$B | ./mosfet -$A &amp;gt;$VDD &amp;amp;

./mosfet &amp;lt;$VSS $A &amp;gt;$T4 &amp;amp;
./mosfet &amp;lt;$VSS $B &amp;gt;$T4 &amp;amp;
./mosfet &amp;lt;$VSS $CIN &amp;gt;$T4 &amp;amp;
./mosfet &amp;lt;$T4 $NCOUT &amp;gt;$NSUM &amp;amp;
./mosfet &amp;lt;$VSS $A | ./mosfet $B | ./mosfet $CIN &amp;gt;$NSUM &amp;amp;

# Invert outputs

./mosfet &amp;lt;$VSS $NCOUT &amp;gt;$COUT &amp;amp;
./mosfet &amp;lt;$COUT -$NCOUT &amp;gt;$VDD &amp;amp;

./mosfet &amp;lt;$VSS $NSUM &amp;gt;$SUM &amp;amp;
exec ./mosfet &amp;lt;$SUM -$NSUM &amp;gt;$VDD&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Note how temporary fifos are created (T1, T2, T3, T4) with unique suffixes based on the current &lt;a href="http://en.wikipedia.org/wiki/Process_ID"&gt;process ID&lt;/a&gt; (the special variable $$ expands to the PID of the shell).&lt;/p&gt;
&lt;p&gt;Now we can cascade four full adders into a 4-bit adder and play with it using the control panel:&lt;/p&gt;
&lt;h3&gt;&lt;a href="http://www.linusakesson.net/programming/pipelogic/add4.sh"&gt;add4.sh&lt;/a&gt;&lt;/h3&gt;
&lt;div class="otherbg"&gt;
&lt;pre class="prettyprint"&gt;#!/bin/sh

FIFOS="a3 a2 a1 a0 b3 b2 b1 b0 c3 c2 c1 c0 s4 s3 s2 s1 s0"

rm -f $FIFOS
mkfifo $FIFOS

cat &amp;lt;/dev/zero &amp;gt;c0 &amp;amp;
./fa.sh a0 b0 c0 c1 s0 &amp;amp;
./fa.sh a1 b1 c1 c2 s1 &amp;amp;
./fa.sh a2 b2 c2 c3 s2 &amp;amp;
./fa.sh a3 b3 c3 s4 s3 &amp;amp;

./panel -a3 -a2 -a1 -a0 -b3 -b2 -b1 -b0 s4 s3 s2 s1 s0

killall mosfet
rm -f $FIFOS tmp.*&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The reason for having a c0 pipe which is connected to the electron supply via cat, rather than just using /dev/zero directly, is that our MOSFET program only works if the gate input is a proper pipe. That&amp;#8217;s because /dev/zero actually allows you to write data into it, just like /dev/null, so if we hook it up directly to a gate, it&amp;#8217;s going to behave like an undefined signal.&lt;/p&gt;
&lt;p&gt;This is what the 4-bit adder setup looks like when calculating the sum of five and seven:&lt;/p&gt;
&lt;div class="otherbg"&gt; a3   &lt;span class="inverse"&gt;a2&lt;/span&gt;   a1   &lt;span class="inverse"&gt;a0&lt;/span&gt;   b3   &lt;span class="inverse"&gt;b2&lt;/span&gt;   &lt;span class="inverse"&gt;b1&lt;/span&gt;  [&lt;span class="inverse"&gt;b0&lt;/span&gt;] (s4) (&lt;span class="inverse"&gt;s3&lt;/span&gt;) (&lt;span class="inverse"&gt;s2&lt;/span&gt;) (s1) (s0)&lt;/div&gt;
&lt;p&gt;Twelve looks about right. Clearly, we&amp;#8217;re approaching something useful here.&lt;/p&gt;
&lt;h2&gt;Where is the information?&lt;/h2&gt;
&lt;p&gt;Let&amp;#8217;s pause for a moment and consider which role the pipes play in this system. They form some kind of network fabric that allows our MOSFET instances to communicate, and yet the information being communicated is not transmitted through the pipes, because the pipes just provide an infinite series of completely predictable null-bytes. In contrast, the actual information is transmitted through the flow control mechanism of the pipes. This is akin to modulated &lt;a href="http://en.wikipedia.org/wiki/Carrier_wave"&gt;carrier waves&lt;/a&gt; such as a brief break that propagates backwards through a line of moving cars on a road.&lt;/p&gt;
&lt;p&gt;What&amp;#8217;s fascinating about this, is that flow control information can travel across a pipe in either direction. The null-bytes always travel from the writing end to the reading end, but just as the writer may signal the reader by filling an empty pipe, the reader may signal the writer by draining a full pipe. The communication is &lt;a href="http://en.wikipedia.org/wiki/Half_duplex#Half-duplex"&gt;half-duplex&lt;/a&gt; however, because the reader and the writer would get in each other&amp;#8217;s way if they tried to do this simultaneously.&lt;/p&gt;
&lt;h2&gt;Registers&lt;/h2&gt;
&lt;p&gt;One critical building block is still missing. Combinational logic is all very well, but large digital designs tend to consist of a number of interconnected &lt;a href="http://en.wikipedia.org/wiki/State_machine"&gt;state machines&lt;/a&gt;. In order to build state machines, we need to be able to keep track of the current state as bits in some kind of &lt;a href="http://en.wikipedia.org/wiki/Semiconductor_memory"&gt;memory&lt;/a&gt;.&lt;/p&gt;
&lt;div&gt;&lt;img src="http://www.linusakesson.net/programming/pipelogic/register.png"/&gt;&lt;p class="stamp"&gt;Positive edge triggered flip flop&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;A convenient type of memory is the &lt;a href="http://en.wikipedia.org/wiki/Flip-flop_(electronics)"&gt;D-flip flop&lt;/a&gt;. It can be implemented in a number of ways, and we&amp;#8217;ll go for a variant that uses &lt;em&gt;TSPC&lt;/em&gt; (true single-phase clocked) logic. This design is interesting because it relies on the parasitic capacitance of the wires, so when used in a real integrated circuit it requires a &lt;em&gt;minimum&lt;/em&gt; clock frequency to work, otherwise the bits stored in the registers become corrupt through leakage currents. Our pipe capacitors are ideal in the sense that there&amp;#8217;s no leakage at all. The buffers hold their contents until the pipe is destroyed.&lt;/p&gt;
&lt;h3&gt;&lt;a href="http://www.linusakesson.net/programming/pipelogic/flipflop.sh"&gt;flipflop.sh&lt;/a&gt;&lt;/h3&gt;
&lt;div class="otherbg"&gt;
&lt;pre class="prettyprint"&gt;#!/bin/sh

# Usage: flipflop.sh Clk D Q

CLK=$1
D=$2
Q=$3

D1H=tmp.ff.d1h.$$
D1L=tmp.ff.d1l.$$
D2H=tmp.ff.d2h.$$
D2L=tmp.ff.d2l.$$
NQ=tmp.ff.nq.$$

VSS=/dev/zero
VDD=/dev/null

FIFOS="$D1H $D1L $D2H $D2L $NQ"
rm -f $FIFOS
mkfifo $FIFOS

./mosfet &amp;lt;$VSS $D &amp;gt;$D1L &amp;amp;
./mosfet &amp;lt;$D1L -$CLK &amp;gt;$D1H &amp;amp;
./mosfet &amp;lt;$D1H -$D &amp;gt;$VDD &amp;amp;

./mosfet &amp;lt;$VSS $D1L &amp;gt;$D2L &amp;amp;
./mosfet &amp;lt;$D2L $CLK &amp;gt;$D2H &amp;amp;
./mosfet &amp;lt;$D2H -$D1H &amp;gt;$VDD &amp;amp;

./mosfet &amp;lt;$VSS $D2L &amp;gt;$NQ &amp;amp;
./mosfet &amp;lt;$NQ -$D2H &amp;gt;$VDD &amp;amp;

./mosfet &amp;lt;$VSS $NQ &amp;gt;$Q &amp;amp;
exec ./mosfet &amp;lt;$Q -$NQ &amp;gt;$VDD&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Like we did with the full adder, we&amp;#8217;ll tack on an inverter at the end in order to get the same polarity at the output and input; in a real design, we&amp;#8217;d just as often want the output signal inverted, in which case the extra inverter is unnecessary, which is why it&amp;#8217;s not considered to be a canonical part of the flip flop.&lt;/p&gt;
&lt;p&gt;The operation of this flip flop is quite elegant. Suppose Clk is low, so that the first stage becomes a regular inverter. Then, D1H = D1L = /D. The last stage is also an inverter, so let&amp;#8217;s assume we have D2H = D2L = Q. These two stages are separated by an inverter that has been split into two halves by the second clocking transistor. Suppose D ≠ Q, so that D1H =D1L = D2H = D2L, which would not be possible if the split inverter were a regular inverter. The upper half of the split inverter can only pull D2H to a high level, but D2H affects a transistor in the final stage which only turns on when provided with a low gate voltage. Conversely, the lower half of the split inverter can only pull D2L to a low level, but D2Laffects a transistor which only turns on in response to a high gate voltage. The upshot of this is that /Q might be disconnected from whatever power rail was driving it, but as long as there is no leakage current, it retains its previous voltage. When the clock toggles, a similar phenomenon takes place in the left half of the circuit, while the right half behaves like a regular inverter, and the value of D propagates one step to the right.&lt;/p&gt;
&lt;p&gt;Note that the register will power up in an unknown state, possibly a &lt;a href="http://en.wikipedia.org/wiki/Metastability_in_electronics"&gt;metastable&lt;/a&gt; one. It must be cleared by explicitly clocking in a logic zero.&lt;/p&gt;
&lt;h2&gt;Putting it all together&lt;/h2&gt;
&lt;p&gt;Now we should be able to construct a working state machine. To keep it simple, we&amp;#8217;ll transform the 4-bit adder into a 4-bit accumulating machine. The current state is kept in a 4-bit register, its value represented by (q3, q2, q1, q0). The next state is calculated by adding a user-supplied 4-bit number to the current state. At every positive clock edge, the flip flops shift in the new bits provided by the adder, causing a state transition to take place.&lt;/p&gt;
&lt;h3&gt;&lt;a href="http://www.linusakesson.net/programming/pipelogic/counter.sh"&gt;counter.sh&lt;/a&gt;&lt;/h3&gt;
&lt;div class="otherbg"&gt;
&lt;pre class="prettyprint"&gt;#!/bin/sh

FIFOS="clk a3 a2 a1 a0 c4 c3 c2 c1 c0 d3 d2 d1 d0 q3 q2 q1 q0"

rm -f $FIFOS
mkfifo $FIFOS

cat &amp;lt;/dev/zero &amp;gt;c0 &amp;amp;
./fa.sh a0 q0 c0 c1 d0 &amp;amp;
./fa.sh a1 q1 c1 c2 d1 &amp;amp;
./fa.sh a2 q2 c2 c3 d2 &amp;amp;
./fa.sh a3 q3 c3 c4 d3 &amp;amp;

./flipflop.sh clk d0 q0 &amp;amp;
./flipflop.sh clk d1 q1 &amp;amp;
./flipflop.sh clk d2 q2 &amp;amp;
./flipflop.sh clk d3 q3 &amp;amp;

./panel -a3 -a2 -a1 -a0 -clk q3 q2 q1 q0

killall mosfet
rm -f $FIFOS tmp.*&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;And if you try it, you&amp;#8217;ll find that it runs like clockwork.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;So there it is. We&amp;#8217;ve been able to construct gates and flip flops using nothing but UNIX pipes and our small MOSFET tool. We may now proceed to design any digital circuits we want: Processors, memories, entire computers&amp;#8230; The world is ours to conquer!&lt;/p&gt;
&lt;p&gt;As long as we don&amp;#8217;t run out of PIDs.&lt;/p&gt;</description><link>http://chmod755.tumblr.com/post/24451477388</link><guid>http://chmod755.tumblr.com/post/24451477388</guid><pubDate>Mon, 04 Jun 2012 23:47:58 -0400</pubDate><category>linux</category><category>transistor</category><category>technology</category><category>tech</category><category>computer</category></item><item><title>fuckyeahterminals:

Alright that’s enough Project Euler for...</title><description>&lt;iframe width="400" height="300" src="http://www.youtube.com/embed/rUWfod_8JsM?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a class="tumblr_blog" href="http://fuckyeahterminals.tumblr.com/post/23976461473/alright-thats-enough-project-euler-for-today"&gt;fuckyeahterminals&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Alright that’s enough Project Euler for today, I’ll leave you with this&lt;/p&gt;
&lt;p&gt;Michio Kaku is such a fun physicist&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Interesting note about the carbon transistors at the end. Moore’s Law no longer applies. Ivy Bridge was released last April using 22nm transistors, and 14nm gates should be released around this time next year. They just recently announced beginning to work on 5nm chips. &lt;br/&gt;&lt;br/&gt;That means at this rate, we’ll have transistors the size of a strand of DNA by 2016 or 2017.  What will the next generation of computing be?&lt;/p&gt;</description><link>http://chmod755.tumblr.com/post/23985249192</link><guid>http://chmod755.tumblr.com/post/23985249192</guid><pubDate>Tue, 29 May 2012 02:34:46 -0400</pubDate><category>transistor</category><category>technology</category><category>tech</category><category>computer</category></item></channel></rss>
