tag:blogger.com,1999:blog-62303472024-03-17T02:52:34.048-04:00Linux & ThingsRock. Chalk. Jayhawk.
With Linux.rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.comBlogger879125tag:blogger.com,1999:blog-6230347.post-18009286838506258922020-02-17T18:17:00.002-05:002020-02-17T18:17:21.543-05:00Schrodinger's Inspiration<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYJ9Wx3OKJ-e5Kn6Wsqkwv4xXuMNjU9DT9RasIobNpwDhoictQ6-jMVd8-OejDTqHZkVoOvcYvkO383AC9GTyLQvqay08wnSK_u39RFFHH70RsoYz6gDtPUfn5RQ0Riqt17C9a/s1600/SchrodingersInspiration.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1017" data-original-width="1002" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYJ9Wx3OKJ-e5Kn6Wsqkwv4xXuMNjU9DT9RasIobNpwDhoictQ6-jMVd8-OejDTqHZkVoOvcYvkO383AC9GTyLQvqay08wnSK_u39RFFHH70RsoYz6gDtPUfn5RQ0Riqt17C9a/s320/SchrodingersInspiration.png" width="315" /></a></div>
rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-77120652648079358352019-06-11T20:33:00.000-04:002019-06-11T20:33:59.274-04:00SPOILER for Tiamat's WrathI you don't know what <i>Tiamat's Wrath</i> is about, I'm sorry. Start with <a href="https://en.wikipedia.org/wiki/Leviathan_Wakes"><i>Leviathan Wakes</i></a>
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxytDdSiPxdx10t16vaEbc3wAPIy40yL3wUgLAIkTzzOmSpBeA8sHBeasOHgFEAKGmvxF9X1iCYURvbpGFpObdunlYbXj4zZGqSpT6fkb8JfNGwfzI1MfnQjoVQfpdGk9axhvJ/s1600/IKnowThings1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxytDdSiPxdx10t16vaEbc3wAPIy40yL3wUgLAIkTzzOmSpBeA8sHBeasOHgFEAKGmvxF9X1iCYURvbpGFpObdunlYbXj4zZGqSpT6fkb8JfNGwfzI1MfnQjoVQfpdGk9axhvJ/s1600/IKnowThings1.jpg" data-original-width="973" data-original-height="743" /></a></div>rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-19927640138892689622017-10-30T19:10:00.002-04:002017-10-30T19:10:37.110-04:00Blocking an IP Address<p>Well, well, well: I've acquired my very own hacker.</p>
<p>I was looking in my various log files to see if a broken disk was even trying to mount (it wasn't). The most recently written log file was <tt>/var/log/auth.log</tt>, so I opened it up and found messages along the lines of:</p>
<pre>
Oct 30 18:51:02 hal sshd[5843]: Failed password for root from xxx.yyy.zzz.aa port 39551 ssh2
Oct 30 18:51:07 hal sshd[5843]: message repeated 2 times: [ Failed password for root from xxx.yyy.zzz.aa port 39551 ssh2]
Oct 30 18:51:07 hal sshd[5843]: Received disconnect from xxx.yyy.zzz.aa port 39551:11: [preauth]
Oct 30 18:51:07 hal sshd[5843]: Disconnected from xxx.yyy.zzz.aa port 39551 [preauth]
Oct 30 18:51:07 hal sshd[5843]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=xxx.yyy.zzz.aa user=root
</pre>
<p>Where xxx.yyy.zzz.aa maps to a country that absolutely, positively, certainly is our friend.</p>
<p>Said frenemy wasn't happy trying just port 39551, and hit other ports as well. He/She/It is obviously trying a brute-force password attack against hal (That's never a good idea, Dave). The question is, what to do about it?</p>
<p>A quick Google Search found <a target="_blank" href="https://www.cyberciti.biz/faq/how-do-i-block-an-ip-on-my-linux-server/">How Do I Block an IP Address on My Linux server?</a>, which gives the answer: to block a specific address, use the command:</p>
<pre>
sudo iptables -A INPUT -s xxx.yyy.zzz.aa -j DROP
</pre>
<p>where xxx.yyy.zzz.aa is the specific address you want to drop.</p>
<p>I did that, and it worked: the attack from that specific address stopped. But I'm sure there will be others.</p>
<p>It looks like that will work OK, but I'm also going to investigate ipsets, as noted in: <a target="_blank" href="http://xmodulo.com/block-unwanted-ip-addresses-linux.html">How to block unwanted IP addresses on Linux efficiently</a>. I'll let you know how it works.</p>
<p>P.S.: Should you “accidentally” block your weird uncle's IP, you can get it back with the command:</p>
<pre>
sudo iptables -D INPUT -s xxx.yyy.zzz.aa -j DROP
</pre>
rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-14410984293882208002017-10-06T18:52:00.000-04:002017-10-06T18:52:05.459-04:00Printer Installation: CUPS Shared Printer<p>So I've got the new Windows/Linux HP Pavilion, as mentioned in the last post. I also have a Brother HL2240 USB printer attached to my old Linux machine, Hal. How to hook that up?</p>
<p>First, you need the name of your printer on your old Linux (or Mac) box. In the browser window, enter http://localhost:631/printers/ Click on the printer you want to share. Now your browser address bar will be http://localhost:631/printers/Yourprintername. Remember Yourprintername — in my case it's HL2240.</p>
<p>For the Linux side of the machine, it's best to <a href="http://support.brother.com/g/b/downloadtop.aspx?c=us&lang=en&prod=hl2240_us_eu">get the Brother printer driver for Linux</a>. Then</p>
<ul>
<li>Install the thing, excepting the soul-destroying EULA</li>
<li>It will ask for your device URI. Ignore that</li>
<li>In the main menu, find System > Administration > Printers</li>
<li>Select Add</li>
<li>For the device URI, use ipp://address:631/printers/Yourprintername, where <q>address</q> is the URL of the computer with the printer attached to it (In this case Hal), <em>as seen on your local network</em>.</li>
<li>When it asks for a printer driver, enter the location /usr/share/cups/model/HL2240.ppd , or whatever the model of your printer is.</li>
</ul>
<p>For Windows, you can install the Brother Windows drivers, but they assume you have a USB printer connected to that printer. I ended up using the default Brother postscript driver. Then</p>
<ul>
<li>Go to Settings > Printers and Scanners</li>
<li>When you see the option "The printer that I want isn't listed", click it</li>
<li>Click <q>Select a shared printer by name</q></li>
<li>In the address box enter http://address:631/printers/Yourprintername . Note the http, not ipp</li>
<li>Click next, find the correct driver, and install.</li>
</ul>
<p>If that doesn't work, add a comment, let's see if we can fix it.</p>
rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-61889976724749771032017-10-04T18:43:00.001-04:002017-10-04T18:43:17.857-04:00Virtualization in a New HP Computer<p>I just bought a new <a target="_blank" href="https://support.hp.com/us-en/document/c05583260">HP Pavilion 15</a> as a possible desktop replacement.</p>
<p>Naturally, I want to run Linux on this baby, <em>but</em> I'm still not sure I'll keep it. So until I decide for sure, let's put Linux on a Virtual Machine using <a blank="_target" href="https://www.virtualbox.org/">VirtualBox</a>. This is how I run Linux on my work Mac.</p>
<p>No problem, right? Well ...,</p>
<p>Install VirtualBox on the HP, get an ISO of your favorite Linux distribution, and go to town. Right?</p>
<p>Except when you turn on VirtualBox, you get a message</p>
<p><large>VT-x is not available.</p>
<p>It seems that virtualization is disabled on new HP machines, and probably others. Except Macs.</p>
<p>The solution is the turn on virtualization in the BIOS. Which is only tricky if you don't know how to get to the BIOS, which is likely because it changes from machine to machine.</p>
<p><a target="_blank" href="https://amiduos.com/support/knowledge-base/article/enabling-virtualization-technology-in-hp-systems">AMIDuOS has the solution for HP systems</a>. For other systems, look around, hopefully you'll find something.</p>
<p>Have Fun</p>
rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-37307150442416724732017-02-19T16:45:00.001-05:002017-02-19T16:45:52.638-05:00Stop application windows snapping to full screen<p>I'm back using <a target="_blank" href="https://www.linuxmint.com/edition.php?id=220">Linux Mint Mate Edition</a>. I love the Mate desktop, because it's the closest thing to the beloved Gnome 2 desktop that's still out there.</p>
<p>But ... if you're dragging a window around and accidentally touch the top panel, the window snaps to full screen.</p>
<p>So <a target="_blank" href="https://linuxnorth.wordpress.com/2016/08/15/stop-application-windows-snapping-to-full-screen/">here's how to fix that</a>, thanks to <a href="https://linuxnorth.wordpress.com/">Linux North</a>.</p>
rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-76304309978445999202016-12-28T11:58:00.001-05:002016-12-28T11:58:06.292-05:00Simple ISO images<p>So here I am, busy installing a new version of <a target="_blank" href="https://www.linuxmint.com/">Linux Mint</a> on Hal, my Linux Box.</p>
<p>To do this, I want to</p>
<ul>
<li>Use <a target="_blank" href="http://gparted.org/">GParted</a> to reformat Hal's main disk, partitioning it the way I'd like it to be, and</li>
<li>Install Linux Mint from an ISO image.</li>
</ul>
<p>In the old days this meant burning the ISO images for both GParted and Linux Mint to CDs or DVDs, as appropriate, and booting from the DVD drive. Now days we'd kind of like to have the images on a bootable USB drive. Especially GParted, which is useful for disk manipulation on any machine.</p>
<p>In general <a target="_blank" href="http://askubuntu.com/questions/240803/convert-bootable-usb-to-iso-file">a big pain</a>, as you have to remember the intricacies of the <tt>dd</tt> command.</p>
<p>When I was preparing for the update, listed all of the packages I'd installed using LMDE, my old Linux version. In there, I found something called <tt>mintstick</tt>, which is billed as <q>Tool to write .img and .iso files to USB sticks. Can also format them.</q></p>
<p>And it works. Here's what you do</p>
<ol>
<li>Download your ISO image</li>
<li>Insert your USB Stick</li>
<li>Launch mintstick from a terminal window, using the command <br />
<tt>$ mintstick -m iso</tt>
</li>
<li>A window will pop up that looks something like this:
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrAMFgbQrYW5D9EBF5RLc5ZJXDkx-36FQ9RAhc_jpBaiadzEdDPgcVHaWjOGjFHoQy1dZdZcDyDr7HW-f-p3K-eRdajl-0JYuIKCsdUE24ZsQWpkhyphenhyphentZuCxHYB8HATjgaJTk9I/s1600/mintstick1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrAMFgbQrYW5D9EBF5RLc5ZJXDkx-36FQ9RAhc_jpBaiadzEdDPgcVHaWjOGjFHoQy1dZdZcDyDr7HW-f-p3K-eRdajl-0JYuIKCsdUE24ZsQWpkhyphenhyphentZuCxHYB8HATjgaJTk9I/s320/mintstick1.png" width="320" height="115" /></a></div>
</li>
<li>On the left, use the dropdown menu to find your ISO image</li>
<li>On the right, find the USB drive. (Make sure you get the right one.) You'll get something that looks like this:
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7Jnb5qOsmfqxiH4NI60BSBnj1iK0L__yiFJ5hI-oatK49uTZ_plXyOxRRiYLfBbHjtMwMOmH44iFkShchdnT2s3oVzqd_3_9NlCodaOEQLF1tz5IN6knlTFJyoqpnTxO5m4Lx/s1600/mintstick2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7Jnb5qOsmfqxiH4NI60BSBnj1iK0L__yiFJ5hI-oatK49uTZ_plXyOxRRiYLfBbHjtMwMOmH44iFkShchdnT2s3oVzqd_3_9NlCodaOEQLF1tz5IN6knlTFJyoqpnTxO5m4Lx/s320/mintstick2.png" width="320" height="102" /></a></div>
</li>
<li>Click the Write button once it's highlighted.</li>
<li>Wait for completion.</li>
<li>Remove USB drive, and test on your target machine.</li>
</ol>
<p>Supremely easy.</p>
<p>If you launch mintstick without the -m option you'll see it can do formatting, too, but I haven't looked into that. If you figure it out, leave a comment</p>
rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-15758240672550177942016-11-25T17:46:00.000-05:002016-11-25T17:46:16.212-05:00Animation in PDF Presentations<p>
I've been teaching an introductory class in physics and wanted to show my students how a standing wave gets constructed. The math & physics of it aren't too hard, really:
</p>
<ul>
<li>
Start with a wave of a given frequency and wavelength, moving to to right.
</li>
<li>
Add a similar wave, with the same frequency, wavelength, and amplitude, except that it's moving to the left.
</li>
<li>
Add them together, and the combined waves will have a fixed points (nodes) every λ/2, where λ is the common wavelength.
</li>
</ul>
<p>
The whole process looks something like this:
</p>
<center>
<img src="https://lh3.googleusercontent.com/-3TVKDdLfl1A/WDijq7QlP5I/AAAAAAAAFHs/6nJoMNw4lIQQZI8Lw-jVBdHfwT9PTjdHgCL0B/w579-d-h435/standing_waves.gif" alt="Animation of standing wave generated from two traveling waves" />
</center>
<p>
The problem is twofold. First, how to construct such an animation, and second, how to get it into a presentation.
</p>
<p>
To begin, we need to create a moving plot. It turns out that my favorite plotting program, <a target="_blank" href="http://gnuplot.sourceforge.net/">gnuplot</a>, is sort up to the task. Sort of. You'd expect that an animation algorithm would follow a set of rules like this:
</p>
<ul>
<li>
Draw the picture at time t = 0
</li>
<li>
Increment the time a bit
</li>
<li>
Redraw the picture
</li>
<li>
Repeat after you've gone enough time steps to make you happy
</li>
</ul>
<p>
Most codes implement this with some kind of a loop function. Gnuplot doesn't have a loop. However, a file can ask that the program reread the file. So an animation gnuplot script has features like this:
</p>
<pre>
#! /usr/bin/gnuplot # Location of the source program YMMV
dt = 0.01 # Length of a time step (choose yours to fit your needs)
steps = 1000 # Number of steps you want
i = 0 # this is a counter. It will be incremented one every time step
load "realplot.gnu" # The actual plot file
</pre>
<p><tt>realplot.gnu</tt> has the meat of the plotting program. For our traveling sine wave, it looks something like this:</p>
<pre>
plot sin(x - i*dt) w l lt 1
i = i + 1
if (i < steps) reread
</pre>
<p>
The code plots the curve at a given time, then increments the time by an amount i*dt, and asks to be reread. The program does this until the final time step is completed.
</p>
<p>
That's fine, this displays a very nice set of curves on the screen. However, it's nothing you can embed in a presentation. We need to save the output in some form. The best way to do this right now is using an <a target="_blank" href="https://en.wikipedia.org/wiki/GIF#Animated_GIF">animated GIF</a>. Just like a movie, this is a collection of still images played at a pre-determined rate. Gnuplot has this capability. Adding these two lines changes the output from the screen to a file, in this case one named <tt>standing_waves.gif</tt>:
</p>
<pre>
set term gif enhanced font 'arial' 16 animate delay 0.05 size 1000,750 nooptimize
set output "standing_waves.gif"
</pre>
<p>
Most of this isn't hard to figure out:
</p>
<ul>
<li>
<tt>set term gif</tt> tells gnuplot to make the output a gif file
</li>
<li>
<tt>enhanced font 'arial' 16</tt> tells gnuplot to use its fancy plotting features, like printing Greek letters, and to use the Arial font with a font size of 16 (some platforms handle this better than others, more on that later)
</li>
<li>
<tt>animate delay 0.05</tt> says to do animation, and play the frames 0.05 seconds apart (25 frames/second)
</li>
<li>
<tt>size 1000,750</tt> is the size of the GIF, use what fits your presentation best
</li>
<li>
<tt>nooptimize</tt> is probably best. Optimization tries to save file space by only printing out the parts of a picture which are changing. This works on some platforms (my Linux box, my Mac at work), and fails on others (my Mac at home). So turning optimization off is probably best.
</li>
<li>
<tt>set output "standing_waves.gif"</tt> just tells gnuplot to output all these frames into a file.
</li>
</ul>
<p>
For my project, I then stacked a bunch of plots together. At the risk of boring you, here's the whole thing in detail.
</p>
<ul>
<li>The main calling program sets up everything that is going to be fixed throughout the run, sets the time steps, etc. I'm doing this for a fixed number of periods, with a fixed number of time steps per period. For those who need to know, I set the wavelength to be 2π in arbitrary units, and the period to also be 2π, again in arbitrary units.
<pre>
#! /usr/bin/gnuplot
# Settings which remain the same for all graphs
set samples 2000
unset ytics
set xrange [0:7*pi]
set yrange [-2.6:2.6]
set xtics ("0" 0,"{/Symbol l}/2" pi,"{/Symbol l}" 2*pi, \
"3{/Symbol l}/2" 3*pi, "2{/Symbol l}" 4*pi, \
"5{/Symbol l}/2" 5*pi, "3{/Symbol l}" 6*pi, \
"7{/Symbol l}/2" 7*pi)
set arrow 1 from pi,graph 0 to pi,graph 1 nohead lt -1
set arrow 2 from 2*pi,graph 0 to 2*pi,graph 1 nohead lt -1
set arrow 3 from 3*pi,graph 0 to 3*pi,graph 1 nohead lt -1
set arrow 4 from 4*pi,graph 0 to 4*pi,graph 1 nohead lt -1
set arrow 5 from 5*pi,graph 0 to 5*pi,graph 1 nohead lt -1
set arrow 6 from 6*pi,graph 0 to 6*pi,graph 1 nohead lt -1
set key opaque
set key reverse Left
set xzeroaxis
# Length of time used to plot each image, in periods
periods = 1.00
# Number of time steps for each period
stepsperperiod = 50
# Length of a time step
dt = 2*pi/stepsperperiod
# Total number of setps
maxstep = periods*stepsperperiod
set term gif enhanced font 'arial' 16 animate delay 0.05 size 1000,750 nooptimize
set output "standing_waves.gif"
# Remember to reset the time before running each plot
i = 0
load "rightsine.gnu"
i= 0
load "leftsine.gnu"
i = 0
load "bothsine.gnu"
i = 0 load "constructive.gnu"
i = 0 load "standing.gnu"
</pre>
</li>
<li> The remaining files have everything that changes in from one graphic to the next:
<br /> A rightward traveling wave:
<pre>
set title "Wave Traveling to Right"
plot sin(x-i*dt) t "sin ( k x - {/Symbol w} t)" w l lt rgb "red" lw 8
i = i + 1
if (i < maxstep) reread
</pre>
<br /> A leftward traveling wave:
<pre>
set title "Wave Traveling to Left"
plot sin(x+i*dt) t "sin ( k x + {/Symbol w} t)" w l lt rgb "green" lw 8
i = i + 1
if (i < maxstep) reread
</pre>
<br /> Both waves together:
<pre>
set title "Both Waves"
plot sin(x-i*dt) t "sin ( k x - {/Symbol w} t)" w l lt rgb "red" lw 8 , \
sin(x+i*dt) t "sin ( k x + {/Symbol w} t)" w l lt rgb "green" lw 8
i = i + 1
if (i < maxstep) reread
</pre>
<br /> Both waves, along with the combined waveform:
<pre>
set title "Constructive Interference"
plot sin(x-i*dt) t "sin ( k x - {/Symbol w} t)" w l lt rgb "red" lw 8 , \
sin(x+i*dt) t "sin ( k x + {/Symbol w} t)" w l lt rgb "green" lw 8 , \
sin(x-i*dt)+sin(x+i*dt) t "Combined Waves" w l lt rgb "blue" lw 8
i = i + 1
if (i < maxstep) reread
</pre>
<br /> Just the final wave:
<pre>
set title "Standing Wave"
plot sin(x-i*dt)+sin(x+i*dt) t "Combined Waves" w l lt rgb "blue" lw 8
i = i + 1
if (i < maxstep) reread
</pre>
</li>
</ul>
<p>
The result is just what you see in the picture above.
</p>
<p>
Now we want to get this into a presentation. You can obviously embed this into a web page, as we're doing now. You can also put it into a Powerpoint presentation.
</p>
<p>
I, however, like to to my presentations in <a target="_blank" href="https://www.ctan.org/pkg/beamer?lang=en">Beamer</a>, a class in <a target="_blank" href="https://www.latex-project.org/">LaTeX</a> which can produce fairly nice PDF files. The problem is that <tt>pdflatex</tt>, which takes LaTeX source and produces a PDF file, doesn't know nor care anything about GIFs, animated or not, so first we have to convert the GIF into something LaTeX can handle. The answer is the <a target="_blank" href="http://www.libpng.org/pub/png/">PNG</a> format, which LaTeX loves. We simply use the <tt>convert</tt> command from <a target="_blank" href="https://www.imagemagick.org/script/index.php">ImageMagick</a>:
</p>
<pre>
convert standing_waves.gif sw.png
</pre>
<p>
and <em>Whoa!</em> we get a bunch of PNG files, conveniently labeled sw-0.png, sw-1.png, sw-2.png, ... , all the way up to, in this case, sw-249.png. To put them all back together we need to use the LaTeX package <a target="_blank" href="https://www.ctan.org/pkg/animate?lang=en">animate</a>. A very simple Beamer file might look like this:
</p>
<pre>
\documentclass{beamer}
% Allow animation
\usepackage{animate}
\begin{document}
\section{Standing Waves}
\begin{frame}
\begin{center}
\animategraphics[loop,controls,height=7cm]{25}{png/sw-}{0}{249}
\end{center}
\end{frame}
\end{document}
</pre>
<p>
Most of this is pretty self-explanatory. I put the PNG files into a sub-directory, so they are png/sw-0.png, png/sw-1.png, ... . The {25} is the number of frames per second, since we lost that information from the GIF file. Keep running pdflatex on this until the errors stop, and <em>voila</em>, you've got a PDF presentation with animation. You'll have to use Adobe Reader to play it out, but hey, it works.
</p>
<p>
I've made all of this work on my LMDE box, and on two Macs, both using <a target="_blank" href="https://www.google.com/search?q=macports&ie=utf-8&oe=utf-8">Macports</a> to get the LaTeX and ImageMagick software. One of my Macs has a problem with the Greek fonts going into the GIF, and I don't know why. Also, gnuplot on the Mac is slightly different that my current Linux gnuplot, so I've written everything in a form that works on both machines. Finally, I've found that setting the font size works better on one of my Macs than it does on the other Mac or Linux box. I don't know why, but if I figure it out I'll let you know.
</p>
rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-80774776632632672242016-03-13T12:52:00.000-04:002016-03-13T12:56:12.990-04:00Office 2007 With Wine<p>Every once in a while I need a real honest to Bill version of Microsoft Office. Not often, but it happens.</p>
<p>Now I have a three license copy of Microsoft Office Home and Student Edition, purchased back in the day when Child No. 1 had a Windows computer. That computer is long gone and replace by a Mac. I could install this copy on Hal's Windows partition, but that means I have to reboot and update Windows 7 every time I want to use the software. Irritating.</p>
<p>Then yesterday I was updating my Harmony Remote, and found that the <a target="_blank" href="http://support.logitech.com/en_us/product/harmony-remote-650">update software</a> would run on Linux under <a target="_blank" href="https://www.winehq.org/">Wine</a>. True, the fonts were ugly, but hey, it ran, and given that updating a remote is a run-up-and-down-the-stairs-10-times kind of thing, having one less step was a blessing.</p>
<p>Now I've tried Wine before, and never been all that happy with it. But maybe it's now <q>good enough</q>, so what the heck.</p>
<p>Having installed Wine via the Synaptic Package Manager, I went looking to see if there was help for the Office install on the internet, and lo and behold, I found <a target="_blank" href="http://www.webupd8.org/2011/01/how-to-install-microsoft-office-2007-in.html">How to Install Microsoft Office 2007 in Ubuntu (Under Wine)</a>.</p>
<p>What can I say? As I said, I already had Wine installed, so it was mostly point at <tt>setup.exe</tt> and click. What do you know, it worked, right down to finding the <tt>riched20.dll</tt> library and correcting it so that PowerPoint would run.</p>
<p>Now this was a copy of Office 2007, so it's a little out of date. Fortunately, Microsoft is providing extended support until 2017, so it's still viable. There was a problem, though: Microsoft Update wants to work with Internet Explorer, and I don't have that installed under Wine — in fact, I don't know if I can install it properly, and I'm not inclined to try. But you can go fetch the update directly <a target="_blank" href="https://www.microsoft.com/en-us/download/details.aspx?id=27838">from Microsoft</a>. Just download, make it executable, and run it from a terminal, ignoring all of those evil looking error messages.</p>
<p>A couple of things: LMDE puts all of the Office Suite in the <q>Other</q> tab of the menu. You can edit the menu, make an M$Office tab to hold everything, and move it there. Second, dialog boxes often revert to Wine's font, which is horrible. But Office itself uses native Office fonts, which is what we really want.</p>
<p>Now I have no idea what happens if you try this with a newer version of Office. This works for Office 2007, which was written for Windows XP. If you get a newer version running, leave a comment.</p>
rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-28556721807041772072015-11-01T15:54:00.000-05:002015-11-01T15:54:27.745-05:00Disabling Printer Function for Canon MP470<p>
Many years ago, you may recall, <a target="_blank" href="http://hawknotes.blogspot.com/2008/10/installing-scanner.html">I bought a Canon MP470 Printer/Scanner for cheap.</a> After a year or so the paper feed mechanism stopped feeding paper properly, but I was always able to use it as a scanner.
</p>
<p>
Until a couple of weeks ago. Now, when I turn the thing on, the print heads move into place and the screen displays the code <q>U051</q>, which it explains as <q>Print head is not installed. Install the print head.</q>
</p>
<p>
If you look around the web, you'll find lots of pages that tell you <a target="_blank" href="http://www.ehow.com/how_8573333_troubleshoot-not-installed-canon-mp470.html">how to clean the print head/cartridges</a>, which claims to fix the problem. Of course, I don't care one wit about the printer. What I want to do is to skip the print head checking entirely, and go directly to the scanner.
</p>
<p>
I haven't found a clean way to do this, but I have found a workaround which allows you to <a target="_blank" href="http://www.fixyourownprinter.com/posts/74095">temporarily disable the print function.</a> It's written for an MP140, but works for the MP470, and I bet it works for most Canon printers. In case that page vanishes, here's what you do:
</p>
<ol>
<li>
Unplug the printer.
</li>
<li>
Hold down the On/Off Key and the Reset Key.
</li>
<li>
While holding the keys down, plug in the printer.
</li>
<li>
Still holding down the On/Off Key, release and press the reset key five (5) times.
</li>
</ol>
<p>
The printer will now go in to some endless self-check loop, you'll see a bubble running under the Canon logo on the display screen. But the scanner will now work. As before, I use <a target="_blank" href="http://www.xsane.org/">xsane</a>, which is a front-end to the programs provided the the <a target="_blank" href="http://www.sane-project.org/">SANE project.</a>
</p>
<p>
Now this isn't optimal, but I only use the scanner a couple of times a month, so it's acceptable. If you figure out how to permanently disable the printer on a Canon MP, leave a note below.
</p>
rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-32700773224875792482014-10-18T20:17:00.000-04:002014-10-18T20:17:40.097-04:00Taking POODLE to the Pound<p>You may have heard of <a target="_blank" href="http://bits.blogs.nytimes.com/2014/10/15/poodle-bug-marks-third-major-security-flaw-discovered-this-year/">POODLE (Padding Oracle On Downgraded Legacy Encryption)</a>, which exploits a bug in the ancient <a target="_blank" href="http://en.wikipedia.org/wiki/Transport_Layer_Security#SSL_1.0.2C_2.0_and_3.0">SSL 3.0 Encryption Protocol</a>. This has the capability of letting malicious sites take over your browser.</p>
<p>The fix is to turn off SSL 3.0, forcing your browser to use better encryption. This will break some sites, but that's their problem, not yours, and they are probably working on it right now.</p>
<p>For most browsers the fix is <a target="_blank" href="https://zmap.io/sslv3/browsers.html">not too difficult</a>. You change some configuration setting and you're done. There's even a <a target="_blank" href="https://addons.mozilla.org/en-US/firefox/addon/ssl-version-control/">Firefox Extension</a> to change the settings for you.</p>
<p>For <a target="_blank" href="https://www.google.com/chrome/">Google Chrome</a> and its open source brother <a target="_blank" href="http://www.chromium.org/Home">Chromium</a>, it's a little more difficult. You have to tell the browser to disable SSL 3.0 every time you launch it, <em>e.g.</em></p>
<p>$ chromium --ssl-version-min=tls1</p>
<p>the <q>--ssl-version-min=tls1</q> being the string that does the trick.</p>
<p>Let's see. I launch chromium at startup, from the Mint panel icon, and sometimes from the command line. That means three places I have to fix the call to chromium, and I have to do it for every user on the machine. There's got to be a better way.</p>
<p>And there is, at least when using chromium on <a target="_blank" href="http://www.linuxmint.com/download_lmde.php">LMDE</a>. There is a configuration file, <tt>/etc/chromium/default</tt>, which lets you set global options for the chromium browser. To apply the fix, run the command:</p>
<p>$ sudo vi /etc/chromium/default</p>
<p>and edit the CHROMIUM_FLAGS variable. This passes a set of commands to chromium every time anyone starts the browser: look at <tt>/usr/bin/chromium</tt> to see how it works. My current variable reads</p>
<p>CHROMIUM_FLAGS="--password-store=detect --ssl-version-min=tls1"</p>
<p>Now every time chromium is started on your machine, it applies the fix.</p>
<p>You can test your work at <a target="_blank" href="https://www.poodletest.com/">https://www.poodletest.com/</a>.</p>
<p>I don't know how many platforms can use this trick. On CentOS there is an analogous way to do it, but a different procedure. If you have a different way to disable SSL 3.0 for chrome/chromium on your Linux box, leave a comment below.</p>
rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-5352431569225714612014-03-31T21:10:00.000-04:002014-04-05T20:38:05.566-04:00Outmoded Technologies: The Operator<p>Some of my favorite songs make reference to technologies that we just don't use anymore. Case in point, your friendly neighborhood information operator:</p>
<ol>
<li>Chuck Berry: The Original <em>Memphis, Tennessee</em> (1959)
<br /><br />
<iframe width="420" height="315" src="//www.youtube.com/embed/w5ezeUM6c74" frameborder="0" allowfullscreen></iframe>
<br /><br />
</li>
<li>Jim Croce, <em>Operator</em> (1972)
<br /><br />
<iframe width="420" height="315" src="//www.youtube.com/embed/3RA4MykPm4s" frameborder="0" allowfullscreen></iframe>
<br /><br />
</li>
<li>Dr. Hook (and the Medicine Show), <em>Sylvia's Mother</em> (1972)
<br /><br />
<iframe width="420" height="315" src="//www.youtube.com/embed/z4asAOyglCc" frameborder="0" allowfullscreen></iframe>
<br /><br />
</li>
</ol>rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-60814058992719270622013-08-13T19:21:00.000-04:002013-08-13T19:23:04.805-04:00Updating Firefox and Thunderbird in LMDE<p>
A couple of weeks ago, <a target="_blank" href="http://hawknotes.blogspot.com/2013/07/lmde.html">as you may recall</a>, I switched from ever-changing Ubuntu to nearly frozen <a target="_blank" href="http://www.linuxmint.com/download_lmde.php">Linux Mint Debian Edition (LMDE)</a>. So how is it?
</p>
<p>
Nice. Not only does it have the Gnome 2-like MATE desktop, but because it is based on <a target="_blank" href="http://www.debian.org/releases/testing/">Debian Testing (currently known as <em>jessie</em>)</a>, LMDE is relatively slow to change.
</p>
<p>
What's irritating about LMDE is that, because it is based on Debian Testing, it is relatively slow to change.
</p>
<p>
This really isn't too much of a bother, except for <a target="_blank" href="http://www.mozilla.org/en-US/firefox/new/">Firefox</a> and <a target="_blank" href="http://www.mozilla.org/en-US/thunderbird/">Thunderbird</a>, which change versions at the drop of a hat, not that anyone wears a hat they can drop anymore. So, for example, as of this moment (it could change by tonight), Firefox is on version 23, and Thunderbird is on version 17.0.8. LMDE's versions, OTOH, are at 21 and 17(.0.0).
</p>
<p>
OK, this is not one of life's big tragedies. Most updates of Fox&Bird do not involve major changes. But I like to keep a little more current.
</p>
<p>
Fortunately, there is a relatively easy fix for this which won't do too much damage to your installation even if it completely craps out. The details are all <a target="_blank" href="http://forums.linuxmint.com/viewtopic.php?f=197&t=86176#p641270">in this LMDE forum post and the one above it</a>, but I've added a little twist of my own, based on a post even further up the topic than the ones I've already mentioned and linked to.
</p>
<p>
What makes this relatively easy is that LMDE stores Firefox & Thunderbird files in the <tt>/opt</tt> directory, since pure Debian doesn't support them under their default names because of trademark issues (see <a target="_blank" href="https://wiki.debian.org/Iceweasel"><tt>iceweasel</tt></a> and <a target="_blank" href="https://wiki.debian.org/Icedove"><tt>icedove</tt></a>). That means any mucking around you have to do is confined to <tt>/opt</tt>, rather than such touchy directories as <tt>/usr/lib</tt> and the like.
</p>
<p>
So what to do:
</p>
<ol>
<li>Install Fox&Bird, if you haven't already:
<br />
<code>
$ sudo apt-get install firefox thunderbird
</code>
(<em>N.B.</em> If you haven't already installed Firefox or Thunderbird, and don't miss them, you might ask yourself just what you are doing reading this post.)
<br /><br />
</li>
<li>
Become the superuser and go to the <tt>/opt</tt> directory.
<br />
<code>
sudo -i <br />
# cd /opt
</code>
<br />
</li>
<li>
Back up the <tt>firefox</tt> and <tt>thunderbird</tt> directories. This lets you get back to the original versions if you frak everything up. If you are particularly paranoid, back up your <tt>$HOME/.mozilla</tt> and <tt>$HOME/.thunderbird</tt> directories in the same way.
<br />
<code>
# cp -rp firefox firefox_21 <br />
# cp -rp thunderbird thunderbird_17.0
</code>
The <tt>-rp</tt> options recursively copy everything and preserve all permissions and time stamps.
<br /><br />
</li>
<li>
Optional step: Change the ownership of <tt>firefox</tt> and <tt>thunderbird</tt>. If you do this, then you will be able to update both programs without becoming superuser. Otherwise, you'll have to launch the apps using <tt>sudo</tt> to do the upgrades. Technically this a regression, as it allows someone to update a core component of the machine without root access, <em>i.e.</em>, it behaves like Windows XP. On a single user machine this is probably not a big problem.
<br /><br />
Assuming your username is, say, <tt>capaldi</tt>,
<br />
<code>
# chown -R capaldi:capaldi firefox thunderbird
</code>
If you do this step you can now get out of su mode:
<br />
<code>
# exit <br />
logout <br />
$
</code>
<br />
</li>
<li>
Now for the trick. You need to put Fox&Bird into the release channel: <br />
<code>
$ vi /opt/firefox/defaults/pref/channel-prefs.js
</code>
When you get here, look for a line that says
<br />
<code>
pref("app.update.channel", "default");
</code>
and change <tt>default</tt> to <tt>release</tt>.
<br /><br />
</li>
<li>
Do the same thing for <br />
<code>
$ vi /opt/thunderbird/defaults/pref/channel-prefs.js
</code>
In my copy, this was already set, which is why Thunderbird kept asking to update (and always failed, since it I wasn't root).
<br /><br />
</li>
<li>
Restart either app. In the <q>Help</q> menu click on <q>About Firefox/Thunderbird</q>. Updates should appear normally, though I had to go through the process a couple of times to get a successful update. In Thunderbird it took forever to do the update, but when I Xed out the update window and restarted Thunderbird it was properly updated. I'll let you know if this trend continues with the next update, which might occur as early as this week.
<br /><br />
</li>
<li>
Now if and when LMDE does push Fox&Bird updates, all of your lovely work will be overwritten. You can do that by locking the package. The easiest way to do this that I know is:<br /><br />
<ol style="list-style-type:lower-alpha">
<li>
Open synaptic. If you don't have it, <br />
<code>
$ sudo apt-get install synaptic
</code>
<br />
</li>
<li>
Search for firefox and click on it.
<br /><br />
</li>
<li>
In the synaptic menu bar, click <tt>Package</tt>.
<br /><br />
</li>
<li>
Click <tt>Lock Version</tt>.
<br /><br />
</li>
<li>
Search again for Firefox and make sure it is locked. The whole Firefox line should be red.
<br /><br />
</li>
<li>
Repeat for Thunderbird.
<br /><br />
</li>
</ol>
</li>
</ol>
<p>
And that should do it. Remember, if things get messed up, you can always use your backup directories to get back to the default distribution, or you can do complete remove/reinstall:
<br />
<code>
$ sudo apt-get purge firefox thunderbird <br />
$ sudo apt-get install firefox thunderbird
</code>
</p>
rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com1tag:blogger.com,1999:blog-6230347.post-69476970517718775462013-07-21T20:32:00.001-04:002013-07-26T11:47:55.101-04:00LMDE<p>
As long-threatened, I've finally <a target="_blank" href="http://penguinpetes.com/b2evo/index.php?title=linux_mint_14_nadia_gets_penguin_peted&more=1&c=1&tb=1&pb=1">followed the crowd</a> and move from Ubuntu to Linux Mint. The main attraction was Mint's use of the <a target="_blank" href="http://mate-desktop.org/">MATE desktop</a>, which is enough like Gnome 2 to keep me happy indefinitely, but I also liked the fact that the <a target="_blank" href="http://www.zdnet.com/a-look-at-linux-mint-debian-edition-lmde-201303-7000013027/">Debian edition</a>, hereafter LMDE, is a <q>rolling</q> release, meaning I'm not going to have to do a complete upgrade in 6 months. The price is that some software is going to be a little behind the times, but, hey, at work we use <a target="_blank" href="http://www.centos.org/">CentOS</a>. At least with LMDE it's unlikely that I <a target="_blank" href="http://dag.wieers.com/blog/chrome-no-longer-supporting-rhel6-and-centos-6-and-sl6">won't be able to run Google Chrome or Chromium</a>.
</p>
<p>
So a brief review:
</p>
<p>
Installation was simple enough. After several hours of backing up my /home partition (twice, to two separate USB disks), I downloaded the DVD and did the initial install. I left my <tt>/home</tt> and <tt>/usr/local</tt> directories, which were on separate partitions, intact, and let LMDE overwrite the root directory and install its version of Grub to run through the boot process. This took less than an hour, which was a pleasant surprise.
</p>
<p>
It then took me another couple of hours to pick out all the packages that weren't automatically installed, and get them up and running. Not too bad, really.
</p>
<p>
There were, of course, a few things that didn't quite work perfectly.
</p>
<ul>
<li>
My <a target="_blank" href="http://hawknotes.blogspot.com/2011/12/random-wallpaper-switcher-for-gnome-3.html">Gnome 3 Random Wallpaper Switcher</a> did not, of course, work for MATE. Fortunately, <a target="_blank" href="http://community.linuxmint.com/tutorial/view/997">the differences between gconftool and mateconftool are minor</a>, and so I was able to rewrite the script without too much trouble. <a target="_blank" href="http://rcjhawk.us/software/index.html#mateback">The revised program can be downloaded here.</a>
<br /><br />
</li>
<li>
CUPS gave me some problems at first. I eventually found a solution in the <a target="_blank" href="http://forums.linuxmint.com/viewtopic.php?f=157&t=121052">Linux Mint Forums</a>. Note that you have to do two things:
<ul>
<li>
Enable 32 bit applications to work on a 64 bit platform, using the command
<br />
sudo dpkg --add-architecture i386
<br />
(<a target="_blank" href="http://forums.linuxmint.com/viewtopic.php?f=157&t=121052#p744098">My own humble contribution.</a>)
</li>
<li>
Make sure libgs9 is properly installed:
<br />
sudo apt-get install --reinstall libgs9
</li>
</ul>
<br />
<a target="_blank" href="http://www.ps3mediaserver.org/forum/viewtopic.php?f=3&t=13046">More details about this are here.</a>
<br /><br />
</li>
<li>
Google Earth actually worked, unlike in 64 bit Ubuntu. Well, not quite. At first, when I typed in a request, I got an <em>invalid HTTP request</em> message. This turns out to be a well known problem, having to do with <a target="_blank" href="http://askubuntu.com/questions/314509/how-to-correct-google-earths-invalid-http-request-notice">Google's shipped version of <em>libcurl</em></a>. As noted there, the solution is to use your own version of libcurl by renaming Google's version to some nonsense name:
<br /><br />
$ sudo -i
<br />
$ cd /opt/google/earth/free
<br />
$ mv libcurl.so.4 libcurl_old.so.4
<br /><br />
Given the problems I had with trying to get Google-Earth running on Ubuntu, I suspect you'll need the i386 architecture available for this to work as well.
<br /><br />
</li>
<li>
EMACS, of all things, gave me the most problems. Whenever I'd try to start it up, I'd get the message:
<br /><br />
Font `Ubuntu Mono 13' is not defined
<br /><br />
Running emacs in a terminal window, <em>i.e.</em>
<br /><br />
emacs -nw
<br /><br />
worked fine. I Googled, Duck-Ducked, and even Binged for a solution, but found nothing.
<a target="_blank" href="http://forums.linuxmint.com/viewtopic.php?f=199&t=140336&p=746434#p746434">The only thing anyone can conclude is that something in one of my old Ubuntu configuration files was forcing Emacs to look for the Ubuntu Mono font.</a>
<br /><br />
Which, of course, was not defined. Oh, LMDE has a package with the Ubuntu Fonts in it, but <em>not</em> the Mono font. I found the full set of fonts at
<br /><br />
<a target="_blank" href="http://mirrors.us.kernel.org/ubuntu//pool/main/u/ubuntu-font-family-sources/ttf-ubuntu-font-family_0.80-0ubuntu1~medium_all.deb">http://mirrors.us.kernel.org/ubuntu//pool/main/u/ubuntu-font-family-sources/ttf-ubuntu-font-family_0.80-0ubuntu1~medium_all.deb</a>
<br /><br />
</li>
<li>
Finally, my favorite version of <a target="_blank" href="http://packages.ubuntu.com/lucid/games/spider">Spider Solitaire</a> is not included (even in Ubuntu, it was last seen in Lucid, 10.04). Fortunately, I have an old .deb file which I found somewhere and still installs without error. Crappy fonts, but it works. I once had the source code for this, I should really download it and install it for myself, since it seems no one is maintaining it.
</li>
</ul>
<p>
After a week, those are all the problems I've found. The system is stable, MATE is as good a Desktop as you're going to find these days, and I've had no difficulties in installing other software that I want.
</p>
<p>
This could be the beginning of a beautiful friendship.
</p>rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-27706175034424039062013-07-12T19:36:00.000-04:002013-07-12T19:36:49.906-04:00Stupid Math Tricks<p>I have a weird mind that occasionally obsesses with some probably trivial math problems. I thought I'd this obsession with the world at large, even if the world isn't ready for it. But this blog isn't really the place for it, so I'm starting a new one:
</p>
<p>
<a target="_blank" href="http://stupidmathtricks.blogspot.com/"><em>Stupid Math Tricks</em></a>, available at a browser near you, or from the sidebar on the right.
</p>
<p>
Don't worry, when I upgrade Hal to LMDE I'll post all about it right here.
</p>
rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-10831387254845856692013-07-04T14:32:00.000-04:002013-07-04T14:32:23.464-04:00Galactus Rules<p>
Now it can be told: I've been remiss in posting to this blog because I've fallen in love with my smartphone.
</p>
<p>
Well, maybe not <em>love</em> — more like extreme like — but the fact is, we've been spending a lot of time together. More time than is good, and time I'd ordinarily have for posting to this blog.
</p>
<p>
It's a <a target="_blank" href="http://www.samsung.com/global/galaxys3/">Samsung Galaxy S3</a>, currently running Android 4.1.2 on the Verizon Network. OK, it's not the latest and greatest (it was when I bought it in November), but it's still pretty damn good.
</p>
<p>
As a phone, it's a phone. As a Music Player — well, it does that, though I still use an old iPod at the gym because when I exercise there tends to be excess moisture.
</p>
<p>
So mainly I like it for the apps. Yes, most (all?) of the things I can do with apps are available for Hal, here, but Hal's downstairs, and my big TV is upstairs. So if I'm just doing casual idiot-box related browsing, or I'm on the road, the phone's the way to go.
</p>
<p>
What I thought I'd do today is to list some of my favorite Android Apps, why I like them, how the could be improved, and few suggestions for new/better apps. These aren't really in any particular order.
</p>
<ul>
<li>
<strong><a target="_blank" href="https://play.google.com/store/apps/details?id=com.google.android.apps.maps">Google Maps</a>:</strong> not to mention Navigator and Earth. I use Maps every day to check the traffic patterns on the way to work so that I know if I should avoid the 11th Street Bridge or not. (No one has ever sung <q>Slow Down, You Move to Fast</q> about the 11th Street Bridge.)
</li>
<li>
<strong><a target="_blank" href="https://play.google.com/store/apps/details?id=com.espn.score_center">ESPN Score Center</a>:</strong> This lets me keep up to date on the games I want to know about: mainly the Jayhawks, Nationals, and Royals (I go way back with the Royals, OK?). And it connects to ESPN's Game Center, so I can follow the action pitch-by-pitch. If you wanted to, you could use it to re-create games, as was once done by <a target="_blank" href="http://www.desmoinesbroadcasting.com/who/reagan/reagan-georgedavison-special.html">a former President</a>.
</li>
<li>
<strong><a target="_blank" href="https://play.google.com/store/apps/details?id=com.imdb.mobile">IMDb</a>:</strong> I'm always checking this while we're watching TV, movies, whatever. The ultimate <q>Who was that?</q> App.
</li>
<li>
<strong><a target="_blank" href="https://play.google.com/store/apps/details?id=jp.sblo.pandora.jota">Jota Text Editor</a>:</strong> the Galaxy doesn't come with a decent notepad, as far as I can tell. This one is perfect. Almost EMACS-like.
</li>
<li>
<strong><a target="_blank" href="https://play.google.com/store/apps/details?id=com.scannerradio">Scanner Radio</a>:</strong> When they were hunting the Boston Bomber, we had CNN on the screen, but we got most of our news from this.
</li>
<li>
<strong><a target="_blank" href="https://play.google.com/store/apps/details?id=info.staticfree.android.units">Units</a>:</strong> the smartphone version of the Unix program <a target="_blank" href="http://hawknotes.blogspot.com/2007/12/other-day-i-had-to-convert-quantity-150.html">I've written about before</a>.
</li>
<li>
<strong><a target="_blank" href="https://play.google.com/store/apps/details?id=net.bible.android.activity">And Bible</a>:</strong> Lots of translations. I particularly like <a target="_blank" href="https://net.bible.org/#!bible/Genesis+1:1">The NET Bible</a>, but you have to pay to get the translators' notes. Particularly useful at church, you can be pretending to follow the text of the sermon while surfing. [I jest. Mostly.]
</li>
<li>
<strong><a target="_blank" href="https://play.google.com/store/apps/details?id=flipboard.app">Flipboard</a>:</strong> I probably use this more than any other App, except for Gmail/Email. Flipboard is essentially a graphical version of Google Reader: You sign up for a site's feed (some sites and users set up their own Flipboard <q>magazines</q>), and you drag the screen to flip from one site to the other, and within a site. The nice thing is that <q>Top</q> posts from your list are put right at the top of the App, if you're in a hurry and just want to see what's going on in the world. I also use it to scan Twitter, Google Plus, various news sites, and a handful of blogs. The Twitter reader automagically replaces long links by bit.ly URLs. If your Reader accessed 100+ sites, this isn't the App for you, but if you only follow a few it's perfect.
</li>
<li>
<strong><a target="_blank" href="https://play.google.com/store/apps/details?id=com.crowdcompass.apsmarch2013">The March Meeting App</a>:</strong> That's the <a target="_blank" href="http://www.aps.org/meetings/march/index.cfm">American Physical Society March Meeting</a>. They managed to cram the entire set of Abstracts for 8000+ talks onto the phone (they stopped printing the full abstract book some years ago — something about deforestation). Tracks times/locations of talks. Would be better if it allowed off-app note taking, but even then it was extremely useful.
</li>
<li>
<strong><a target="_blank" href="https://play.google.com/store/apps/details?id=tunein.player">TuneIn Radio</a>:</strong> accesses the web streams of thousands of radio stations. I particularly like it in the fall, when I can listen to NFL football games while working outside. Not as useful in the spring/summer, as baseball games are hidden behind MLB's pay wall.
</li>
<li>
<strong><a target="_blank" href="https://play.google.com/store/apps/details?id=krant.newspapersUSA">Newspapers USA</a>:</strong> This is essentially a list of bookmarks for every paper in the US. If you want a specific paper, such as the Washington Post or NY Times, use that paper's App. But if you find yourself wanting to look at the Deseret News for a story, this is the place to find it.
</li>
</ul>
<p>
OK, that's the good stuff. What would I change?
</p>
<ul>
<li>
There are two email clients: One for Gmail, one for Everything Else. The EE one will read your Gmail, but you have to sign up on the Gmail App.
</li>
<li>
On the iPod I use the iTunes store to manage my podcast feeds. It's easy to find everything, though painfully slow, but I don't have to search for a tiny little button to download, say, this week's episode of Car Talk. There may be Android Apps which do this kind of thing, but the one's I've looked at seem to mostly stream podcasts (unacceptable, as my gym doesn't have WiFi), or cost money. iTunes also does a better job of letting you organize Podcast playlists than either of the two music players that come with the Galaxy.
</li>
</ul>
<p>
It looks like I'm going to have more time on my hands for the next few months, so I'll be posting here more. In particular, the time has come to move Hal off Ubuntu to a distribution that's not trying to force me off of my preferred Gnome 2-like interface. I'm probably going to <a target="_blank" href="http://penguinpetes.com/b2evo/index.php?title=linux_mint_14_nadia_gets_penguin_peted&more=1&c=1&tb=1&pb=1">follow Penguin Pete and move to Linux Mint</a>, but I'll probably go to <a target="_blank" href="http://www.linuxmint.com/download_lmde.php">Debian Edition</a>, as I like the idea of a rolling distribution that doesn't require me to update everything every six months. For now, spouse's computer, Harlie, will stay on Ubuntu 12.04 LTE, which shouldn't need updating until we trash it in a year or so. (Harlie started out life as a <a target="_blank" href="http://hawknotes.blogspot.com/2008/07/heresy.html">Vista box</a>.)
</p>
rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-54736487751283521122013-05-20T19:43:00.001-04:002013-05-20T19:43:20.696-04:00Audrey and Tom<p>Yes, it has been a long time since the last post, and you probably won't get much out of me until summer, unless I decide to jump to Linux Mint before that.</p>
<p>But in the meantime, I'll give you this to watch: Audrey and Tom, a pair of osprey who live on the Chesapeake Bay not far from East Bowie:</p>
<p><a href="http://chesapeakeconservancy.org/osprey.html">Chesapeake Conservancy Osprey Cam</a></p>
rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com1tag:blogger.com,1999:blog-6230347.post-14771347051328955612013-01-01T16:08:00.000-05:002013-01-01T16:08:01.159-05:00Sorting From Back to Front<p>
The other day I was presented with a list of names and email addresses, something like this one:
</p>
<code>
<pre>
Fred Flinstone <flintstone@bedrock.sag>
Barney & Wilma Rubble <bambamsfolks@bedrock.sag>
Steadholder Honor Harrington <dutchess@harrington.mdc>
Count Miles Vorkosigan <auditor@vorkosigan.byr>
Dennis & Margaret Mitchell <stilltrouble@funnies.comics.net>
Homer Simpson <donuts@springfield.st.us>
Rudolph <rednose@reindeer.np>
Kimball Kinnison <kinnison@graylens.gp>
Wile E. Coyote <genius@acme.net>
Tiberius Claudius Drusus Nero Germanicus Julius Caesar <imperator@spqr.rm>
Gen. Jack O'Neill <jack.oneill@stargate.oml>
</pre>
</code>
<p>
Except that it had around 100 names. What I wanted to do was to alphabetize this by last name, to make it easier to figure out who was missing from the list, but keep the final result as
<br />
FirstName MiddleName(s) LastName <email>
<br />
since this was input to an email list in that format.
</p>
<p>
This would not difficult if each person had exactly two names, say
<br />
FirstName LastName <email>
<br />
in which case we'd just run the command
<br />
sort -k 2 < elist
<br />
and we'd be done.
</p>
<p>
Unfortunately each line contains between two and eight fields, counting the email address, and we want to sort on the next to last one. As far as I can tell, <a target="_blank" href="http://unixhelp.ed.ac.uk/CGI/man-cgi?sort">sort</a> doesn't support searches from the end of the line in.
</p>
<p>
However, the <a target="_blank" href="http://unixhelp.ed.ac.uk/CGI/man-cgi?awk">awk (or gawk)</a> command does. For example, the command
<br />
awk '{print $NF}' < elist
<br />
would list just the email addresses from the above file, and
<br />
awk '{print $(NF-1)}' < elist
<br />
would list the last names — no, I don't know why you use parenthesis, but you do.
</p>
<p>
So what we need is a way to have <q>awk</q> pull out the last name from the file, sort those, then put everything back together. It turns out we can do that with a one-liner. I found it on the web yesterday, but I've lost the link, so I can't give proper credit. I did save the command, or my modification of it, at least:
</p>
<code>
<pre>
awk '{print $(NF-1), $0}' < elist | sort | cut -f2- -d' '
</pre>
</code>
<p>
Let's look at that in detail:
</p>
<ul>
<li>
awk '{print $(NF-1), $0}' < elist
<br />
prints out the next to last column of each line, followed by the entire line ($0).
</li>
<li>
sort
<br />
then sorts everything on the first column, <em>e.g.</em> the last name. Unfortunately, that leaves you with entries like this:
<br />
Simpson Homer Simpson <donuts@springfield.st.us>
<br />
To get rid of these, we need
</li>
<li>
<a target="_blank" href="http://unixhelp.ed.ac.uk/CGI/man-cgi?cut">cut</a> -f2- -d' '
<br />
which separates fields by whitespace (the -d' ') and prints everything out starting from the second column (-f2- . If we wanted just the second and third column it would be -f2-3).
</li>
</ul>
<p>
And the correctly sorted output is:
</p>
<code>
<pre>
Tiberius Claudius Drusus Nero Germanicus Julius Caesar <imperator@spqr.rm>
Wile E. Coyote <genius@acme.net>
Fred Flinstone <flintstone@bedrock.sag>
Steadholder Honor Harrington <dutchess@harrington.mdc>
Kimball Kinnison <kinnison@graylens.gp>
Dennis & Margaret Mitchell <stilltrouble@funnies.comics.net>
Gen. Jack O'Neill <jack.oneill@stargate.oml>
Barney & Wilma Rubble <bambamsfolks@bedrock.sag>
Rudolph <rednose@reindeer.np>
Homer Simpson <donuts@springfield.st.us>
Count Miles Vorkosigan <auditor@vorkosigan.byr>
</pre>
</code>
<p>
Fairly simple, huh? I generalized it a bit, so that we can sort on an arbitrary column from the end:
</p>
<pre>
#! /bin/bash
# Usage
# lastsort N filename
# Sorts the file filename of the field N columns from the end
# N=0 is last column of the file
awk '{print $(NF-'$1'), $0}' $2 | sort | cut -f2- -d' '
</pre>
<p>
Note the single quotes around the $1 in the awk command, which passes the first argument of the calling command to awk. Without the quotes you get an error.
</p>
<p>
OK, this could have a few bells and whistles, but I'm not going to bother with that now.
</p>
rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-77380781417618973522012-11-22T18:07:00.000-05:002012-11-22T18:07:21.979-05:00DIY xkcd Password Generator<p>
One of the things I'm thankful for today is <a target="_blank" href="http://xkcd.com/">xkcd</a>. Specifically, I want to talk about the world-famous <a target="_blank" href="http://xkcd.com/936/">password strip</a>, which points out that using a few selections from a big list of things (a dictionary) is more random, and yet easier to remember, than a lot of selections from a limited list of things (the keys on your keyboard).
</p>
<p>
There are even <a target="_blank" href="http://passphra.se/">sites which generate xkcd-style passwords for you</a>. <a target="_blank" href="https://www.google.com/search?q=xkcd+password+generator">Many sites, in fact.</a>
</p>
<p>
The other day I was using one of these generators to make a password for work. The only problem was that the system that I was logging on to required my password to be between 8 and 16 letters, which is difficult to do when you're dealing with a list of random dictionary words. It also checks to see if you had a string of four or more letters that matched a dictionary word.
</p>
<p>
To fix this, I needed to have a list of, say, three letter words. Where to find them? Sergey and Larry's search engine helped. For example, here's a list of <a target="_blank" href="http://www.yak.net/kablooey/scrabble/3letterwords.html">allegedly legal Scrabble words</a>. Given that, all we need is a script to generate a list of words.
</p>
<p>
That script is below. What I didn't do was include the words. For one thing I'm not sure about the copyright status of that list. For another, you might want to use your own list. For a third, it would make this post really, really long. So add your own list of words, one per line, between the two EOF lines in the script.
</p>
<p>
While I was at it, I decided to add a few <q>improvements</q>, towit:
</p>
<ul>
<li>
You can specify the number of words. If you call the script <q>xkcdpass</q>, then <br />
<pre>
xkcdpass 5
</pre>
will generate a password using five words from the list. The default is 4, which you can easily change.
</li>
<li>
Given the number of words in the list, call it N, and the number of words in the password, call it M, you can generate N<sup>M</sup> unique passwords (since strings like thethethethe are perfectly valid). That's a measure of password security, so the script tells you that.
</li>
<li>
You have three choices of randomness. In order of security, they are: The bash variable $RANDOM, which can be seeded to the current time, and the linux scripts /dev/urandom and /dev/random. Uncomment the one you like, depending on your level of paranoia.
</li>
<li>
It should work on any system that runs bash, including Macs.
</li>
<li>
And, of course, I tried to document where I got everything.
</li>
</ul>
<p>
So here's the script. Add a comment if you see a problem, or if you just like (or hate) it.
</p>
<code>
<pre>
#! /bin/bash
# Generates an xkcd-like password from a list of three-letter words
# Usage
# xkcdpass n
# where n>0 is the number of words in the string. The default value of
# n is 4.
# Set the default if needed
if (( $# < 1 ))
then
nwords=4
else
nwords=$1
fi
# Set up an array and populate it.
declare -a array
let index=0
# There is a list of acceptable three-letter Scrabble words at
# http://www.yak.net/kablooey/scrabble/3letterwords.html
# Add additional words, if you like, or use a different list.
while read line
do
array[$index]=$line
let index=$index+1
# Insert your words between the two EOFs, one per line
# There is a list of acceptable three-letter Scrabble words at
# http://www.yak.net/kablooey/scrabble/3letterwords.html
# Add additional words, if you like, or use a different list.
done <<EOF
EOF
# So how secure is this string (bigger numbers are better):
echo -n $index "words in file, giving "
unique=`echo "$index^$nwords" | bc`
echo $unique unique passwords
# Uncomment this if you use $RANDOM and want a
# unique seed. See http://linuxgazette.net/issue55/tag/4.html
# The date +%s command gives the time from the epoch
RANDOM=$$$(date +%s)
# Select $nwords at random. Note that you can select the
# same word more than once.
for (( i=0 ; i<$nwords ; i++ ))
do
# Uncomment the random technique you want to use:
# Probably not all that random, but you can use the seed above
# to make it better.
let number=$RANDOM
# More random, but slower (the sed gets rid of some annoying spaces)
# -N3 prints out 3 bytes of data. That's probably enough. Note that
# if you have 2^N words, for any integer N, it won't matter how
# many bytes you use if the number of bytes is bigger than N
# let number=`od -An -N3 -i /dev/urandom | sed "s/ *//"`
# For the difference between random and urandom, see
# http://stupefydeveloper.blogspot.com/2007/12/random-vs-urandom.html
# Really random, though visibly slow
# let number=`od -An -N3 -i /dev/random | sed "s/ *//"`
# Do modulo arithmetic to get the number between 0 and $index-1
let "number %= $index"
echo -n ${array[$number]}
done
# Print a newline character
echo
</pre>
</code>
rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com2tag:blogger.com,1999:blog-6230347.post-76843105747913724852012-11-11T19:27:00.000-05:002012-11-11T19:27:47.513-05:00Ubuntu Grows Up<p>Meaning, if you do an update, you get an update, not a complete change of your desktop or default programs. I just upgraded to <a target="_blank" href="http://releases.ubuntu.com/quantal/">Ubuntu 12.10 (Quantal Quetzal)</a>. In the fifteen minutes since the reboot, I haven't notice any difference in the machine. The Gnome desktop survived intact, even the tweaks I did to make it look like Gnome 2. Thunderbird and Firefox are at the current version. So is Flash. The Intel Fortran compiler even works.</p>
<p>Boring. And that's a good thing.</p>
<p>My Linux blog posts are usually about problems, and we just haven't had that many lately. I'll have some spare time over Christmas, maybe (don't count on it), we'll get to the statistics and baseball stuff I owe you. Maybe.</p>
rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-26389902272327585202012-10-20T16:10:00.000-04:002012-10-20T16:11:14.708-04:00Revised GNOME3 Wallpaper Switcher<p>Almost a year ago, I wrote a <a target="_blank" href="http://hawknotes.blogspot.com/2011/12/random-wallpaper-switcher-for-gnome-3.html">Random Wallpaper Switcher for Gnome3</a>. Given a directory filled with pictures, every once in a while it randomly chooses a new picture from the target directory and puts it up as Gnome3 desktop wallpaper. You can specify that "once in a while" means every XX seconds, or some random time between XX and YY seconds. And it cleans up after itself when you log off, meaning that the next time you log in you won't have multiple switchers running.</p>
<p>It works pretty well, IMHO, but it does have one small aesthetic flaw: If the picture doesn't fill the desktop, and most of mine don't, the color of the underlying background might be far off from the color of the picture, possibly creating a color clash. Annoying.</p>
<p>Then along came <a target="_blank" href="http://penguinpetes.com/b2evo/index.php?title=script_of_the_day_random_wallpaper_sette&more=1&c=1&tb=1&pb=1">Penguin Pete</a>, who showed me how to use <a target="_blank" href="http://www.imagemagick.org/script/index.php">ImageMagick</a> to find the <q>average</q> color of a picture as part of his script for a wallpaper randomizer for Fluxbox. Pete then went on to merge his background with the picture, but in Gnome3 you don't have to do that, as you can set the primary background color directly. A look at <em>man gsettings</em> shows that you can change the background color to, say, solid purple, with the command</p>
<code>
<pre>
$ gsettings set org.gnome.desktop.background primary-color "#FF00FF"
</pre>
</code>
<p>
And the rest is easy.
</p>
<p>The script is really too long to print here, so, as before, the entire script is available on <a target="_blank" href="http://rcjhawk.us/software/index.html#gnome3back">my homegrown software page</a>. If you don't like the background changing part, I've indicated the lines that need to be eliminated to make the code work without changing the background.</p>
rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-88085040121063486772012-09-03T15:19:00.000-04:002012-09-03T15:19:10.711-04:00Health Care Cost Comparison<script src="https://sites.google.com/site/rcjhawk/sorttable.js" type="text/javascript"></script>
<style type="text/css">
table {
margin-left: auto;
margin-right: auto;
text-align: center;
}
th {
text-align: center;
}
td {
text-align: right;
}
td.left {
text-align: left;
}
a.info{
position:relative; /*this is the key*/
/* z-index:24; */
}
a.info:hover{
text-decoration:none;
z-index:25;
/* background-color:white */
}
a.info span{
display: none
}
a.info:hover span{ /*the span will display just on :hover state*/
display:block;
color:black;
text-decoration:none;
display:block;
position:absolute;
padding: 2em;
/* top:-8em; left:1em; width:30em; */
top:0em; left:-10em; width:20em;
border:1px solid #0cf;
background-color:#eeeeee; color:black;
text-align: left;
}
</style>
<p>
Since health care is going to be a big topic in the 2012 U.S. Presidential election, and since I've had several discussions about health care with friends over the years, it's probably a good idea to round up some data.
</p>
<p>
Fortunately, we have the <a target="_blank" href="https://www.cia.gov/library/publications/the-world-factbook/"><em>CIA World Factbook</em></a>, which lists all sorts of demographic information, including health care cost as a percentage of GDP, life expectancy, infant mortality rates, <em>etc.</em>, for every country in the world.
</p>
<p>
On this page I've listed relevant data from every country that has a GDP of $1 trillion ($ 10<sup>12</sup>) or more. I've even made it sortable: click on a column, and you can arrange it in ascending or descending order. The highlighted column headers give popup notes on what's in each column.
</p>
<p>
So, for example, if you click on <q>Annual Health Care Cost per Person</q> until the up arrow shows, you'll find that the United States leads the pack with a whopping $7,938/person in health care costs per year.
</p>
<p>
If, on the other hand, you click on <q>Life Expectancy</q>, you'll see that this lands us in ninth place, over five years behind Japan.
</p>
<p>
I'll let you draw your own conclusions, but it seems to me that our health care is horribly overpriced.
</p>
<p>
And I'm not going to hype any particular solution. Maybe a form of Romney's Massachusetts health plan, or Obama's modification of it on the national scale, will work. Maybe privatization of the whole system, including Medicare and Medicaid, will work.
</p>
<p>
I'll just point out that in the U.S. we have a life expectancy of 78.5 years, at a cost of $7,938/year. In the United Kingdom, life expectancy is 80.1 years, and they pay $3,404/year, according to the CIA. And we all know about the setup of the <a target="_blank" href="https://en.wikipedia.org/wiki/National_Health_Service">British Health Service</a>.
</p>
<br />
<h1 align="center">World Healthcare Costs</h1>
<h2 align="center">Click on a column to sort</h2>
<p>
For data on nearly every nation in the world, see <a target="_blank" href="http://www.rcjhawk.us/healthcare/">www.rcjhawk.us/healthcare</a>.
</p>
<br />
<!-- The sortable class makes this all work -->
<table class="sortable" align="center" border="3" summary="Health Care Cost and Results by Country">
<tr>
<th>Country</th>
<th>Population</th>
<th>Life<br />Expectancy</th>
<th>Infant Mortality<br />per 1,000<br />live births</th>
<th>
<a class="info" href="#">GDP/Capita <span style="font-size:smaller;text-align:left">
This is what the CIA defines as <q>purchasing power parity</q> GDP, <em>i.e.</em>, actual purchasing power in dollars, not the legal exchange rate.
</span>
</a>
</th>
<th>
<a class="info" href="#">GDP (M$) <span style="font-size:smaller;text-align:left">
This is just population times GDP <em>per capita</em>. Since that's the <q>purchasing power parity</q> GDP, this won't be exactly equal to published results, set, <em>e.g.</em> China.
</span>
</a>
</th>
<th>Health Care<br />Fraction<br />of GDP</th>
<th>
<a class="info" href="#">Annual<br />Health Care
<span style="font-size:smaller;text-align:left">
This is just GDP <em>per capita</em> times the Fraction of the GDP consumed by health care. Approximate, to be sure, but probably within 10-20% of actual cost.
</span>
</a>
<br />per Person
</th>
</tr>
<tr>
<td class="left">Brazil</td>
<td>199,321,413</td>
<td>72.79</td>
<td>20.50</td>
<td>$11,900</td>
<td>$2,371,925</td>
<td>9.00%</td>
<td>$1,071</td>
</tr>
<tr>
<td class="left">Canada</td>
<td>34,300,083</td>
<td>81.48</td>
<td>4.85</td>
<td>$41,100</td>
<td>$1,409,733</td>
<td>10.90%</td>
<td>$4,480</td>
</tr>
<tr>
<td class="left">China</td>
<td>1,343,239,923</td>
<td>74.84</td>
<td>15.62</td>
<td>$8,500</td>
<td>$11,417,539</td>
<td>4.60%</td>
<td>$391</td>
</tr>
<tr>
<td class="left">France</td>
<td>65,630,692</td>
<td>81.46</td>
<td>3.37</td>
<td>$35,600</td>
<td>$2,336,453</td>
<td>3.50%</td>
<td>$1,246</td>
</tr>
<tr>
<td class="left">Germany</td>
<td>81,305,856</td>
<td>80.19</td>
<td>3.51</td>
<td>$38,400</td>
<td>$3,122,145</td>
<td>8.10%</td>
<td>$3,110</td>
</tr>
<tr>
<td class="left">India</td>
<td>1,205,073,612</td>
<td>67.14</td>
<td>46.07</td>
<td>$3,700</td>
<td>$4,458,772</td>
<td>2.40%</td>
<td>$89</td>
</tr>
<tr>
<td class="left">Indonesia</td>
<td>248,645,008</td>
<td>71.62</td>
<td>26.99</td>
<td>$4,700</td>
<td>$1,168,632</td>
<td>5.50%</td>
<td>$258</td>
</tr>
<tr>
<td class="left">Iran</td>
<td>78,868,711</td>
<td>70.35</td>
<td>41.11</td>
<td>$13,200</td>
<td>$1,041,067</td>
<td>3.90%</td>
<td>$515</td>
</tr>
<tr>
<td class="left">Italy</td>
<td>61,261,254</td>
<td>81.86</td>
<td>3.36</td>
<td>$30,900</td>
<td>$1,892,973</td>
<td>5.10%</td>
<td>$1,576</td>
</tr>
<tr>
<td class="left">Japan</td>
<td>127,368,088</td>
<td>83.91</td>
<td>2.21</td>
<td>$35,200</td>
<td>$4,483,357</td>
<td>9.30%</td>
<td>$3,274</td>
</tr>
<tr>
<td class="left">Korea, South</td>
<td>48,860,500</td>
<td>79.30</td>
<td>4.08</td>
<td>$32,100</td>
<td>$1,568,422</td>
<td>6.50%</td>
<td>$2,086</td>
</tr>
<tr>
<td class="left">Mexico</td>
<td>114,975,406</td>
<td>76.66</td>
<td>16.77</td>
<td>$14,800</td>
<td>$1,701,636</td>
<td>13.80%</td>
<td>$2,042</td>
</tr>
<tr>
<td class="left">Russia</td>
<td>142,517,670</td>
<td>66.46</td>
<td>9.88</td>
<td>$17,000</td>
<td>$2,422,800</td>
<td>5.40%</td>
<td>$918</td>
</tr>
<tr>
<td class="left">Spain</td>
<td>47,042,984</td>
<td>81.27</td>
<td>3.37</td>
<td>$31,000</td>
<td>$1,458,333</td>
<td>9.70%</td>
<td>$3,007</td>
</tr>
<tr>
<td class="left">Turkey</td>
<td>79,749,461</td>
<td>72.77</td>
<td>23.07</td>
<td>$14,700</td>
<td>$1,172,317</td>
<td>6.70%</td>
<td>$985</td>
</tr>
<tr>
<td class="left">United Kingdom</td>
<td>63,047,162</td>
<td>80.17</td>
<td>4.56</td>
<td>$36,600</td>
<td>$2,307,526</td>
<td>9.30%</td>
<td>$3,404</td>
</tr>
<tr>
<td class="left">United States</td>
<td>313,847,465</td>
<td>78.49</td>
<td>5.98</td>
<td>$49,000</td>
<td>$15,378,526</td>
<td>16.20%</td>
<td>$7,938</td>
</tr>
</table>
<p>This really being a notebook on how to do things with computers, here are the tricks I used:</p>
<ul>
<li>
All data is from the <a target="_blank" href="https://www.cia.gov/library/publications/the-world-factbook/"><em>CIA World Factbook</em></a>.
</li>
<li>
How to make sortable tables using Javascript taken from <a target="_blank" href="http://www.kryogenix.org/code/browser/sorttable/"><em>sorttable: Make all your tables sortable</em></a>, as outlined in <a target="_blank" href="http://freepages.genealogy.rootsweb.ancestry.com/~gearyfamily/expression-web/sort-table.html">Expression Web</a>.
</li>
<li>
Actual Javascript located at <a target="_blank" href="http://www.kryogenix.org/code/browser/sorttable/sorttable.js">sortable.js</a>.
</li>
<li>
The trick to finding a convenient place to store the javascript is from <a target="_blank" href="http://soswitcher.blogspot.com/2009/05/blogger-host-javascript-file-for-free.html">Host Javascript File for Free</a>.
</li>
</ul>rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-54307640924860860932012-08-03T12:05:00.001-04:002012-08-03T12:05:43.851-04:00Yet Another New AccountTaking a day off, and I find that Microsoft is dumping Hotmail for <a href="http://outlook.com/" target="_blank">outlook.com</a> . Of course I must protect the <i>rcjhawk</i> brand, having already lost it on Twitter to an early adapter and on Yahoo because I dropped the email account it was linked to (so I'm rcjhawkku and rcjhawk1973, respectively, if anyone cares).<br />
<br />
So I signed up for another email account, heaven help me.<br />
<br />
Apparently IMAP isn't available, at least not yet, so don't expect me to check those emails very often.<br />
<br />
It looks a lot like gmail. Of course, how many ways can you set up a webmail page?<br />
<br />rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-874695779090100082012-07-21T17:42:00.000-04:002012-07-21T18:19:59.343-04:00Updating to Precise Pangolin<p>I finally got around to updating Hal to <a target="_blank" href="http://www.ubuntu.com/">Ubuntu 12.04</a>, <q>Precise <a target="_blank" href="http://www.awf.org/content/wildlife/detail/pangolin">Pangolin</a></q>. (No, I never heard of it before, either.) You could have <a target="_blank" href="http://twitter.com/rcjhawkku">followed the whole thing on Twitter</a>.</p>
<p>Good news: the only thing that broke was the color scheme on my panel bars, which changed to black text on black background. I fixed that right away, and I'm still running a pseudo-Gnome2 desktop.</p>
<p>So, I'm happy with it. Besides, this is an LTS release, so if I don't want to bother updating I can keep it for a couple of years.</p>
<p><em>Just a bit later:</em> OK, one bug. For some reason the permissions on the directory</p>
<pre>$HOME/.config/nautilus-actions</pre>
<p>had been reset to 555, meaning I could read or execute files in the directory, but not write to it. This meant that <a target="_blank" href="http://backintime.le-web.org/">backintime</a> wouldn't back up my disk. Fortunately, backintime has an excellent error log, available from inside the program, that told me what was going on. (Unlike Google-Earth, which is still failing to launch in 64-bit mode after all these years.) I just ran the command:</p>
<pre>chmod 755 $HOME.config/nautilus-actions</pre>
<p>and all was well.</p>rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0tag:blogger.com,1999:blog-6230347.post-58722490903543924642012-07-12T22:44:00.001-04:002012-07-12T22:44:56.551-04:00Happy Birthday, Dear Woody<p>
As <a target="_blank" href="http://thebookofcletis.blogspot.com/2011/10/music-saturday-12-woodie-guthrie.html">old friend Cletis</a> pointed out some months ago, the younger generation doesn't know much about <a target="_blank" href="https://en.wikipedia.org/wiki/Woody_Guthrie">Woody Guthrie</a>.</p>
<p>Here's something you should know: Woody would have turned 100 this coming Saturday. In celebration, NPR has posted <a target="_blank" href="http://www.npr.org/2012/07/03/156205832/the-mix-the-woody-guthrie-centennial">a play list of many of Guthrie's songs</a>, sung by Pete Seeger, Bob Dylan, Country Joe (<em>sans</em> the Fish), Old Crow Medicine Show, and may others, including Woody Guthrie.</p>
<p>Give it a listen.</p>
<iframe width="420" height="315" src="http://www.youtube.com/embed/XaI5IRuS2aE" frameborder="0" allowfullscreen></iframe>rcjhawkhttp://www.blogger.com/profile/05775355479914145966noreply@blogger.com0