Saturday, October 14, 2023

Raspberry Pi Zero W OpenWrt Image With USB Ethernet Support

I made a secure and portable WiFi hotspot with a Raspberry Pi Zero W. Standard OpenWrt for the Pi didn't include necessary USB-to-Ethernet kernel modules, so I figured out the required packages and dependencies to add to the standard list. Then, I used this to generate a custom OpenWrt version. This allows you to use a USB-to-Ethernet adapter or connect the Pi Zero with USB OTG for WAN traffic.

The Pi Zero W mounted on USB-A Addon Board for power, or power and data (USB OTG).

Pi Zero WPi Zero W with USB Adapter Board


Note 1: YOU DO NOT NEED THIS ADDON BOARD. If all you want is a wired Ethernet port, get an adapter like the one you see below (and you'll need a power supply too,  of course).

Note 2: If you are using this addon board, I do not recommend plugging in the micro-USB hub shown below. (Things won't work right from what I can tell, and who knows it might even damage something? I don't intend on finding out myself).  The point of the add-on board is to enable you to plug it into a router or computer (with rNDIS enabled) so the Pi Zero can get power and (WAN) data from it.

The micro-USB hub I use...

USB OTG Adapter

Pi Zero W with USB-to-Ethernet adapter, micro-USB hub or as a USB OTG device, the OpenWrt firmware generated should work for all three of those options.

Building the OpenWrt Image

OpenWrt Firmware Builder



1. Navigate to the OpenWrt image for the Raspberry Pi Zero W image (22.03.5 at the time of this writing)


2. Click the Customize Installed packages and/or first boot script drop-down

3. Replace the list in the Installed Packages field with the following:

base-files bcm27xx-gpu-fw bcm27xx-userland brcmfmac-firmware-usb busybox ca-bundle cgi-io cypress-firmware-43430-sdio cypress-nvram-43430-sdio-rpi-zero-w dnsmasq dropbear e2fsprogs firewall4 fstools fwtool getrandom hostapd-common iw iwinfo jansson4 jshn jsonfilter kernel kmod-brcmfmac kmod-brcmutil kmod-cfg80211 kmod-crypto-crc32c kmod-crypto-hash kmod-crypto-sha256 kmod-fs-configfs kmod-fs-vfat kmod-hid kmod-hid-generic kmod-input-core kmod-input-evdev kmod-lib-crc-ccitt kmod-lib-crc32c kmod-libphy kmod-mii kmod-mmc kmod-nf-conntrack kmod-nf-conntrack6 kmod-nf-flow kmod-nf-log kmod-nf-log6 kmod-nf-nat kmod-nf-reject kmod-nf-reject6 kmod-nfnetlink kmod-nft-core kmod-nft-fib kmod-nft-nat kmod-nft-offload kmod-nls-base kmod-nls-cp437 kmod-nls-iso8859-1 kmod-nls-utf8 kmod-phy-ax88796b kmod-ppp kmod-pppoe kmod-pppox kmod-slhc kmod-sound-arm-bcm2835 kmod-sound-core kmod-usb-core kmod-usb-dwc2 kmod-usb-gadget kmod-usb-gadget-eth kmod-usb-hid kmod-usb-lib-composite kmod-usb-net kmod-usb-net-asix kmod-usb-net-asix-ax88179 kmod-usb-net-cdc-ether kmod-usb-net-cdc-ncm kmod-usb-net-rtl8152 kmod-usb-roles libblkid1 libblobmsg-json libc libcomerr0 libext2fs2 libf2fs6 libgcc1 libiwinfo-data libiwinfo-lua libiwinfo libjson-c5 libjson-script liblua5.1.5 liblucihttp-lua liblucihttp0 libmnl0 libnftnl11 libnl-tiny libpthread librt libsmartcols1 libss2 libubox libubus-lua libubus libuci libuclient libucode libustream-wolfssl libuuid libwolfssl logd lua luci luci-app-firewall luci-app-opkg luci-base luci-lib-base luci-lib-ip luci-lib-jsonc luci-lib-nixio luci-mod-admin-full luci-mod-network luci-mod-status luci-mod-system luci-proto-ipv6 luci-proto-ppp luci-ssl luci-theme-bootstrap mkf2fs mtd netifd nftables-json odhcp6c odhcpd-ipv6only openwrt-keyring opkg partx-utils ppp ppp-mod-pppoe procd procd-seccomp procd-ujail px5g-wolfssl r8152-firmware rpcd rpcd-mod-file rpcd-mod-iwinfo rpcd-mod-luci rpcd-mod-rrdns ubox ubus ubusd uci uclient-fetch ucode ucode-mod-fs ucode-mod-ubus ucode-mod-uci uhttpd uhttpd-mod-ubus urandom-seed usign wireless-regdb wpad-basic-wolfssl


4. Edit the wlan_name, wlan_password, root_password, etc. variables in the script below, and then add it in the Script to run on first boot (uci-defaults) field.


# Beware! This script will be in /rom/etc/uci-defaults/ as part of the image.
# Uncomment lines to apply:
#
wlan_name="YourWiFi"
wlan_password="YourSuperSecretWiFiPassword!"
#
root_password="YourSuperSecretPassword!"
lan_ip_address="192.168.1.1"
#
# pppoe_username=""
# pppoe_password=""

# log potential errors
exec >/tmp/setup.log 2>&1

echo g_ether > /etc/modules.d/56-g_ether
echo dtoverlay=dwc2 >> /boot/config.txt

if [ -n "$root_password" ]; then
  (echo "$root_password"; sleep 1; echo "$root_password") | passwd > /dev/null
fi

# Configure LAN
# More options: https://openwrt.org/docs/guide-user/base-system/basic-networking
if [ -n "$lan_ip_address" ]; then
  uci set network.lan.ipaddr="$lan_ip_address"
  uci commit network
fi

# Configure WLAN
# More options: https://openwrt.org/docs/guide-user/network/wifi/basic#wi-fi_interfaces
if [ -n "$wlan_name" -a -n "$wlan_password" -a ${#wlan_password} -ge 8 ]; then
  uci set wireless.@wifi-device[0].disabled='0'
  uci set wireless.@wifi-iface[0].encryption='psk2'
  uci set wireless.@wifi-iface[0].ssid="$wlan_name"
  uci set wireless.@wifi-iface[0].key="$wlan_password"
  uci commit wireless
fi

# Configure PPPoE
# More options: https://openwrt.org/docs/guide-user/network/wan/wan_interface_protocols#protocol_pppoe_ppp_over_ethernet
if [ -n "$pppoe_username" -a "$pppoe_password" ]; then
  uci set network.wan.proto=pppoe
  uci set network.wan.username="$pppoe_username"
  uci set network.wan.password="$pppoe_password"
  uci commit network
fi

echo "All done!"


5. Click Request Build

6. Download the resulting Factory (Ext4) image

7. Flash to you Pi's SD Card

8. Boot up the Pi Zero

9. Connect to the Pi Zero's WiFi, and open the web interface at https://192.168.1.1 with the root password you set above

10. Reboot the Pi Zero (so the g_ether module will load from now on)

11. Connect to the web interface again, and configure your OpernWrt router as desired

12. Bonus step: Delete the script in Step 4 from /rom/etc/uci-defaults/ because it is the right thing to do (security is important, right?)

I hope someone finds this useful.  It took me more time than I would've liked to figure it out and in getting it to work, so enjoy!

Resources:

micro-USB Hub:
OTG Cable to Ethernet Adapter for Alexa TV Cube, TV Stick Lite 2020, Show (2nd Gen), Micro USB HUB with Power 

Pi Zero W USB-A Addon Board:

A few helpful pages:



Version 20231028

Friday, October 25, 2019

Raspberry Pi 4 NAS

I almost ran out of room on my old 1TB (2 x 1TB HDD in RAID 1) LG N2R1DD2 NAS. The Raspberry Pi 4 had just recently started shipping, so I thought I'd get one to build a replacement fileserver. Good timing. I had the thing finished and my files copied over from the old to the new, and a couple of weeks later the LG NAS started dying!! Not the drives, maybe the board. Since I cannot shell into it, I can't really see what's going on. Anyway, that LG box was a fine piece of kit. I don't think they make anything similar to it these days. That is a real shame because it did so much and it didn't break the bank when I bought it.

External Hard Drives connected to the Pi 4 on it's USB 3 ports. I have it set up as follows: The two 5TB drives are configured in RAID1 (mirrored). The whole RAID device is encrypted with LUKS (using a mighty long pass phrase). LVM is used to manage the (EXT4 formatted) space. It's not fancy, but I like the redundancy, whole drive encryption, and the flexibility LVM gives you. That being said, you could do all of that with ZFS alone! I don't even know if the Raspbian distribution offers ZFS, or if it does, how stable it is. I do like my data after all. (And yes, I do have a new external backup drive just in case it all collapses on me one stormy night.)

Anyway, Samba is up and running. It is handling network printing as well. I have the 4GB Pi 4, which is overkill for this NAS setup, but if I like I can fire up lightdm and play around with the Pi desktop for what it's worth.

My next experiment is going to be a super minimalist NAS using some spare drives (maybe even the old 1TB drives from the LG NAS) and a Pi Zero W. The external hard drive enclosures will run more than the computer! USB 2 speeds will be ugly. Still, it will be cool to see what kinds of cool things you can do with a $10 wireless computer!

Anyway, maybe I write a step-by-step how to one day, if anyone is even interested.

Tuesday, October 22, 2019

Experiencing ZFS In Ubuntu 19.10

ZFS in Ubuntu 19.10 has been an amazing introduction to this incredibly powerful file system for me. So far I've found it very easy to use. It's obvious that you can simply  and effectively replace LVM & software RAID in Linux with it. It looks like that is just the beginning. Looking forward to learning & doing much more with ZFS in the future.

Saturday, August 27, 2016

Metallica: Hardwired

Finally! New Metallica! It's been... forever!

Anyone else notice how much certain parts of this single sound a lot like Metal Militia?

That's not a bad thing. I'm just sayin'...

Tuesday, January 15, 2013

GDebi: Local deb Installs & Dependencies

Installing a Debian package downloaded locally and trying to install via dpkg -i filename.deb failed because of missing dependencies. dpkg will not download dependencies from the internet for you. You would have to determine what they are and download them, install them, then install the main Debian package. Fun.

Synaptic, apt-get, aptitude, none of them will install (with automatically downloaded dependencies) local packages for you.

Enter GDebi:
gdebi is a simple tool to install deb files. It lets you install local [Debian] packages resolving [downloading, if needed] and installing its dependencies.

Gnome & KDE versions available for Ubuntu:

gdebi: simple tool to install deb files - GNOME GUI
gdebi-core: simple tool to install deb files
gdebi-kde: simple tool to install deb files - KDE GUI
So there you have it. Install gdebi from apt-get, Synaptic, etc. and proceed with your local installs with gdebi. GUI or command line (man gdebi).


Distro: XUbuntu 12.10
GDebi: 0.8.5ubuntu1.1

Saturday, January 12, 2013

Simple Codebox For Blogger

Why doesn't Blogger offer this as a code box formatting option??

I found several different methods that involved modifying your Blogger template by adding CSS code. I tried a few of them without the success I wanted. I did find this easy to use web app that will do what I want, until I decide to go back to messing with my Blogger template again.


Enter your code snippet, select a few options, and it outputs html that you can paste into your post that will do the job. For some reason it seems to add a whitespace to the beginning & two to the end of each line. Otherwise, it will work for me until I want to mess with the CSS thing.

Here's an output example. An interesting looking startup script for Virtualbox (I haven't tested this script however, so YMMV)...


#!/bin/bash

# Copyright Information
# CC License BY-NC-SA 3.0 Unported License (May 11, 2012)
# Charles Auer
# http://charlesa.net/scripts/linux/vboxscript.php

### BEGIN INIT INFO
# Provides:       vmboot
# Required-Start: vboxdrv $local_fs
# Required-Stop:  vboxdrv $local_fs
# Default-Start:  2 3 4 5
# Default-Stop:   0 1 6
# Short-Description: Stop/Start VMs before/after System shutdown
### END INIT INFO

# Updated 04/27/2012

# Add this script to /etc/init.d/
# Run "update-rc.d vmboot defaults 99 01" as root

# Written to work with VirtualBox 4.x
# This script will save the state of any running virtual machines.

# User who is running the VMs (Change this!)
VBOXUSER=vboxuser

# Environmental Variables (Do Not Modify!)
SU="sudo -H -u $VBOXUSER"
VBOXMANAGE="/usr/bin/VBoxManage --nologo"
# Get UUID of All Running VMs
# UUID looks like this: a02b5b54-a84d-48fa-8dac-2a3fad55717e
RUNNINGVMS=$($SU $VBOXMANAGE list runningvms | sed -e 's/^".*".*{\(.*\)}/\1/')
# Get UUID of All VMs
ALLVMS=$($SU $VBOXMANAGE list vms | sed -e 's/^".*".*{\(.*\)}/\1/')

# Functions
function getVMName()
{ echo $($SU $VBOXMANAGE list vms | grep "$1" | awk -F\" '{print $(NF -1)}'); }

# Check to ensure $ALLVMS is not null and exit if it is.
if [[ $ALLVMS = "" ]]; then
        echo "No VMs are detected on this host! Did you configure the VBOXUSER variable?"; exit 1
fi

case $1 in
stop)
if [[ -n $RUNNINGVMS ]]; then
        for v in $RUNNINGVMS; do
        echo -e "Saving state of \"$(getVMName $v)\"..." && $SU $VBOXMANAGE controlvm $v savestate
        done; else
        echo "No running VMs to save!"
fi
;;
start)
for v in $ALLVMS; do
        if [[ -n $($SU $VBOXMANAGE showvminfo $v | grep saved) ]]; then
                echo -e "Waiting for VM \"$(getVMName $v)\" to power on..." && $SU $VBOXMANAGE startvm $v --type headless 1> /dev/null && echo "VM \"$(getVMName $v)\" started successfully!"
        fi
# If the previous loop has an error, the loops exits and returns an error.
        if [[ $? -ne 0 ]]; then
                echo "There was an error starting $(getVMName $v)! Try starting it manually to see what the problem is."; break
        fi
done
if [[ -z $($SU $VBOXMANAGE showvminfo $v | grep saved) ]]; then
        echo "No Saved VMs to Start!"
fi
;;
status)
if [[ -n $RUNNINGVMS ]]; then
        echo "List of Running VMs:" && $SU $VBOXMANAGE list runningvms; else
                echo "No VMs Currently Running!"
fi
;;
list)
echo "List of All VMs:" && $SU $VBOXMANAGE list vms
;;
*)
echo "Usage: /etc/init.d/vmboot start | stop | status | list"; exit 1
;;
esac
exit 0
# eof

Samba: Empty .gvfs XUbuntu 12.10

Problem: Unable to navigate to and/or access remote smb (samba) shares via the bash shell.

It seems something changed when I upgraded from XUbuntu 12.04 to 12.10. I used to be able to open gigolo (which was set to automatically mount remote smb shares), and then work with them in bash by navigating to them with:

cd ~/.gvfs
Running an ls command would display all the remote shared folders and away we go

Now, even though the shares are mounted (I can navigate to them with my file manager), there is nothing in ~/.gvfs

Solution: After mounting the remote shares, you will find them under:

/run/user/username/gvfs/smb-share:server=smbServer,share=shareName,user=username

To save time, create symbolic links to the shares (which of course will only work when the share is mounted):

ln -s /run/user/username/gvfs/smb-share:server=smbServer,share=shareName,user=username shareLink

Distro: XUbuntu 12.10
File Manager: Thunar 1.4.0
Samba Connection Manager: gigolo 0.4.1

Friday, December 28, 2012

OLGA?

Why do I still have a button for OLGA (The On-Line Guitar Archive), a site that has been out of commission for ages? The sad tale should not be forgotten. Particularly since a bazillion other sites now offer (stole) what OLGA users had lovingly crafted over many years...

GMail Backup

The Cloud is great, right?

Keeping your precious personal data files floating about on who knows what server (located in which [totalitarian] nation?), "owned" by company X (subcontracted by company Y), which may (or may not) have a comprehensive security policy that may (or may not) be regularly enforced is (possibly) a wonderful thing, right?

Just for kicks, I think I'll keep a local copy of my family photos, "sensitive" documents, and (on to the point of this post) EMAIL.

Regardless of how our friends at Google utilize the personal information (see Terms & Privacy for more information), we all love GMail, right? It would be a sad day indeed if our beloved GMail account were to suddenly disappear for whatever reason. Or, the 10,000+ emails we never deleted were somehow lost. Again, I like local copies. I like backups.

Enter GMail Backup

GMail Backup is my current application de jour for doing exactly as it's name implies. Description:
Gmail Backup allows to backup and restore the content of your Gmail account. It uses the IMAP protocol to fetch and store your messages. It can also be used to migrate your messages between two accounts, for example between your private inbox and the Google Apps acount.
It's very easy to use, and offers your choice of full or incremental backup.


Download the latest version (gmail-backup-20110307 as of this writing), install, run, enter you GMail loging info, choose a location to store you mail backup, etc...

As you can see, the GUI is simple & self-explanatory, but a little note on the Since Date field is in order. This pertains to the "incremental" backup function. From the documentation:

Downloading all emails from your Gmail Account every time you want to backup your emails would be a nightmare. In this case it comes in hand the incremental downloading feature of email.
Gmail Backup checks all emails in the Gmail Account whether their are already downloaded. If so than it skips them. It only download emails which are not presented in your local copy. However, the checking emails takes time too.
As result, we recommend to specify the date since you want to download emails. For example:
gmail-backup.exe backup backup xxx@gmail.com passwd 20080101
In the example, I specify that I want do check and eventually download emails since 1 January 2008. Consequently, the process of updating of your backup is much faster.
I was using Thunderbird as my email client, and using it to keep a local copy of all my GMail. It has it benefits but these days the GMail web GUI & backing up the mail locally with GMail Backup works for me.


Notes:
Selecting Newest emails only seems the simplest option for keeping your backup current
Yes, you can run the application from the command-line
You can restore your mail to your GMail account with this application

Monday, January 03, 2011

Saving Large Video Recordings From An iPhone

This is a pain. This needs to be fixed. Workarounds should not be needed, but for now we do what we must...

There is some kind of limitation on the iPhone 4 (and iPhone 3GS apparently) that will not allow you to download / save video that you have recorded if it is larger then about a couple hundred MBs. If you have recorded video on your iPhone of any significant length of time—and your file ends up being say, 1GB or so—you simply won't be able to copy it to your system. Picasa can't even do it.

The simplest workaround that I have found as I Googled:
  1. Use iTunes to Sync your phone
  2. Open up My Computer and navigate your way to C:\Documents and Settings\UserName\Application Data\Apple Computer\MobileSync\Backup\
  3. Open up the folder contained at this location (it'll have a lengthy name ce46da1123whatever)
  4. Select View → Details
  5. Select View → Size or click on the Size column label to sort in ascending or descending filesize
  6. Look for the largest file(s)
  7. Copy them to the location of your choice, rename them and add the .mov extension
  8. Done!

Saturday, January 01, 2011

Multiple HTML files to Single PDF with wkhtmltopdf

Very useful (to me). It took a good deal of searching to find the right little application to do what I needed—convert locally saved HTML pages to PDF and collate them into a single file.

It sounds so simple, but actually finding a free / Open Source app to do this was problematic. I hoped HTMLDOC would do the trick and perhaps with a little more experience, I could achieve the desired results. In the meantime I discovered an app for Linux (also available for other operating systems) called wkhtmltopdf that did just what I needed it to do.

It's a command line utility, very easy to use and quite effective. It doesn't make a mess of the pages when converting/collating them. It also allows you to customize page headers & footers among other things. I have been using it under Windows XP1 (which is kind of a pain due to shell limitations compared to bash under Ubuntu, but whatever as long as it works). Entering the command: wkhtmltopdf.exe --extended-help gives you a nice list of options to explore.

My goal was (or seemed) simple enough: Create a single PDF file from the multiple web pages that I had saved locally via the Firefox add-on DownThemAll!

Why do this? The print version pages of the (lengthy) material I wanted to read seems to be intentionally organized on the website to make it difficult to work with for off-line viewing. Lame, but not uncommon by any means of course. Here's the method I used to solve my dilemma:
  • Made a list of the printable version URLs and saved the html files locally. (Not as tedious as it sounds, and mostly automated once the structure of the URLs was determined.)

  • Saved the pages locally with DownThemAll!

  • Used wkhtmltopdf to put the files together using a command similar to the following:
"C:\Program Files\wkhtmltopdf\wkhtmltopdf.exe" --footer-center [page] -s Letter articles.htm articles_001.htm articles_002.htm articles_003.htm articles_004.htm articles_005.htm articles_006.htm CoolRead.pdf
--footer-center [page] gives me page numbering at the bottom and -s Letter sets it to 8.5" x 11" page size (other page size options available). Several other options are also available. Can you simply create a lists of the pages you want to collate instead of listing them on the CLI? I haven't noticed that as an option in --help or --extended-help but it's probably there and easy enough to do. (Can you tell I have only recently started using wkhtmltopdf?) I wanted some kind of cover and toc-type page for the articles. and it just so happens that the main webpage with the links for the on-line articles fit the bill well enough. wkhtmltopdf can work directly with on-line pages so away we went:
"C:\Program Files\wkhtmltopdf\wkhtmltopdf.exe" -s Letter -O Portrait "http://supercoolwebsite.org/docs/?docID=6" Cover.pdf
Update 1/3/2010: I decided I didn't like the "cover sheet" generated with the command above. I ended up creating my own cover page and "table of contents" in OpenOffice Draw and exporting it to PDF. To make life simple I put the wkhtmltopdf command text into a batch file and ran it in the same folder containing the html files. Easy to modify the options & run until I got the (more) precise results I wanted.

Example:
"C:\Program Files\wkhtmltopdf\wkhtmltopdf.exe" -g --disable-smart-shrinking --footer-center [page] -s Letter -T 14mm -B 14mm -L 14mm -R 14mm --disable-external-links --disable-internal-links articles.htm articles_001.htm articles_002.htm articles_003.htm articles_004.htm articles_005.htm articles_006.htm CoolRead.pdf
The additional options shown apply the following formatting to the generated PDF file:
  1. -g = Generate in Grayscale
  2. --disable-smart-shrinking = Without this option, the font size of the generated PDF files was too small. This option provided a larger font-size and made the documents easier to read.
  3. --footer-center [page] = Add page numbers to the bottom-center of each page in the file.
  4. -s Letter = Letter sized pages.
  5. -T 14mm -B 14mm -L 14mm -R 14mm = Increase the page margins. The default put the text too close to the edges of the page.
  6. --disable-external-links & --disable-internal-links = These options do just what you would think: they remove the hyperlinks that are in the html files from the generated PDF file.
Time to put the Cover Page/TOC & the collated HTML-turned-PDF files together for the finished product.

Enter PDFTK Builder from the PortableApps collection.
  1. Add the Cover page/TOC & the collated articles PDF files to PDFTK Builder's Collate option
  2. Click Save As... to combine them.
  3. Done!
Does it sound like a lot of work? It's really not, and I get (almost) exactly what I want. Should there be, or is there an all-in-one Open Source application that does ALL of this for you in one shot? Probably, but I haven't found it yet. The most irratating aspect of this approach? HTML files with bad character entities in them. Tracking those weird characters down in the files and figuring out what to use to replace them is a real pain (depending on how large your final file turns out to be).

At the end of the day, using FireFox + DownThemAll!, wkhtmltopdf, and PDFTK Builder (with a generous nod to Notepad++—a great text / code editor for working with the batch files, link lists, etc.) the job gets done.

There are several HTML articles, etc. that I would like to collate into single PDFs. This combination of free tools is a valuable solution for me.

1 I was not able to use the version of wkhtmltopdf in the Ubuntu repositories as throws an error message about not being built with the correct version of QT4 or something like that. There are articles on how to fix this but I haven't bothered with it yet.

Friday, May 14, 2010

Virtual Box Guest Additions & CentOS 5

Installed CentOS into a VirtualBox virtual machine this evening. I recommend installing the Guest Additions into your virtual machines. Simple to do under Ubuntu. A little more involved with CentOS, but still easy enough.

Google is your friend. Here it is quick and easy:
  1. Start the CentOS virtual machine.
  2. Mount the VboxGuestAdditions.iso
  3. Right-click on the VirtualBox CD icon
  4. Click VboxGuestAdditions.iso to mount it as a virtual CD in CentOS




  5. Press Ctrl+Alt+F2 to open a terminal session if you are not already in one.
  6. Login as yourself (if you have sudo permisions) or root (yes, I know, a terrible thing to ever do)
  7. As yourself preface your commands below with sudo; as root simply enter the following:
  8. mount /dev/hdc /media
  9. cp /media/VBoxLinuxAdditions-x86.run /home/your_username/
  10. cd ~/your_username
  11. chmod +x VBoxLinuxAdditions-x86.run
  12. yum -y install gcc
  13. If not already installed, you will also need to run:
  14. yum install kernel-devel kernel-headers
  15. Time to install the Guest Additions
  16. ./VBoxLinuxAdditions-x86.run
  17. reboot or telinit 6
That's pretty much it. More pointers can be found here.

Saturday, May 08, 2010

Ugly Boot Screen Ubuntu 10.04

Recently did a network upgrade from Ubuntu 9.10 to 10.04 LTS (desktop edition). The upgrade didn't work initially--there was some conflict with XUbuntu which I also had installed under 9.10. I removed all traces of Xubuntu and xfce, and then the network upgrade worked fine.

10.04 LTS is a fine distribution. I really like it. It's been a while since I used Ubuntu and one of the things I enjoy about it is that things just work. Wireless set-up, which had been so painful previously, was a breeze and the connection is fast! Much faster then it had been under XP on the same machine.

Well, to the point. One of Ubuntu 10.04's failings was the boot up splash screen!! So incredibly ugly! I should have taken a picture. The word UBUNTU was outlined in some kind of psychedelic malaise. Painful to look at. Not a show stopper, but please. This isn't a hack distro, this should be slick, professional, pleasant in every way.

Are they working on a fix? I know from bug reports that I am not the only one who's seen similar issues. I don't know, but there is a workaround. I just applied it on this very system I am using to post this entry. Here it is, step-by-step for new users. I used "Alternative One". The only thing I did differently was change screen resolution entries from 1280x1024 to 1024x768 to accommodate the maximum resolution of this relic of a laptop I am using. Here it is, fix that ugly boot logo in Ubuntu 10.04 (Lucid Lynx):

How to Fix the Big and Ugly Plymouth Logo in Ubuntu 10.04

I should post the fun I had doing a network upgrade from Ubuntu 8.04 LTS Server to the 10.04 LTS edition. I'm sure it would have been painless if I wasn't booting from a software RAID1 drives. I hope I can recall how I made it work so I can post for reference the next time I upgrade and it happens again--which of course it will. I have no doubt. It always does.

Oh, and I should mention I am having excellent success running XP from VBox OSE on this dinosaur. I can't believe it works, but it actually works very well!

Well, time to reinstall the Xubuntu desktop.

Saturday, August 29, 2009

Useful Linux Commands

A place to post useful Linux operations in case of organic memory failure:

Convert audio files with bitrate (-b) and sample rate (-ar) options:
avconv -i input.wav -b 64k -ar 41000 output.mp3

Determine which services are running:
service --status-all

Determine Distro Release Version:
lsb_release -a

Store a data CD on your filesystem (this is not one I forget but it pertains the following):
dd if=/dev/cdrom of=/some/dir/data.iso

Mount your virtual data CD:
sudo mount -t auto -o loop /some/dir/data.iso /mnt/vrtl-cd

Check your Linux software RAID status:
cat /proc/mdstat

Ext3 Filesystem Check
sudo umount /SomeFileSystem
sudo screen fsck.ext3 -v -f -p -D -C0 /SomeFileSystem

Friday, August 14, 2009

Stop Windows Messenger in XP Pro

Windows Messenger. So annoying. Disabling it from starting is a wonderful thing. Here's how:

Use the Group Policy (gpedit.msc) snap-in to turn on the Do not allow Windows Messenger to be run option.

Notes
  • To use the Group Policy snap-in, you must be logged on to the computer using an account that has administrator permissions.
  • This method prevents programs that use the Messenger APIs from using Windows Messenger. Microsoft Outlook 2002, Microsoft Outlook Express 6, and the Remote Assistance feature in Windows XP are examples of programs that use these APIs and that depend on Windows Messenger.
To turn on the Do not allow Windows Messenger to be run option, follow these steps:
  1. Click Start, click Run, type gpedit.msc, and then click OK.
  2. In Group Policy, expand Local Computer Policy, expand Computer Configuration, expand Administrative Templates, expand Windows Components, and then expand Windows Messenger.
  3. Double-click Do not allow Windows Messenger to be run, and then click Enabled.
  4. Click OK.
  5. On the File menu, click Exit to quit the Group Policy snap-in.
Thank you Microsoft KB!

Saturday, August 08, 2009

Pick Up The Pace

No, not the Picante sauce. I much prefer Arriba! Fire Roasted Mexican Red Salsa (gallon size!) that my wife found at Costco. Just heat it up a little in the microwave and Mmmmm! Awesome.

I made my own "fire roasted" salsa by roasting all the veggies on the grill once. It was great. A friend of mine said I should bottle it up and sell it. Guess Riba Foods beat me to the punch and they appear to be based in Texas, so of course they are authentic ;-)

Ok, where was I? Oh, no blogging in a long time. And a lot less tech blogging for a while. Lame. Excuse? No broadband at the house. No one would run cable, DSL or anything out where we moved. I was stuck with a super-expensive and quite slow (by the standards I was used to at my previous residence) Sprint "air card". It was expensive, and painfully slow but it served it's purpose (kept me on-line for work—on my dime).

But now, by some miracle (and someone in my area with connections at AT&T) we have 3Mbit DSL! Yes! No, it's not the 6Mbit I was getting at the old house (sighs heavily longing for those days) but it makes downloading Linux distros a whole lot easier! I think we are capped at 2.5Mbit as it kept dropping when we were getting 3+, disappointing but still much more usable then what we had.

Now if 4G lives up to expectations, I may return to the air card thing...

Things I want to start posting again:
  • Linux stuff: Distros, How-To posts, Reviews, etc.
  • Windows stuff: Tips, Tricks, FIXES
  • Miscellaneous Tech Items
  • Basically the things I used to post about
We'll see. For some reason I don't seem to have as much time & energy as I used to. Weird. But I'll try for the two to three people who read this blog, "thank you for your support." (Now there's an old quote, Ha! Wonder how many people would remember where it came from.)

I used to really like writing. I really don't know if I am any good at it, but you be the judge.

Saturday, July 04, 2009

String Hang

Ping... Ping... Ping...

Every time I hit the bar on my Super Strat I could hear the strings hanging up somewhere and making that awful pinging noise. I had a graphite nut installed in the neck a long time ago with the hope that it would help with whammy tuning with the stock bar—but even today with the Planet Waves locking tuners and the Wilkinson tremolo it was making that noise.

I sprayed on some GC Electronics De-Ox-Id at the bridge and nut and problem solved. The only problem I have is, how is it going to react with the graphite nut? I hope I didn't cause more problems then I solved today.

July 6, 2009
Hmm, that didn't last too long. The annoying ping came back. I will have to try something else. Graphite powder? I don't know. "Google is [my] your friend..."

Sunday, May 24, 2009

Foxit PDF Reader

I was loading up the latest Adobe Acrobat reader in Windows XP the other day—it took forever! And, it took forever to open. Total, complete bloatware! What is with that? It's just a PDF viewer—or at least it should be...

Enter Foxit Reader 3.0

Man, now that's just what I needed. A PDF reader that isn't hundreds of MBs, integrates with Firefox, opens quickly and displays properly. Get it.

Wednesday, May 13, 2009

FLAC To .ogg Vorbis

Funny how things go full circle sometimes. I initially worked on converting all of my music CDs to Vorbis files, a tedious and rather boring adventure in itself. I was reminded during a conversation on slashdot that it might be wiser to convert to FLAC first and then I could transcode into lesser quality codecs when needed. I thought it was a reasonable idea—too bad I had all my music in Vorbis format at the time! There's no way of going up in quality...

Time went by. I started another media-shift project, this time CD to FLAC, as I should have done in the first place. Now I actually have items in that collection that I need to transfer down to Vorbis! Ironic... such is life.

Enter our friend oggenc. Simple & effective, yet how to do entire directories in one shot? Fret not, there is nothing to it:

cd /dir/with/flacs
oggenc -q6 *.flac


I'm transcoding some files now that don't appear to have any tag info, so I'm not sure that transfers, but otherwise it is working swimmingly.

Here's a perl script option that might be more useful, but I haven't tried it so your mileage may vary:

#!/usr/bin/perl
#
# Copyright (c) 2004 - Jason L. Buberel - jason@xxxxxxxxxxx
# Licensed under the GNU GPL.
#
# Modified by Dax Kelson to run on a native UNIX/Linux box.

use Getopt::Long;
use File::stat;

$sourceDirPrefix = "/export/media/music/flacs";
$destDirPrefix = "/export/media/music/oggs";
$quality = 5;
GetOptions ( "source:s" => \$sourceDirPrefix,
"dest:s" => \$destDirPrefix,
"quality:i" => \$quality,
"force" => \$force );

# Commands
$oggCommand = "oggenc";
$flacCommand = "flac";

@dirs = `cd "$sourceDirPrefix" && find . -type d -print`;
@files = `cd "$sourceDirPrefix" && find . -type f -name "*.flac" -print`;

# Check to see if our find command found anything to convert.
if ( scalar @files == 0 ) {
die "Found no .flac files to convert!";
}

# recreate the directory hierarchy
foreach $dir (@dirs) {
$dir =~ s/\n$//;
$dir =~ s/^\.\///;

# check to see if the destination dir already exists
if ( !(stat ("$destDirPrefix/$dir")) ) {
# stat failed so create the directory
print "Creating output dir:\n $destDirPrefix/$dir\n";
$dir =~ s/\`/\'/g;
$result = `cd "$destDirPrefix" && mkdir -p "$dir"`;
}


}

# now process the actual sound files.
foreach $file (@files) {
$file =~ s/\n$//;
$file =~ s/^\.\///;

# figure out what the destination file would be...
$destinationFile = $file;
$destinationFile =~ s/\.flac*/\.ogg/;

# now stat the destinationFile, and see if it's date is more recent
# than that of the original file. If so, we re-encode.
# we also re-encode if the user supplied --force
$srcInfo = stat ("$sourceDirPrefix/$file");
$srcModTime = $srcInfo->mtime;
$destInfo = stat ("$destDirPrefix/$destinationFile");
if ( $destInfo ) {
$destModTime = $destInfo->mtime;
print "Skipping current file: $destDirPrefix/$destinationFile\n";
}
# if the destination file does not exist, or the user specified force,
# or the srcfile is more recent then the dest file, we encode.
if ( !$destInfo || $force || ( $srcModTime > $destModTime) ) {
$file =~ s/\`/\'/g;
$inFile = "$sourceDirPrefix/$file";
$outFile = "$destDirPrefix/$destinationFile";
$inFile =~ s/\0//g; $outFile =~ s/\0//g;
$result = `$oggCommand -q $quality -o "$outFile" "$inFile"`;
}

}

Sunday, May 03, 2009

Metamorphose File - Folder Renaming

This is a pretty cool application. Something that should be brainlessly easy under the command line in Linux—all I wanted to do was replace one character in all the filenames in one directory. Well, I ended my search when I found Metamorphose—a Windows app that would do the trick which I could run against the filenames since the directory is on a Samba share. In seconds it was all over.

It makes me unhappy when something which should be blatantly easy from the command line ends up requiring a Windows application. Well, I'm sure it is simple. I'm pretty certain I even know how to do it. If so... I forgot...

Old age or Too Much Information