The Blog of Tom Webster

Chronic Ranter, Reviewer, and Developer. I speak only for myself, opinions are my own.

Fix WebEx Screen Share in Debian

  2016-03-07 03:07:31 PST

In Debian, I was able to get the WebEx java applet to launch in Iceweasel with the help of OpenJDK, but I couldn't get screensharing to work properly. It just never came up when someone was sharing their screen and it wouldn't let me share my own.

Go ahead and install some 32-bit libraries, this should help:
Note: You must have multiarch enabled on your machine for this to work: sudo dpkg --add-architecture i386; sudo apt-get update

sudo apt-get install libgtk2.0-0:i386 libglib2.0-0:i386 libglib2.0-0:i386 openjdk-7-jre-headless:i386 libpango-1.0-0:i386 libpangoft2-1.0-0:i386 libpangox-1.0-0:i386 libxft2:i386 libxmu6:i386 libxt6:i386 libxv1:i386 openjdk-7-jre

Then launch your meeting again. Hopefully screensharing should work. I have heard reports of this not helping with meeting audio issues, but I don't use WebEx audio, I can't comment on that.

If that doesn't work, figure out what else you're missing with the help of this AskUbuntu post.

In case that post ever goes away, I've mirrored the steps here:

From this post, here is a step-by-step method that might work:

  1. Install JDK.
  2. Configure Java plugin for browser (no need for a 32-bit JDK or Firefox).
  3. Start a WebEx to create .so files inside $HOME/.webex/????/.
  4. Check for unresolved .so dependencies: ldd $HOME/.webex/????/*.so > $HOME/check.txt
  5. Search for missing libraries: grep "not found" $HOME/check.txt | sort | uniq
  6. Review the libraries; for example: libasound.so.2 => not found libjawt.so => not found libXmu.so.6 => not found libXtst.so.6 => not found libXv.so.1 => not found
  7. Find the corresponding packages: sudo apt-get install apt-file sudo apt-file update
  8. Locate that package that contains the missing libraries: apt-file search libXmu.so.6 apt-file search libjawt.so
  9. Install the missing libraries, for example: sudo apt-get install -y libxmu6:i386 sudo apt-get install -y libasound2:i386 sudo apt-get install -y libxv1:i386 sudo apt-get install -y libxtst6:i386 sudo apt-get install -y libgcj12-awt:i386

Additional Sources

http://ubuntuforums.org/showthread.php?t=2184620

Command Line Twitch TV Browser

  2016-02-09 07:59:40 PST

Updated: 2016-03-02 - Audio-only functions, easier to change preferred game/language/quality, added MIT license.

I've been watching a fair amount of Dota 2 on Twitch.tv, but I wanted to watch in VLC, rather than taking up a browser tab. I did a small amount of research and discovered Livestreamer. It's a really simple command line utility that launches various live streaming services in VLC, with a super simple syntax: livestreamer twitch.tv/day9tv best.

But then I ran into an annoyance...

I don't watch just one Dota 2 channel. I watch a wide variety of channels depending on who's streaming. I found myself still opening a browser tab, heading to the Dota 2 game page and deciding what channel to watch. Pretty annoying for what should be a command-line-twitch-tv-vlc-launcher. So I did what any other programmer would do: I wrote a tiny crappy little thing to fix the problem.

I can run this script (which I've placed at ~/bin/watchtwitch) with watchtwitch and instantly get a nice menu of who's streaming right now:

1) moonducktv (20281)
2) attackerdota (1931)
3) beyondthesummit (657)
4) y0nd (298)
5) dannygamingnc (204)
6) rexitus (176)
7) dotacapitalist (172)
8) theexel80 (33)
9) xxgodzillaxx (28)
10) dotkaember (19)
Choose your channel:

From there, I hit a number, press Enter, and I'm watching Dota. Pretty rad. You will need livestreamer, on Debian, you can accomplish this with a simple sudo apt-get install livestreamer. You'll need ruby in some form to use this script. You'll also need the Twitch gem, so run gem install twitch.

I've updated this script to use some variables at the top, so it's easier to modify for your preferred games. You can also pass --audio-only while running the script to get an audio-only stream. It's great if you can't watch, but want to listen in to the action.

To get an audio-only stream, use it like this: watchtwitch --audio-only.

Grab the code below, it's really simple if you want to change your preferred language or game:

#!/usr/bin/env ruby

# Requires 'livestreamer': https://github.com/chrippa/livestreamer
# Requires Twitch Gem: https://github.com/dustinlakin/twitch-rb

# Set default options here. You can change these to find different game streams,
# different languages, or set a different stream quality.
GAME = "Dota 2"
LANGUAGE = "en"
QUALITY = "best"

# If "--audio-only" is passed to watchtwitch, we'll set AUDIO_ONLY to true. This
# will force an audio-only stream. This is useful if you are in a situation
# where you can't watch a stream, but would like to listen in and keep up.
if ARGV[0] == "--audio-only"
  AUDIO_ONLY = true
else
  AUDIO_ONLY = false
end

# Import the Twitch gem
require 'twitch'

# Create a new Twitch object
t = Twitch.new

# Initialize our counter and channels array
i = 0
channels = []

# Use the Twitch API to grab all Dota 2 English streams.
# Cut down the list to the top 10 streams, ordered by number of viewers
# Then, for each of those streams...
t.streams(:game => GAME, :language => LANGUAGE)[:body]["streams"][0..9].each do |stream|
  # Increment the counter
  # This will be useful when asking the user which channel to pick
  i += 1
  # Make an empty hash
  # This will hold all of the channel information
  channel = {}
  # Set the channel ID to our counter
  channel[:id] = i
  # Set the channel name
  # This gets used by `livestreamer` later
  channel[:name] = stream["channel"]["name"]
  # Set the number of viewers
  # This is only used to show the user how popular a particular stream is
  channel[:viewers] = stream["viewers"]
  # Push our channel hash into the channels array
  channels.push(channel)
end

# For each channel (all 10 of them)...
channels.each do |channel|
  # Print out the channel ID (from our counter), the name, and the number of viewers
  puts channel[:id].to_s + ") " + channel[:name] + " (" + channel[:viewers].to_s + ")"
end
# Ask the user which channel they'd like to watch
puts "Choose your channel:"
STDOUT.flush
# Grab the user's input
choice = $stdin.gets.chomp
# Start livestreaming whatever choice the user makes We'll execute a native
# binary "livestreamer" (hopefully it's in your path) with the url
# "twitch.tv/channelname", livestreamer has a twitch.tv plugin, so it can figure
# out what to do with that URL. We then set the stream quality, I've chosen
# "best" here, because it's pretty, but you can choose something more sane if
# you have bandwidth constraints or are on a metered connection, check out the
# variables up top. By default, livestreamer launches VLC to play the stream,
# but you can check out it's documentation if you have a better idea. If you
# pass "--audio-only" to watchtwitch, it will use an audio-only stream.
if AUDIO_ONLY
  exec "livestreamer twitch.tv/" + channels[choice.to_i - 1][:name] + " audio"
else
  exec "livestreamer twitch.tv/" + channels[choice.to_i - 1][:name] + " #{QUALITY}"
end

This code is MIT Licensed. Use it however you want.

Tips for installing Arch Linux on Macbook Pro

  2016-01-29 04:19:39 PST

Some pointers on installing Arch Linux on a Macbook Pro. I don't use Arch anymore, but this might be helpful for someone. In these examples, I'm using pacaur instead of pacman for the AUR integration. Check out this page in the Arch wiki for more information on pacaur.

Wifi

pacaur -S broadcom-wl-dkms - I use the dkms version to keep things stable.

Backlight

Set this in /etc/rc.local: setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0

LTS Mode (more stable)

LTS Kernel Installation

pacaur -S linux-lts linux-headers-lts nvidia-lts, then use dkms versions of modules to build against your new kernel. Then use sudo grub-mkconfig -o /boot/grub/grub.cfg to create a new boot menu. LTS should be at the top, but if not, you can add these options to /etc/default/grub to make grub save your last boot option:

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
GRUB_DISABLE_SUBMENU=y

General Kernel Modules

Enable the dkms service to automatically build kernel modules when the source updates. Only install dkms versions of modules.

Virtualbox Host DKMS

Use dkms install vboxhost/$(pacman -Q virtualbox|awk '{print $2}'|sed 's/\-.\+//') -k $(uname -rm|sed 's/\ /\//') to install the virtualbox host modules using dkms.

Mechanical Keyboards

  2016-01-23 18:40:10 PST

Introduction

Mechanical keyboards. Oh hell yes. Clickity clackity. I will type on nothing else as long as I live, given that I have the choice. In this post, I'm going to tell you about two keyboards that I've bought and have been using for a while and why you should take out a second or third mortgage just to type on these beautiful pieces of modern machinery.

The first question you might be asking is "Why mechanical?". It's honestly a hard thing to answer. It's just something you have to feel to truly know the difference. I like to spend my money where I spend my time, and most of my waking hours are spent in front of a screen bashing on a keyboard. Just the feel alone is well worth the money.

The best way I can describe it is this:

Would you rather spend 8 hours a day sitting in this:

or this:

After typing on a mechanical keyboard for a while, every other keyboard feels like using that plastic lawn chair for extended periods of time. The best way I've heard it described is that all other rubberdome (non-mechanical) keyboards feel like typing on mashed potatoes, a very apt comparison.

CODE Keyboard

The first mechanical keyboard I bought was the CODE Keyboard with Cherry MX Clear switches. The keys aren't too heavy, but they have a nice spring to them. If you're a heavy typer like myself, you'll want to get some o-rings to help dampen the sound a bit. I ended up getting the red ones, but I may switch to blue to help enhance the sound dampening. After a while using it, my shift key started to squeak, so I picked up this tube of lubricant and it fixed it up perfectly. Also, any keyboard of mine is going to have a red escape key, it just has to be done.

Later on, I got backlight color covers to try out, but I ended up sticking with the white backlight.

CODE Keyboard parts list and price breakdown:

Unicomp Ultra Classic Black Buckling Spring USB

The second mechanical keyboard I bought was the Unicomp Ultra Classic. If you've ever used the classic IBM Model M keyboard, you know exactly what you're getting into. This keyboard is a buckling spring board, and the only difference I can see in this and the classic Model M is that the housing is a bit smaller, the color scheme is different (if you chose black like I did), and it has a USB connection (but you can get a PS2 connection instead). It's heavy, it feels fantastic, and I only have one small complaint: The rubber stoppers on the bottom slide a bit, unlike the CODE Keyboard. I think bigger rubber stoppers would help aleviate this problem, but it isn't like the keyboard just slides around everywhere, it's a subtle tiny problem.

This keyboard feels and sounds (IBM Model M sounds, but it's the same thing) absolutely amazing. The buckling springs are nice a crisp, you know when you've pressed a key and accidental presses don't happen. The key springs are heavy enough that you can rest your fingers on the keys, completely dead-weight, without accidentally pressing down a key. The keys spring back nice and crisp, ready for orders.

The keys look fantastic as well, the glyphs are created using dye sublimination, which means you cannot wear the prints off of the keys, as the plastic of the keycaps are stained with that particular glyph. The result is that the keys will continue to look nice for the next few decades.

Probably the greatest feature of this keyboard is the price, a mere $84 for the keyboard. You're not gonna get a backlit keyboard that will fly you to space or get you to the top of /r/mechanicalkeyboards, but what you are going to get is a fantastic keyboard with a great feel, that will be absolutely reliable for a decade or more. Well worth the money all by itself.

But that didn't stop me from adding a small number of additions: A red escape key, and a tux keycap set to replace my Windows keys.

But wait! There's more! These are made in the USA. In Lexington, Kentucky to be exact. Also, I recieved a key that was the wrong size in my Tux Key Set, so I emailed customer service, got a reply crazy fast, and they shipped me the proper key right away. Great customer service, no bullshit, no jumping through hoops, just making people happy quickly and easily. I'm very impressed.

Unicomp Ultra Classic parts list and price breakdown:

Which do I like better

I have to say, I do much prefer the Unicomp keyboard. It's crazy loud, it's not fancy, there's no backlighting, but it just feels great and the price is unbeatable for a well-respected and well-made mechanical keyboard.

Mechanical Keyboard Resources

Installing and Holding Stable Packages in Debian Sid

  2016-01-22 15:49:13 PST

Sometimes, running Debian Unstable is... well... unstable. Most of the time it's perfectly stable, it's just bleeding-edge Debian, perfect for my workstations at home, where I want the latest and greatest the FOSS community has to offer. Rarely, a package will just break or come with some nasty bugs. Two I've gotten bit by recently are network-manager and nvidia-driver. These have been fixed recently, but for a bit, the network-manager bug really bummed me out, I wanted a solution to get back to 'normal' (and I had already cleared my apt-cache).

In both cases, I was able to install the package from stable or testing and get back to my original functionality. Today I'll walk you through how to do that.

First, let's make sure we have the ability to use HTTPS with apt:

sudo apt-get install apt-transport-https

I use the https mirrors at kernel.org, so my /etc/apt/sources.list looks like this:

deb https://mirrors.kernel.org/debian/ sid main contrib non-free
deb-src https://mirrors.kernel.org/debian/ sid main contrib non-free
deb https://mirrors.kernel.org/debian/ testing main contrib non-free
deb-src https://mirrors.kernel.org/debian/ testing main contrib non-free
deb https://mirrors.kernel.org/debian/ stable main contrib non-free
deb-src https://mirrors.kernel.org/debian/ stable main contrib non-free

Next, let's set our default release. This will tell apt where we prefer our packages to come from. In my case, I want my packages to come from sid (the codename for Debian unstable).

Add this line to /etc/apt/apt.conf.d/70debconf:

APT::Default-Release "sid";

Note: If you want your default release to be stable or testing, use that instead of sid in the line above.

What this does is tell apt and dpkg that we prefer for our packages to come from the sid release channel, that keeps us on the unstable branch of Debian. Nice and current. To see this in action, run this command:

sudo apt-cache policy network-manager

network-manager:
  Installed: 0.9.10.0-7
  Candidate: 1.0.10-2
  Version table:
    1.0.10-2 990
      990 https://mirrors.kernel.org/debian sid/main amd64 Packages
    1.0.10-1 500
      500 https://mirrors.kernel.org/debian testing/main amd64 Packages
    *** 0.9.10.0-7 500
      500 https://mirrors.kernel.org/debian stable/main amd64 Packages
      100 /var/lib/dpkg/status

See the 990 next to the sid version? That's our pin-priority value, the highest value wins when apt-get looks for a version to install. By setting our default release channel, we've set sid's pin-priority to 990.

For more information on pinning, check out these great resources:

You can now use -t stable to install a package from the stable repositories:

sudo apt-get install -t stable network-manager

Now, that package will be upgraded next time you run updates (even unattended-upgrades will do this), so you need to tell dpkg to hold the package and add it to the "Don't auto-upgrade this one" list:

If you have unattended-upgrades installed and configured, you should see this section in /etc/apt/apt.conf.d/50unattended-upgrades:

// List of packages to not update (regexp are supported)
Unattended-Upgrade::Package-Blacklist {
//      "vim";
//      "libc6";
//      "libc6-dev";
//      "libc6-i686";
};

Add your package to that list:

// List of packages to not update (regexp are supported)
Unattended-Upgrade::Package-Blacklist {
//      "vim";
//      "libc6";
//      "libc6-dev";
//      "libc6-i686";
        "network-manager";
};

Now unattended-upgrades won't upgrade that package, but you still can accidentally upgrade it if you use sudo apt-get upgrade or sudo apt-get dist-upgrade, so here's how to fix that problem:

Run: echo "network-manager hold" | sudo dpkg --set-selections

Note: You don't want to leave packages on hold forever, that would be very very bad. Packages regularly get security updates, and even the bug you suffer from currently will eventually be fixed (watch the Debian bug tracker, it's helpful), so you'll want to remove the hold once a new version of the package has been released. If you keep a package on hold forever, you will compromise the security of your system!

To "unhold" a package, use this command:

echo "network-manager install" | sudo dpkg --set-selections

Now you can sudo apt-get upgrade or sudo apt-get dist-upgrade to get the latest release of the package.

If you have any questions or comments, hit up the section below.

Page: 4 of 31