Category Archives: HOWTOs

How to hide Tumblr likes from certain users with AdBlock

You know the ones – those Tumblr users who just can’t get enough of your style or “aesthetic.” (What would you call them? “Tumblr groupies?” Maybe. “Tumblr crushes” implies mutual lurve of curated content, not one-sided pining.)

They “like” every post you make and reblog a lot. But the liking. The compulsive heart-clicking. You weary of it.

Anyway, say you actually do like the user, but you just want to hide their 20 million clicks of the “heart” button from clogging up your activity page AND your activity quickbox from the Tumblr dash. Well, now if you’re an AdBlock user, I have some rules for you that work as of October 2015!

This solution is great because you’ll still see the user’s posts, asks, reblogs, and all that. Only the likes will be blocked with AdBlock. This should work on AdBlock Plus and AdBlock Pro without any or much modification, but I haven’t tried it on those.

Let’s pretend we’re going to block a user named noisyuser. Without further ado, here are the rules and instructions on how to paste them into AdBlock!

Copy these rules into your clipboard:

    www.tumblr.com##DIV.ui_note.is_like[data-tumblelog-name="noisyuser"]
    www.tumblr.com##DIV.like[data-tumblelog-name="noisyuser"]

And, if you’re particularly annoyed, you can hide their avatar from your “top 4” bar on the activity page with this rule:

    www.tumblr.com##A.ui_jumbo_avatar[title="noisyuser"]

Now, click the AdBlock icon in your browser menu bar. Click Options, click Customize at the top (this may differ in other flavors of AdBlock), and then click Manually Edit Your Filters. Click Edit on the bigger list – make sure you don’t click edit on the Disabled Filters list.

Now, paste the above rules at the bottom of the Filters list.

IMPORTANT: CHANGE THE USERNAME noisyuser to the tumblr username of the person whose likes you want to hide, THEN click save.

Presto – a single refresh of your Activity page or Dash should hide all the likes you don’t want to see, while allowing reblogs and other notifications through.

Linux users on Apple machines: how to find the system product name of your Mac

Here’s another nugget I’m dropping in the hopes it’ll get indexed, because I have a hell of a time remembering how to find my Apple Mac type in Linux (where by type I mean things like “Macbook4,1” or “iMac6,1” and the like). Finding the exact model of Mac you’re running is often useful when debugging the all-too-frequent rough edges of Linux running on a Mac.

Be advised, I’ve only tested this in Linux Mint. I expect it will probably work fine in Ubuntu and likely Debian.

In Terminal or on the command line, to find what model Mac you’re running Linux on, simply run

sudo dmidecode -s "system-product-name"

Removing Google Plus pollution from Google News with AdBlock

For those of you still clinging to Google News like I am – mainly because you have neither the time nor the energy to make a user stylesheet to give Yahoo News a decent UI – you’re probably vexed with the continuing incursion of Google+ effluent into what is supposed to be a news site.

I’ll try to condense the obligatory Google Plus rant down real small this time: I DO NOT CARE ABOUT GOOGLE PLUS.  I WILL NOT USE IT.  STOP PUTTING IT IN MY NEWS, OR ANYWHERE ELSE FOR THAT MATTER. IT’S NOT POLITE TO POOP IN PUBLIC.

Since Google doesn’t care that nobody wants Google+, the above isn’t likely to happen, so I’ve temporarily solved the problem by blocking useless crap from Google Plus by using Adblock in Chrome. Similar techniques work for the various Adblocks in various Browsers; usually you can right-click on a steaming pile of content you don’t want, then click the AdBlock context menu, then (here’s the trick) click “Block an ad in this page,” and not “Block this ad.” Once you do that you can mouse around until you’ve highlighted the steaming Plus pile and left the rest of the content relatively intact, and add that rule to Adblock.

So far, here’s the only rule I’ve needed to de-Plus Google News for myself:

news.google.com##DIV[class="gpost-bubble"]

Enjoy. I’ll try to keep the above ruleset updated if I find myself needing to add more before I can replace Google News as I’ve replaced GMail and Google search. (I’m taking suggestions on replacements for News, Docs aka Drive, and Voice – the latter I’d happily pay for.)

Maybe someday I’ll get around to writing some user stylesheets that A) block Google Plus garbage from most other Google properties, and/or B) give similar services like Yahoo News a tolerable UI. Don’t hold your breath on either, though. I don’t have enough time for B, and A would require me to continue using Google properties when I am actively trying to disentangle myself from them as fast as possible.

Remember, Google, nobody wants to come to your obnoxious nerd tumbleweed party.

Installing the Heroku Toolbelt on a PowerPC Mac running OS X

So you’re still using a PowerPC Mac, and you need to deploy some stuff on Heroku. (Yes, that combination of traits exists, I’m living proof.) Tigerbrew is a lovely PowerPC port of Homebrew for OS X (and it mostly works on Leopard, despite the name). PPC holdouts cannot thank Misty De Meo enough for all her work on it, but as of this writing, heroku-toolbelt doesn’t work out of the box.

Actually, because of this writing and because of Misty De Meo’s awesome bug-squashing prowess, this now does work out of the box, and automatically compiles the necessary version of Ruby for you as well; be prepared for a long wait while it builds, at least on slower Macs, but it works!

Here’s how to install heroku-toolbelt on your old PPC Mac running OS X 10.4 or 10.5.  You will need to be comfortable with the terminal, of course.

The build infrastructure

This post assumes that you are familiar with Homebrew and that you can get Tigerbrew installed on your Mac on your own.  It’s not too bad.

Install heroku-toolbelt

$ brew update     # do not skip this esp in Tigerbrew
$ brew install heroku-toolbelt

Sweet, after like 2 hours on a 1.25GHz G4, we’re done!  Run heroku and make sure that it prints some useful output, and not the following.

$ heroku
-bash: /usr/local/heroku/bin/heroku: /usr/local/heroku/ruby/bin/ruby: bad interpreter: Bad CPU type in executable

If the above does happen, you may have a rogue installation of heroku.  Do a which heroku, find it, and delicately delete it, then try again.

GMail, y u no accept SMTP AUTH from Exim? Plus: app-specific passwords for your Exim4 satellite.

First, let me start off by saying I don’t have an answer to why GMail throws a “530-5.5.1 Authentication Required. Learn more at http://support.google.com/mail/bin/answer.py?answer=14257“, specifically the “y u no.”  I don’t know.  But I combined several searches into a workaround that appears to be getting mail through, though it’s coming from my GMail username and not the username actually sending mail from the Exim4 equipped Debian box.

Why use GMail as an Exim4 smarthost in the first place?

The most likely use case for doing this is so you can use something like apticron, or otherwise get emails from sad scripts on your doorstop server sent to someplace where you’ll actually see them.  Thus, I’ll assume you don’t care that they appear to come from yourname@gmail.com rather than root@yourbox.localdomain or whatever.  (In my experience with non-gmail Exim “smarthost” setups, emails do appear to come from their proper source.)

There are a couple other reasons to use GMail as an Exim smarthost: maybe you don’t have another email provider yet (though you should, and fully non-US), or maybe you have a great email provider who doesn’t yet support app-specific passwords.

An accurate representation of your life if your real email gets pwned.

To me, app-specific passwords are GMail’s killer app in providing SMTP smarthost service to random Linux boxes that might get pwned eventually.

You do not want your real email password in /etc/exim4/passwd.client.  NO NO NO.  If you are doing that, stop it right now and either use GMail or another provider which supports app-specific passwords, or a throwaway account.  Why?  Because if that machine gets cracked and the cracker gets your real email password?  You’re done.  Game over, man.  Game over.

Best practice for using GMail as an Exim SMTP “smarthost”

  1. For each machine where you do this, set up an app-specific password in the Google account you want to use. You should make a different password for every machine so you can revoke passwords for decommissioned or hacked machines.
  2. Run dpkg-reconfigure exim4-config as root, and set it to be a “smarthost” using smtp.gmail.com::587 as the SMTP server.
  3. Edit /etc/exim4/passwd.client to contain the following (herein lies the magic workaround which I don’t care to research further to explain why it works):

    gmail-smtp.l.google.com:your.name@gmail.com:appspecificpasswd
    *.google.com:your.name@gmail.com:appspecificpasswd
    smtp.gmail.com:your.name@gmail.com:appspecificpasswd

  4. As root, service exim4 restart
  5. Then, you might want to do something to test it, like this 1970s command. Test this as a normal user AND as root, since root often has forwards set up in that dpkg-reconfigure step (or elsewhere, like ~/.forward) that you might need to work on separately.

    mail -s 'lol test subject' some@email.com

    Now, type some stuff, and to send the mail, enter a period by itself on a blank line (I told you it was 70s).

  6. The mail should go through. (If you have problems with root, or with scripts that mail root, sometimes so do I and maybe I’ll come back and update this post.)  Just be aware that greylisting and other anti-spam techniques may cause your mail, especially when Google and your own receiving email provider aren’t “accustomed” to seeing it from this source, to be delayed or marked as spam.  Be patient, and check the spam folder.

 

De-failing the make-jpkg install of Oracle Java 7 JRE on Debian Wheezy (Aug 2013)

So, any surprise this is a clusterf*ck?

Debian has removed Oracle Java from non-free and required the use of java-package to build .debs from Oracle’s binary distributions. More power to ’em; Oracle is considered evil for many good reasons. But, if you do need to taint your system with Oracle’s devilry — and there are plenty of Java apps that say “use the open source Java alternatives at your own risk and tears” — installing it involves dark arts.  Read on.

Update 28 March 2014:  This does not work for Java 8 yet.  Unless you really need Java 8 and you’re sure about that, just install Java 7.  Most applications don’t need Java 8 yet and won’t for a while.  I’ll come back and post a link to an updated guide once I figure it out (and I have to, for reasons).

PROCESS AND PROBLEMS:

First (updated 25 March 2014) you’ll need to install the java-package package. I was informed and subsequently confirmed that this package will not be found unless contrib is present in your /etc/apt/sources.list line, e.g.

deb http://http.debian.net/debian/ wheezy main contrib

Once you make sure contrib is in /etc/apt/sources.list, you can go ahead and install java-package:

# aptitude install java-package

Then, download the Java “tarball” from Oracle’s Download Page, straight outta 2004: http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html

When I did this, I downloaded what the site claimed was jre-7u25-linux-x64.tar.gz.

Once downloaded in my browser — doing so seems impossible in lynx and with wget, at least easily, so I had to download it to my desktop and scp it to my server, awesome, thanks for that — I actually got a file named jre-7u25-linux-x64.gz.

Upon observing that, you might think “that’s a gzip file, maybe wrapping one of those .bin files some of the java-package docs were mentioning.” Nope! It’s a bare tar file but with a .gz extension.  Not even .tar.gz, but .gz.

So, upon figuring that out, you’d gzip it — make-jpkg really expects a gzipped tarball — and re-run make-jpkg.

Nope!!! ‘This does not look like a tar archive.’ So not only did Oracle mislabel the freaking file twice, but whatever XSLT that told their Solaris tar how to pack the archive was clearly borked. (That’s a Solaris joke.)

SOLUTION:

tar xvf jre-7u25-linux-x64.gz
tar cvzf jre-7u25-linux-x64.tar.gz jre1.7.0_25 # make a readable tarball
fakeroot make-jpkg jre-7u25-linux-x64.tar.gz

…Wow.

The free wifi at my business works for some customers and not others. Help!

I’m writing up a fix to a common tech problem I see at coffee shops, cafes, restaurants, bars and other places that offer free wifi.  Hopefully a few business owners might find this by searching and be able to fix their problems with patrons being unable to connect to their wifi.

A typical consumer wifi router

Many wireless routers look something like this. Some have antennas hidden inside. They either plug into your Internet box (cable modem or DSL modem) or straight into your cable or DSL.

Most businesses offering free wireless internet to customers – small businesses, at least, like a corner bistro, a coffeehouse, or a bookstore – often do so with a consumer router. In other words, the exact same type of device that you might plug into “the internet” (cable modem, DSL, usually) in your home in order to get wireless internet.

Cheap broadband routers are a great thing, but they’re designed for homes and small offices – in other words, places where people don’t come and go very much.  In your home, the same laptops, smartphones, and tablets tend to hang around for hours if not all the time.  Routers are often sold with a pre-made setup for this environment, and some of the settings don’t work well for places where people with many devices come and go a lot, such as a coffee shop or restaurant.

The problem

One of the biggest problems I’ve seen time and again with the free wifi offered by small businesses in my neighborhood is when the router runs out of “DHCP leases.” You can think of a DHCP lease as a ticket that the router hands to any computer, tablet, or smartphone that connects to it. The router says “Here’s this ticket; when you need to talk to a web site, show it to me – oh, and it’s only good for 24 hours. Then you need another ticket.”

The problem is that most consumer routers only have about 100 “tickets” to give out. If the tickets are good for 24 hours, some of the routers won’t hand out any new ones until the oldest ticket expires, meaning some customers can connect until the router runs out of “tickets” (DHCP leases) and then other customers can’t connect. It can be even harder to diagnose because regulars who come in every day will almost always be able to connect with the same device, since they’re still holding a ticket from the previous day!

Symptoms

If this is your problem, you’ll most often see that some customers can use the internet fine, and others can’t use it at all.  Many times customers having problems will be able to connect to your wireless, but then the connection will hang, or keep retrying, or give an error message, and they won’t be able to get onto the internet.  If many customers can get to the internet but it’s acting weird, that can be a couple of different problems that are common with consumer routers, and I’ll write about those in a later post.

Solution

The solution to many wifi connection problems in small businesses is to reduce the length of time the “ticket” lasts. Instead of 24 hours, try 10 minutes. This can cause a few problems of its own, but generally they’ll be much less noticeable than problems caused by long DHCP leases.

I can’t give instructions for every router on the market, but if you go into your router’s settings and find DHCP settings, you’ll see something like “DHCP lease timeout,” “DHCP lease length” etc. This may be measured in seconds or minutes, so here’s a handy-dandy translation table:

  • 1 day = 24 hours = 1440 minutes = 86400 seconds. This is too long a DHCP lease expiration for most neighborhood businesses offering free wifi.
  • 10 minutes = 600 seconds. This often works pretty well, especially where customers don’t stay long and the shop is busy.
  • 30 minutes = 1800 seconds. If customers stay longer, or the store, bar, bakery etc isn’t too large or busy, this will also work okay.

Questions and tips are welcome in the comments!