Work

xrayspx's picture

Power Strip Pro-Tip

Music: 

Future Sound Of London - We Have Explosive

With the massive Retro Youtuber explosion going back even before Covid, I've been yelling to the void about "you need a real screwdriver". Thankfully a couple of rounds of iFixit & Linus sponsorships have gotten this point across :-) And now all those LTT screwdrivers have the delightful whiff of awkward about them. (Bias: I've had Snap-On since like 1997)

I think the next tool for home gamers should be power strips. No one ever thinks of power strips except maybe to mount a super long one over their bench.

I want to buy the world a TrippLite:



I've got these everywhere, but they're great on the bench. A lot of time you'll see Youtubers plugging a whole power strip in special just so they have a switch they can throw at a safe distance to turn on a machine (don't daisy-chain power strips kids!). I have test power cables spooled well away from the power strip just in case I want to cower at a safe distance when powering something up. The neon switches make it super obvious if the thing you're working on is powered or not at a glance:

Pair them with a bunch of 1' extensions and you can tidy up and add physical switches to all your awkward-sized wall warts or to move a plug closer to your work surface. I often have two velcro'd to my lamp:

We also have them in the living room so we can quickly power on & off a bunch of vintage computers and consoles and the LiteBrite and bling and stuff.

They're high quality and they're fast. Eaton/TrippLite has the same $25,000 damage warranty they put on their UPS products.

Next up: Desk Lamps!

*** *IMPORTANT SAFETY TIP* I don't use these on a bench through a UPS, they go straight into the wall. IMHO it's a super bad idea to have UPS power backing up something like a power supply you're testing on the bench! (there are stories here) ***

xrayspx's picture

Have some content

Music: 

It seems like I really don't write very much, but that's kind of a massive misconception. I don't write "much", but I had a bunch of blog entries that were at least 60% written and were missing like, screenshots or links or tags or I need to make new tags for things like XScreensaver and BSDs. Haiku. Shit lots of stuff.

xrayspx's picture

Cinnamon Needs To Get Their Shit Together

Music: 

Eddy Grant - Electric Avenue

I'm a KDE user. I like having my ultimate control over look & feel, even though in almost every sense I'm a "leave it default" guy. But I have a nice MacOS-ey theme, handily and easily-ish customized for the proper Green on Black color scheme which is one of 1.25 acceptable palettes (amber on black):

PICTURE

Note things like the Strawberry media player window and the Dolphin windows, these will be important at probably some future date.

xrayspx's picture

Thanks Again AT&T

Music: 

-- this was an email I wrote but I just pasted it here instead so it's...emailey

I just totally assumed that this is exactly what happened and started writing, but then I looked it up and I'm really happy that reality is exactly how I imagined it.

In 1922 AT&T standardized the 19" rack with 1.75" RU modules, generally now 42u or 45u high, but obviously, sky's the limit with those early switches.

But there were admins, just like me, in the '20s and '30s who now supported literal TONS of hardware in 19" racks bolted to their floor. Oh, new smaller super switch comes out? Good. Fits my 19" racks, thanks AT&T.

Then one day, hey, who're these IBM guys rolling shit in here?  What is that some calculator doodad?  Yeah, whatever, 19" racks, bolted to my floor. Figure it out.

Oh it's the '40s and you're building some whiz-bang tubemajigga to make your bombs boom bigger. Yeah take your insane death machine and get it in the 19" racks bolted to my floor.

That's not to say that IBM and DEC didn't build shit that didn't fit in a rack, but they at least respected the aisle depth and their cabinets were often just extra-roomy 19" racks bolted together. A lot of times I think the internal components bolted into internal 19" racks. *

'90s? Where'd these DotCom weenies come from and why did they just rent the whole datacenter? They're building their shit into desktop machines? Who fuckin' cares, make 'em cram it in that 19" rack.  **

I just love that AT&T did that, and that generations of asshole Operations Guys like me have made everyone adhere to it for 100 years.

Let's hope Skynet gets why it's trapped in 19" racks forever.  Sorry, assholeGPT I don't make the rules. ***

 

* There was a small IBM zSeries that was constantly in my way at C&W in Bermuda. I would alternate between tripping over it and using it as a standing desk and storage rack. I don't know what bank owned that stupid thing but I'm sad to say I never spilled anything in it.  There was a very leaky AC duct right in front of that machine that I always wacked my head on too, so it totally would have looked like an accident.

 

** I did this.  Some customer of mine in 2000 rented /open/ rack space like by the RU from what was at the time Boston Datacenters, in the Charlestown Hood plant.  That was some sketchy as frig shit.  Literally their two stupid desktop machines with their beta version PCI card based load balancers.  Phobos.  Utah.  I think.  Look it up.

 

*** Just occurred to me writing that that I literally watched Jeeves get shot in the face and dragged out behind the dumpster.  There were several dozen racks one week, all gone the next from AT&T in Billerica.  Matlab was also there with racks and racks of Xserve's.  Wonder how that investment paid off.  I think it was all for QA automation running lots of desktop instances or something.

 

 

xrayspx's picture

And you wanted to be my latex salesman

Music: 

For a brief moment I considered wiping one of these decommed Netscalers and using it to replace a Raspberry Pi for "around the house" tasks.

Well not with a sound like that mister. You're going back in the barn:

xrayspx's picture

Two Step Remote Assistance Tool

Music: 

My mom has a Mac, and occasionally something will fuck up in a way that is best fixed by me having some control over her machine.  I had one of those cases last week and it was embarrassing that there was no good way for me to get remote access.  Google Meet doesn't cut it, but there's a whole other Chrome Remote Desktop app, but that was a lot of hoops to install and gave up any hope of walking my mother through the install process.

xrayspx's picture

Linux Needs To Be Ashamed

Music: 

I'm a 25 year Linux user, 22 as my primary desktop. I like pain, and that's OK. But do I consider myself any kind of "expert"? No.

xrayspx's picture

Search for Certificates on Windows Systems

Music: 

Nine Inch Nails - Broken

Here are a lot of words about what's essentially a one-line CMD + Powershell script...

I've recently run into a situation where a trusted root certificate authority certificate was missing from several Windows systems in multiple locations and domains. This was causing an issue with automation which reached out to a site which had a certificate signed by that CA. I can see a good use case for this if an organization has their own CA and needs to verify that all endpoints have that CA certificate in their trust store for example.

xrayspx's picture

Mac Classic - First Impression

Music: 

"Works As Intended" they said....

Unless Craigslist Guy was using a sharpie to play tic-tac-toe on the wavy checkerboard screen, we have different definitions of "intended".

Of course if the intention is that we have a project now, well then Mission Accomplished. Replacement caps are on the way. The board itself looks totally clean aside from the standard nicotine layer gooped everywhere, but no visible corrosion or damage.



xrayspx's picture

Lattice of Convenience - MP3 Playlists

Music: 

Underworld - Kittens

Hopefully everyone can live in the future someday.

We do a lot with MP3 playlists. I run Airsonic for streaming around the house and in the car, and we have a playlist-based FM transmitter setup, etc. So I have scripts which run every night and generate playlists based on star ratings and other things (GET THE LED OUT ANYONE?).

Previously what I've done is dump the contents of a bunch of Smart Playlists in Clementine to a file and use those files to generate the randomized 200 track daily playlists. The downside to that is that every time I add music or change star ratings, I'd have to refresh these "base" files like some kind of animal. I had base playlists for "3+ stars", "4+ Stars" and "5 Stars", among others.

Today I decided to fix all that. Clementine uses a SQLite3 database, so now I'm just querying it instead, and it seems to be working well. For example, my "5 star" playlist in Clementine results in 10800 or so tracks. The same one built from the DB ends up with a couple hundred more tracks, but is pretty close. I'm not entirely sure what the difference there is just yet, but "close enough". What it looks like to me is I probably need to enable Samba case sensitivity.

The DB records ratings as decimal numbers from 0.0 (Zero stars) through 1.0 (5 Stars). So to build a "4-Star +" playlist, searching for rating >= "0.8", you get ratings like this:

1
1.10000002384186
0.800000011920929
0.800000011920929
0.800000011920929
1.10000002384186
1.10000002384186
0.800000011920929
0.800000011920929
1
1
1
1

! Caveat: Prior to Clementine 1.4.0rc1-533-gf4e70face there was a bug where it was possible to give a song a higher than 5 star rating (higher than 1.0 in the DB) as you can see above, so know that if you have Clementine from the repositories, it's likely you have that bug. For instance in the UI, if you want to show all 5 star songs, use "Rating is Greater Than 4.5 Stars" rather than "Rating is Equal to 5 Stars".

Now I can just have a cron job to copy the master Clementine DB once a day to my server and drop it in next to the playlist generation scripts.

The downside to all this is speed. When using the Clementine-Generated base playlists, I could be sure all the files actually exist on disk. However while Clementine will only show you files that exist in the UI, it doesn't seem to do a very good job of cleaning the database of stale files which no longer exist. So if you move or rename files, the old DB entries stick around unless you purge it completely and start over from scratch. That means I have to test every single file as I add it to the playlist, which takes time. It takes about 5-8 seconds to generate my 200 track 5-Star M3U file.

The 5-Star.sh script is below if you'd like to play along at home:

  


#!/bin/bash

rm /Volumes/Filestore/CDs/playlists/5\ Stars.m3u

i=1

while [ $i -le 200 ]
do
 file=$(sqlite3 ./clementine.db "select filename from songs where rating > "0.9" order by random() limit 1;" | awk -F "file://" '{print $2}')

 ### Clementine data encodes special characters and accent marks and stuff so I'm using
 ### Joel Parker Henderson's urldecode.sh to undo that: https://gist.github.com/cdown/1163649
 
 data=$(urldecode.sh "$file")
 if [ -f "$data" ]
 then
  ### Have to escape leading brackets because grep treated it as a range and would allow duplicates ###
  ### Can't do that in "data" because \[ isn't in the filename so they'll fail ###

  escaped=$(echo "$data" | sed 's/\[/\\[/g')
  #echo "$escaped"

  ### Avoid duplicates
  match=$(grep -i "$escaped" /Volumes/Filestore/CDs/playlists/5\ Stars.m3u)
  if [ -z "$match" ]
  then
   echo "$data" >> /Volumes/Filestore/CDs/playlists/5\ Stars.m3u
   ((i++))
  fi
 fi
done

For the 3+ and 4+ lists, I repeat this main block, but instead each rating dumps into a text file that I randomize into an .m3u at the end. So for the 3-Star + script below, I collect 130 5-star tracks, 45 4-star, and 25 3-star, push them out to a temp file and then cat temp.m3u | sort -R > "./3 Star +.m3u". I could do all this by creating a new table in the database and stuffing tracks into that, but this was faster for me to write and it works well enough:


#!/bin/bash

rm /Volumes/Filestore/CDs/playlists/3\ Stars\ +.m3u

i=1

while [ $i -le 130 ]
do
 file=$(sqlite3 ./clementine.db "select filename from songs where rating > "0.9" order by random() limit 1;" | awk -F "file://" '{print $2}')

 ### Clementine data encodes special characters and accent marks and stuff so I'm using
 ### Joel Parker Henderson's urldecode.sh to undo that: https://gist.github.com/cdown/1163649
 
 data=$(urldecode.sh "$file")
 if [ -f "$data" ]
 then
  ### Have to escape leading brackets because grep treated it as a range and would allow duplicates ###
  ### Can't do that in "data" because \[ isn't in the filename so they'll fail ###

  escaped=$(echo "$data" | sed 's/\[/\\[/g')
  #echo "$escaped"

  ### Avoid duplicates
  match=$(grep -i "$escaped" ./3-star-tmp.m3u)
  if [ -z "$match" ]
  then
   echo "$data" >> ./3-star-tmp.m3u
   ((i++))
  fi
 fi
done

i=1

while [ $i -le 45 ]
do
  file=$(sqlite3 ./clementine.db "select filename from songs where rating >= "0.8" and rating

  ### Clementine data encodes special characters and accent marks and stuff so I'm using
  ### Joel Parker Henderson's urldecode.sh to undo that: https://gist.github.com/cdown/1163649

  data=$(urldecode.sh "$file")
  if [ -f "$data" ]
  then
   ### Have to escape leading brackets because grep treated it as a range and would allow duplicates ###
   ### Can't do that in "data" because \[ isn't in the filename so they'll fail ###

   escaped=$(echo "$data" | sed 's/\[/\\[/g')
   #echo "$escaped"

   ### Avoid duplicates
   match=$(grep -i "$escaped" ./3-star-tmp.m3u)
   if [ -z "$match" ]
   then
    echo "$data" >> ./3-star-tmp.m3u
    ((i++))
   fi
  fi
done

i=1

while [ $i -le 25 ]
do
  file=$(sqlite3 ./clementine.db "select filename from songs where rating >= "0.6" and rating

  ### Clementine data encodes special characters and accent marks and stuff so I'm using
  ### Joel Parker Henderson's urldecode.sh to undo that: https://gist.github.com/cdown/1163649

  data=$(urldecode.sh "$file")
  if [ -f "$data" ]
  then
   ### Have to escape leading brackets because grep treated it as a range and would allow duplicates ###
   ### Can't do that in "data" because \[ isn't in the filename so they'll fail ###

   escaped=$(echo "$data" | sed 's/\[/\\[/g')
   #echo "$escaped"

   ### Avoid duplicates
   match=$(grep -i "$escaped" ./3-star-tmp.m3u)
   if [ -z "$match" ]
   then
    echo "$data" >> ./3-star-tmp.m3u
    ((i++))
   fi
  fi
done

cat ./3-star-tmp.m3u | sort -R > /Volumes/Filestore/CDs/playlists/3\ Stars\ +.m3u

rm ./3-star-tmp.m3u

Pages

Subscribe to RSS - Work