Blog?

It's kind of a blog if you don't think about it too hard

feed Atom Feed


Contents

Home


Valid HTML 4.01 Strict [Valid Atom 1.0]

Add "restart into" option to GNOME 3.36 / Ubuntu 20.04

July 15, 2021

I recently hacked together a GNOME shell extension to allow selecting an alternate operating system when rebooting, so I don't have to wait around for the system boot menu to appear. And because I wanted to learn how GNOME shell extensions work.

Restart dialog

Installation

  1. Download the extension and extract it to ~/.local/share/gnome-shell/extensions/
  2. Restart GNOME by pressing Alt+F2, then typing r.
  3. Activate the "Restart into..." extension in the GNOME settings.
  4. Open the extension's settings and choose your secondary boot entry, and enter the text that should appear on the button.

Restart dialog

Fast network image thumbnails in GNOME/Nautilus/Nemo

January 14, 2021

I recently noticed that when browsing a network folder full of photos in Linux using Nautilus or Nemo, the thumbnails are generated much, much slower than they are when browsing the folder from Windows Explorer. I don't know what Windows' secret sauce is for this problem, but I realized that by extracting the thumbnails embedded in the EXIF data of many JPEG files, thumbnail generation performance can be greatly improved since the entire file no longer needs to be transferred over the network in order to generate its thumbnail. And so, jpeg-exif-thumbnailer was born.

Requirements

The mogrify and exiftool programs must be installed. On Ubuntu and Debian, these may be found in the imagemagick and libimage-exiftool-perl packages.

This thumbnailer has been tested on Ubuntu 20.04, in the Nautilus and Nemo file managers.

Installation

Download the archive and extract it. Run ./install, or see the README for instructions on manual installation.

Known issues

If the embedded thumbnails are not large enough, Nemo falls back to reading the entire file to generate a thumbnail. Unfortunately, fast EXIF thumbnails will probably not work properly when Nemo is using a high zoom level.

This blog might as well be called "Clicking top-right corner of screen does not close window"

November 11, 2020

Two years ago, I wrote about how to make Compiz more Fitts's law-friendly.

22 days ago, I wrote about how to make GNOME applications more Fitts's law-friendly.

Now it's Firefox's turn (running on Pop!_OS 20.04) To fix its close button, I had to add the following to userChrome.css. Choose only the snippet you need:

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

/* ONLY ONE OF THESE SNIPPETS SHOULD BE USED AT A TIME */

/* Firefox 88 and below */
.titlebar-buttonbox-container {
	margin-top: -5px;
	margin-right: -4px;
}

/* Firefox 89 and above - Normal density */
.titlebar-buttonbox {
	margin-top: -17px;
	margin-right: -4px;
}

/* Firefox 89 and above - Compact density */
.titlebar-buttonbox {
	margin-top: -9px;
	margin-right: -4px;
}

2021-07-13: Updated to be compatible with Firefox 89.

GNOME: Clicking top-right corner of screen does not close window

October 20, 2020

Two years ago, I wrote about how to make Compiz more Fitts's law-friendly. Apparently not many people think this is important, because it turns out it's also an issue with certain GNOME applications that use a GtkHeaderBar.

My workaround is to override the theme CSS to shift the maximized window buttons slightly up and to the right, allowing them to (usually) be triggered by clicking the top-right pixel of the screen. For some reason, it doesn't work 100% of the time, but it's better than nothing.

Add the following to ~/.config/gtk-3.0/gtk.css:

headerbar entry,
headerbar spinbutton,
headerbar button,
headerbar separator {
    margin-top: 0px;
    margin-bottom: 0px;
}

.maximized button.titlebutton {
    margin-right: -2px;
    margin-top: -15px;
}

.maximized headerbar {
    min-height: 24px;
    margin: 0px;
    padding: 0px;
}

The effects of COVID-19 on band concerts

May 27, 2020

Number of seating charts* created in April 2019: 10443
Number of seating charts created in April 2020: 557.

Only 5% of last year's volume.



*Every saved revision of a chart is counted separately, so these numbers are somewhat inflated.

Compiz: Clicking top-right corner of screen does not close window

September 26, 2018

On Xubuntu 18.04 Bionic, I found that, after activating Compiz, I was no longer able to throw my mouse to the top-right corner of the screen to close a maximized window. When clicking the top right pixel of the screen, nothing happened. (In fact, there seemed to be a "hole" in the window; right-clicking brought up the desktop context menu.) Not very friendly, according to Fitts's law. I found many posts from several years ago documenting the problem and workarounds, but none of them worked for me. (After all, who's still using Compiz in 2018?) But here's what finally worked for me:

  1. Install compiz and plugins. For a while, I wasn't getting any window decorations at all until I discovered that I needed to enable the "Copy to texture" plugin.
  2. Install Emerald. I used these instructions since it's not in the Ubuntu repositories any more.
  3. Open Emerald Theme Manager and select your theme.
  4. Still in Emerald Theme Manager, under "Emerald Settings", uncheck "Use Decoration Cropping".
  5. Close Emerald Theme Manager
  6. Edit ~/.emerald/theme/theme.ini in a text editor, and locate the [buttons] section.
  7. Adjust the horizontal_offset and vertical_offset to negative values. The appropriate values depend on the theme. For the Rezlooks-Graphite theme, I found that it would work with horizontal_offset=-3 and vertical_offset=0.
  8. Restart Emerald and adjust your values if needed to shift the buttons as close to the corner of the screen as possible.

Note that you must re-apply your changes to theme.ini if you open Emerald Theme Manager again.

No headphone audio after system resume

May 15, 2015

tl;dr: Install the hotkey drivers.

I noticed soon after installing Windows 7 on my new laptop (Eurocom Shark 4) that I was sometimes getting no sound from my headphones. The Realtek control panel faithfully reported that the jack was connected, and muted the speakers as expected, yet no sound could be heard through the headphones. I experienced this problem on both Windows and Linux (Ubuntu 14.04), so I assumed it was a hardware or firmware problem.

However, after a bunch of futile Googling and tinkering, I noticed a pattern - it always worked on a clean boot, but not after resuming from sleep mode. This led me to refine my search terms, bringing me to this discussion. It turns out that the headphone jack needs to be reinitialized after system resume, and (for some reason I cannot fathom) the hotkey drivers are responsible for doing this! I had not installed the hotkey drivers because Windows responded to most hotkeys out of the box. But sure enough, after installing the manufacturer's hotkey driver, the headphone problem was resolved.

This might work for other Clevo laptops too. So if Google has sent you to this page, I hope it helps.

Eurocom Shark 4 (Clevo N150SD) Windows 7 install notes

May 8, 2015

These are my notes on installing Windows 7 on the Eurocom Shark 4 (Clevo N150SD).

Windows 7 installation (from USB)

Setup will prompt you to load a USB driver.

  1. Insert driver disk
  2. Browse to D:\Drivers\07_USB30\Drivers\Win7\x64
  3. Select Intel(R) USB 3.0 Root Hub if it shows up. If the only choice is the eXtensible Host Controller, choose that instead, ignore the error, then try browsing again and hope the correct option shows up. I don't know why this works.

Post install

  1. Install LAN or wifi driver (see below)
  2. Check for windows updates, install SP1
  3. Continue windows updates until all recommended updates are installed

Drivers

These lists are organized to match the driver DVD. When possible, I prefer to install from Device Manager to avoid the extra junk that the installers sometimes bundle.

  1. Chipset - install from disk
  2. VGA - download from intel and nvidia
  3. LAN - from disk, using device manager
  4. Card reader - from disk
  5. Touchpad - Driver on disk makes touchpad sometimes not respond for me. Instead, install Elantech driver V11.5.11.3 from http://support.asus.com/Download.aspx?SLanguage=en&m=Touchpad&os=30
  6. Hotkeys - install from disk, otherwise the headphone jack will not work after a system resume. See this discussion for more details and a possible workaround on Linux.
  7. USB - install from disk
  8. Management Engine - install from disk
  9. Audio - install from disk.
"Optional" drivers
  1. Webcam - works out of the box
  2. WLAN - Wrong drivers on the disk. Download from http://support.lenovo.com/us/en/downloads/ds038494
  3. Fingerprint - Only install from disk if you plan on using it. Installs background services.
  4. Bluetooth - Probably install from disk. If that doesn't work then download from http://support.lenovo.com/us/en/downloads/ds040784
  5. Cellular radio - Not installed, I don't have one
  6. Intel Rapid storage - install from disk
  7. Intel rapid start - The installer wouldn't run, so I skipped it
  8. Sound Blaster Cinema - Don't know what it does, skipped.
  9. Intel wifi direct - Don't need it, skipped.

Compiz screen corruption

May 3, 2015

This post is for me to look back on later and remember how to fix this!

I installed Ubuntu MATE 14.04 in VirtualBox, installed the guest additions, then switched on Compiz. It worked fine, until I changed the guest screen resolution. Then the guest screen looked like this:

Compiz screen corruption

After some trial and error, the fix: in CompizConfig Settings Manager, OpenGL plugin, uncheck "Framebuffer object".

Really?

August 6, 2014

Terrible CAPTCHA

I can't figure this out, and I don't think I'm a robot.

Heartbleed

April 10, 2014

It has recently come to my attention that the server that runs this website was vulnerable to attacks exploiting the recently-discovered Heartbleed bug. If anyone managed to abscond with any of my passwords, keys, or other sensitive information, please return these items to brad@bgreco.net at your earliest convenience. Thank you.

Android Maps

January 29, 2014

Someone made a video and blog post of a little tweak I wrote for Google Maps on Android. Neat.

Laser pointers!

August 2, 2013

They are awesome. A coworker ordered a whole bunch of them for $2 each so now I have one. Let the fun begin.


Update 8/4/2013: It died already. I guess that's explains the price...

New Email

May 28, 2013

br@dgre.co


Yep.

Words That Amuse Me

April 10, 2013

Just a short list of the words I can think of for now. It may grow...

Deplane - It amuses me, for some reason, that we have a dedicated word for the act of getting off of an aircraft.

Rubbish bin - Far superior to "garbage can". Must be pronounced with a British accent.

Valchives - Definition: those little stringy things you find inside oranges and other citrus fruit. Trust me.


...along with most of the words used in Bulbous Bouffant

Really, spammers?

January 1, 2013

When I added a simple comment system to this blog, I intentionally did not include a CAPTCHA mechanism. I assumed (well, hoped) that this blog is both obscure and custom enough that it would be largely ignored by comment-spammers.

I was wrong.

So, now there is an extra are-you-human check when you go to submit a comment. It's not the traditional "try to decode these symbols that vaguely look like letters if you squint really hard" CAPTCHA, since nobody likes those. Hopefully it will be sufficient to deter the bots, at least.

Comments

December 8, 2012

You might recall, gentle reader, that I once predicted that there would never be any comments on this blog. The reasons I gave were twofold: nobody actually reads this blog, and there is no mechanism in place by which my hypothetical loyal readers could leave comments.

But now, my second reason has been nullified! For I have coded a comment system! Nothing fancy going on with it; just a spot for your name and your comment. If you enter an email, it will be used to load a Gravatar image, and will not be stored. So you're safe from spam even if I get hacked. ;)

To test the comment system, I have asked an acquaintance of mine to give this blog his endorsement. Unsurprisingly, he was more than willing to oblige.

The Most Flexible Consonants

December 2, 2012

As you may or may not know, my initials are BAG. My parents insist that this was not intentional, but I know better. As I was contemplating initials that are also English words, I realized that, if I replaced my middle initial with any other vowel, its status as an English word would remain unchanged: BAG, BEG, BIG, BOG, BUG.

Well, that's cool, I said to myself. But just how lucky am I? That is, out of the 21² = 441 distinct consonant pairs, how many will form a valid English word when each of the five vowels is placed between them? We will consider the letter Y to always be a consonant.

To answer my question, I wrote a small PowerShell program to check each possible Consonant-Vowel-Consonant word using the Microsoft Word 2007 spellchecker:

$word = New-Object -COM Word.Application
-
$c = ('bcdfghjklmnpqrstvwxyz' -split '')[1..21]
$v = ('aeiou' -split '')[1..5]
foreach($l1 in $c) {
	:set foreach($l3 in $c) {
		foreach($l2 in $v) {
			if(!$word.CheckSpelling("$l1$l2$l3")) {
				continue set
			}
		}
		"$l1 $l3"
	}
}

And the results:

b g (bag, beg, big, bog, bug)
d g (dag, deg, dig, dog, dug)
h t (hat, het, hit, hot, hut)
m d (mad, med, mid, mod, mud)
p p (pap, pep, pip, pop, pup)
p t (pat, pet, pit, pot, put)
s p (sap, sep, sip, sop, sup)

Only 7 consonant pairs, or 1.6% of all consonant pairs, have the every-vowel-makes-a-word property according to Word. Even 7 is generous, as there are a few words that it claims are valid that I don't agree with.

Use the Force

October 15, 2012

A serious conversation overheard at work:

Person A: "I'm using the Force to update the name of this sysif."

Person B: "You can't just use the Force to do that!"

(Related.)

Mass Effect 2 Mouse Wheel

September 29, 2012

For some inexplicable reason¹, BioWare decided to not include support for the mouse wheel when scrolling through menus in Mass Effect 2. Here's an AutoHotkey script that will partially enable mouse wheel scrolling.

It works when scrolling through menu entries (Journal, Codex, etc). It does not work scrolling text boxes, such as the details that appear when you select a Codex entry. A pity, but it's better than nothing.

#IfWinActive, Mass Effect 2
SetKeyDelay, 0, 50
WheelDown::Send {Down}
WheelUp::Send {Up}


(Related: whee!)


¹Read: Lazy PC port

Gigabytes Per Tablespoon

September 18, 2012

Google's search bar is quite versatile. Besides returning (usually) relevant content from all over the Internet, it can act as a calculator, give you your public IP address, and perform unit conversions. For example, how many megabytes are in a terabyte?

...Wait, what?

I suppose there's not really a standard unit for measuring data per volume. Myself, I prefer to measure it in Libraries of Congress per bushel.

(Google does get it right if you capitalize the units.)

(I'd also like to point out that Windows Powershell has none of these problems.)

What if I had a blog?

August 10, 2012

GOOD QUESTION! Let's find out.

Why? I'm not too sure myself. I'm not foreseeing myself stunning the internet with my brilliant, insightful comments on current events or offering sage yet witty advice that will leave the masses hanging on to my every word. In fact, your guess as to what (if anything) will end up here is as good as mine!

Prediction: After the initial flurry trickle of posts, there will be approximately one post every four months.

Prediction: Each post will get precisely zero comments, for two reasons: (a) not many people will stumble across this little corner of the web (and if you're one of them, I would advise escaping as quickly as possible while you still can), but mostly because (b) I haven't coded a comment system.

(also FIRST POST)