Title photo
frugal technology, simple living and guerrilla large-appliance repair

Regular blog here, 'microblog' there

Many of my traditional blog post live on this site, but a great majority of my social-style posts can be found on my much-busier microbloging site at updates.passthejoe.net. It's busier because my BlogPoster "microblogging" script generates short, Twitter-style posts from the Linux or Windows (or anywhere you can run Ruby with too many Gems) command line, uploads them to the web server and send them out on my Twitter and Mastodon feeds.

I used to post to this blog via scripts and Unix/Linux utilities (curl and Unison) that helped me mirror the files locally and on the server. Since this site recently moved hosts, none of that is set up. I'm just using SFTP and SSH to write posts and manage the site.

Disqus comments are not live just yet because I'm not sure about what I'm going to do for the domain on this site. I'll probably restore the old domain at first just to have some continuity, but for now I like using the "free" domain from this site's new host, NearlyFreeSpeech.net.

Tue, 30 May 2017

To run Node in Debian and Ubuntu, install nodejs and nodejs-legacy

Installing node.js in Fedora is no problem. You just run sudo dnf install node, and you're off to the JavaScript-in-the-console races. But it's slightly more complicated in Debian and Ubuntu.

Since there's an old amateur radio package called node for communicating on packet radio nodes, Debian and Ubuntu use the package name (and shell command) nodejs. So you would run nodejs when you would normally run node.

But you don't have to do this. And you don't have to resort to any Linux/Unix tomfoolery either.

Both Debian and Ubuntu have a package called nodejs-legacy that makes the symlink for you. Then you can run node by typing node in the console.

Since it looks like there is no node for amateur radio in Debian Sid or Experimental, I'm thinking that the node-vs-node.js problem will go away at some point in the near future -- when Debian declares its next release stable, and in turn when Ubuntu bases its future releases on versions of Debian that have "re-resolved" the issue. (Since I'm running Ubuntu 16.04 in the Windows Subsystem for Linux, this hasn't happened yet.)

Until then:

$ sudo apt install nodejs nodejs-legacy
Sat, 20 May 2017

Software-defined radio kits available

I just installed the Java Development (aka the JDK) and was trying to test Java in the browser by going to the WebSDR page to listen to software-defined radios over the Internet.

The last time I listened to WebSDR, you needed Java in the browser to make it happen.

I had no idea that Java in the browser is no longer a thing.

I confirmed my JDK was working via the Windows command line, and I also learned that WebSDR now uses HTML5 in place of Java.

I also learned from the KFS WebSDR site's About page that the inexpensive Softrock radios that are behind most SDR sites are available for purchase both pre-built and in kit form from Five Dash Inc..

I've also seen SDR radios in the range on eBay.

I'm tempted ...

Learn more about SDR in these two subreddits:

But the big thing I learned: no more Java in the browser.

New laptop, new OS

The women in my life gifted me with a sweet HP Envy 15-as133cl 15t laptop. I guess they saw the keys pop off of my old HP laptop a few too many times.

The new laptop has an HD screen (1920 x 1080), a lot of memory (16GB), an Intel i7 CPU (not sure of the exact model) and a 1 TB hard drive.

Right now I’m running the Windows 10 that came with it. I “auditioned” Fedora 25 with GNOME and Xubuntu 17.04, and while either one may indeed work with this hardware (the biggest problem being the HD screen and the Linux desktop environments’ inability to handle them without a lot of little tweaks), for now I’m sticking with Windows.

The main reason that I can stick with the stock OS is the Windows Subsystem for Linux (aka the WSL), which gives me a full Ubuntu-powered Bash shell that runs pretty much every Linux console program available. I’m using it to run/update my Ode blog (I still can’t get Unison in Windows to work across networks because I can’t get SSH working and am a little wary of Windows software that seems frozen in time).

As I allude to in the sentence above, adding software in Windows has it’s good and bad points. Good: You can easily run things like MS Office and the Adobe suite, though I don’t use those at all (instead opting for LibreOffice and Google Docs, and GIMP/IrfanView/Inkscape). Bad: Some things are old and unmaintained, like the ClipX clipboard manager that I rely on heavily. Plus after years of drawing on huge Linux software repositories offered by projects like Debian, Ubuntu and Fedora, having to go all over the Internet to find applications is not something I’m excited about.

That said, I have most of what I need. I’m playing with JavaScript, especially in Node, quite a bit, and I have Node installed both in the Ubuntu shell and on the Windows side.

I don’t have Ruby in the WSL or Windows since I haven’t used it in awhile, but I will probably do that in the WSL.

If/when I start dabbling in Java again, I can do that on both sides (WSL and Windows), too.

For Java and Ruby especially, I like coding with them in the Geany editor, which is like a “baby” IDE (it can execute your code, though I’ve never gotten it to work like that with JavaScript/Node). Unfortunately Geany is one of those old GTK apps that looks like hell on this laptop’s HD screen. Principally it’s blurry. So I’ve been using Notepad++ instead, which is a great text editor, though I haven’t figured out if it is capable of executing code in the languages I use (Ruby, JavaScript, Java, Bash).

I am also experimenting with Visual Studio Code, Microsoft’s “not-quite Visual Studio” editor. The “not-quite” part is OK by me, because most IDEs I’ve tried are so massive and cryptic that I’m happy to have something that’s I can understand more easily.

I already had Visual Studio Code on my old HP’s Fedora system, and now I have it in Windows 10 proper. I’ve used it for a little JavaScript. I like the syntax highlighting, and I was able to execute my code via the debugger. (If you actually know what you are talking about, I encourage you to laugh at or with me — your choice.)

In the WSL, I’m relying on Vim as my text editor, and I’m using the limitations of the WSL (most of which can be summed up as “no GUI,” though you can definitely hack one in) as an excuse to sharpen my Vim skills. I also have Vim and gVim on the Windows side. (Vim is everywhere.)

You might notice that a lot of the programs I’m using are things you’d find in Linux. I’m surprised that so many traditional Linux/Unix applications are available in Windows. Some of them are even regularly maintained.

I’ll detail all the software I’m using in Windows 10 at some future point, probably on another site, but quickly:

Audacity (audio editor) Dropbox (file sync) FileZilla (FTP) GIMP (image editor) Inkscape (vector graphics editor) IrfanView (image editor) LibreOffice (office suite) Node.js (JavaScript in the console) Notepad++ (text editor) OpenShot (video editor) PuTTY (terminal for SSH connections to servers) qBittorrent (torrent client) QuiteRSS (RSS reader) Vim and gVim (text editor) Visual Studio Code (text editor, mini IDE) VLC (video editor) Windows Subsystem for Linux (aka WSL aka Ubuntu for Windows aka Bash on Windows … do you think they have a branding issue?) Things I’m relying on in the WSL:

Bash (which is obvious, but I use all the common Unix tools and rely on a number of scripts to automate various tasks) SSH (for encrypted connections) Unison (file sychronization) Things I haven’t yet installed:

Geany (GTK text editor that looks a little rough in Windows 10 on this laptop) Hugo (static site/blog engine) JVM (the Java Virtual Machine) Netbeans (IDE written in Java) Ruby (programming language)

Wed, 17 May 2017

Fedora, SUSE and easier installation coming to Windows Subsystem for Linux

Microsoft is ticking all of the right boxes with the Windows Subsystem for Linux, announcing that it will be bringing Fedora and OpenSUSE to the WSL as well as offering installation via the Windows Store.

There will also be the option of installing the Ubuntu, Fedora and SUSE version of the WSL at the same time, though it is unclear if they will have separate filesystems, and/or the option of sharing a single Linux filesystem.

I'm not a SUSE user but am a longtime Fedora user, and having the option of Fedora is a very attractive one because it's that much easier to get newer versions of things like Node, Ruby, Java, etc., in this developer-centric distribution that is a lot more stable than you'd think.

As far as installation goes, the current way you get the Ubuntu-powered WSL on your Windows 10 system is more than a little bit hacky, and the use of the Windows Store will make it easier and more inviting for new developers as well as "new" Windows "power users" coming over from years of desktop Linux (like me).

There isn't much in the way of announcements on adding graphical capabilities to the Windows Subsystem for Linux, though Microsoft isn't discouraging those who are already adding an X server to their WSL, but I figure official support for Linux GUI software in the WSL is somewhere on the roadmap.

For now I'm happy to be using a Ubuntu-based system for the first time in a long time (after the aforementioned years of Fedora). As I've written previously, the move from 14.04 to 16.04 was pretty crucial because I was able to get away from the super-old Node.js in 14.04, though the newer Unison required me to pin the old Unison from 14.04 to maintain compatibility with the Unison on my server.

While I've been happy to learn that you can pretty much download a Ubuntu package from the archive and install it with dpkg, I haven't yet experimented with PPAs in the WSL. Might be time for that.

Changing the directory: Since the WSL is rapidly going from a Ubuntu-only offering to one that will offer Fedora and SUSE, I'm changing this directory's name from ubuntu_on_windows to linux_on_windows.

Wed, 10 May 2017

Microsoft Edge vs. Google Chrome vs. Firefox

I decided to give the new Microsoft Edge browser a try in Windows 10. When I open it, I get this page that says Google Chrome is 5 percent slower than Edge, and Mozilla Firefox is 9 percent slower.

Four things:

  • From my use, I would figure that Chrome is at least 25 percent faster than Firefox.
  • The scores are based on Google Octane, which is being mothballed because everybody is cheating with it.
  • I'm supposed to get excited about a 5 percent speed improvement? Sharing bookmarks and passwords across Google Chrome instances on Windows 10, Windows 7, Linux and Android is more important than a small speed improvement that may not even be real.
  • The more I look at this, saying Chrome is 5 percent slower than Edge doesn't mean that Edge is 5 percent faster than Chrome. Am I right, math and statistics experts? According to my calculations, if Chrome is 5 percent slower than Edge, that means Edge is 19 percent faster than Chrome. Why doesn't Microsoft tout that statistic, which sounds a whole lot better?

Nonetheless, I'm giving the browser a tryout while I'm still using Windows 10.

Tue, 09 May 2017

Javascript digital clock

Since this blog's time is displayed in UTC, I wanted to put a digital clock on the site that told the current Universal Time so a casual reader (like me) could have some idea of how long ago (or what time of "day") a given post was published.

I started with some JavaScript code from Cory/uniqname on CodePen and simplified it greatly and because I wanted more output rather than less, counterintuitively as well.

It uses the Date() object and the toUTCString() method to create the text for display of the time/day/date/year and setInterval to "update" the text every second:

function clock() {
  var local_time = new Date(),
  utc_time = local_time.toUTCString();

document.querySelectorAll('.clock')[0].innerHTML = utc_time;

}
  setInterval(clock, 1000);

I stashed this bit of code in a file called clock.js, and called it into the site with script tags and a div:

<script type="text/javascript" src="/path/to/clock.js">
</script>
<div class="clock"></div>

(Note that /path/to/clock.js means the actual path on the server to where you happen to have created the JavaScript file.)

The toUTCString() method outputs the time in 24-hour format. If I want it it in 12-hour format (with AM/PM), the script would have to get a lot more complicated. I'm not saying I won't do that, but for now the easy wins over the perfect.