Showing posts with label Tech. Show all posts
Showing posts with label Tech. Show all posts

Wednesday, May 4, 2022

Weird Issues After Upgrading to Debian Bullseye

Edited to add: "hey, it's been sooo long since I posted, how weird is that, amiright?" I fucking hate computers. But god bless search engines, because I'd never be able to get shit done on my home machine without them. I can't remember if I've posted about my first foray into running Linux at home back in 1998 or 1999, but even without Laurie saying she hated it because she had no idea how to use anything on the desktop, it was a massive pain in the ass for ME. 

It's still a pain in the ass sometimes, but now I have a magical electronic hive mind to use as reference instead of massive, poorly written book authored by a dude who smelled like musk and Cheetos cheese. 

Anyway, I'm adding MY two cents to the magical electronic hive mind of knowledge. I can promise you I only smell of Tide, sandalwood & pomegranate (the fancy way of saying Axe Anarchy deodorant), and Dr. Bronner's almond soap. 

I'm also going to crank this out as quickly as I can while it's still fresh in my memory, so ignore any grammatical gibber jabber and technical wonkity woohahs (e.g. jargon) that I may flesh out at a later date. 

So...I decide I'm finally going to fix my dual boot issue on my home machine. I can't use GRUB to get into the Win10 NVMe disk ("Invalid Signature") I added last year so that I could play a Cyberpunk 2028 and Witcher 3 (both of which I've played literally twice, haha...what a waste of $$.) Anyways, I've been putting off fixing what I though was wrong. I finally took a look yesterday and figured "hey, if I'm mucking around in this shit, I might as well finally update from Buster to Bullseye.)

I do a bunch of stuff, mostly following the instructions from Debian's site, and things are looking preeeetttttty okish. I start mucking around with what I think I need to do to fix GRUB ("hmm, well UEFI IS already setup for Win. Secure boot isn't enabled. OOOHHH, ok. Well, fuck.") and realize that the reason GRUB is that my fucking Linux partition is setup as MBR and not GPT because even though it's running on a pretty modern and fancy SSD, 

I wasn't paying attention when I upgraded from my 10ish year old hard drive and basically just continued to use a partition scheme that's almost old enough to have it's own Judd Apatow movie (This is 40...come on.) OK. I'll stick with switching disks at boot time in BIOS for now. But hey, I'm upgraded! Everything is great! 

Ron Howard Voice: "Everything was not great."

I opened Spotify this morning to get some motivational tunes going and it's just a black screen. Well shit. Do some hive mind searching with no luck--if you think it's tough troubleshooting general Linux issues (hello, 11 year old forum posts!) try doing it for a specific application, even one as widely used as Spotify. SURE, I could use my phone's Spotify client to stream to my office speaker, but then it eats up my battery. Anywho, the Linux forum on Spotify's site is sometimes useful, but not today. I try opening it via command line to see what's up and this is what I get: libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null) Very helpful! I try uninstalling/reinstalling Spotify and it's the same shit. 

I start looking for troubleshooting libva error shit. Well, i must be missing the libva packages from the upgrade. Yes sir--let's apt-get that shit and, well it's installed and the lasted version. OK, I should use vainfo to check versions? Well, I dont' fucking have that anymore. Ok, let's install. Hmm, ok--that looks like what I should see. Check chrome://gpu (edge for me, homie) to see what's up? Done. Looks fucking fine. Is xorg.conf right? Uh, yes. lspci | grep VGA? YES IT'S THE RIGHT MOTHER FUCKING DRIVER. aaaaaaaaaaaaaaaaaaaggggggggggggggggggggggggggGG. 

Ok, let's try some basic Spotify troubleshooting. Well, yes--aplay is recognizing my sound cards. And wow, starting it on command line with a log dump was SOOOOO helpful. I know have a single line text file that says "libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)

That's some very NEW and super helpful information. Ok, let's try playing the test audio file...but first, looks like i need to raise my speaker volume. 

Hmm, why am I not getting that annoying gnome bubble pop. 

Hmm. Why isn't there a fucking output device in Gnome Settings. 

 *Sigh* More googling.


And I come across a Reddit post of something not entirely dissimilar from my audio issue that was resolved with a reboot, but one of the comments talked about grep'ing dmesg for firmware shit. So let's try that: sudo dmesg | grep firmware and hmm..."Unable to load firmware rtl_nic/rtl8168h-2

I've been seeing that shit since last year after a kernal update and I've been ignoring it because my NIC card has been working fine. But ok, let's try to fix that.  Back to the keyboard and well, hello 11 year old AskUbuntu post, haha. 

It wasn't exaaaaacccttttlly the complete answer, but close enough for me to run sudo apt-get install firmware-realtek and then sudo apt-get install firmware-realtek and then reboot and voila..EVERYTHING FUCKING WORKED AGAIN. 

Fucking audio drivers for both speakers and HDMI, missing web cam, missing mic, and of course, missing video driver that caused Spotify to not load. 

I fucking hate computers.

Keywords: Debian, Bullseye, Spotify, Linux, libva, Spotify black screen after upgrade, computers are the debbil.

Saturday, November 24, 2018

permissionerror: [errno 1] operation not permitted: 'lib' ->

In today's episode of dumb shit that made me write a blog post...

I finally got around to trying to figure out why I couldn't create a virtual environment (venv) using Pycharm for my Python class project folder.  I keep it on a USB drive because I do some work on it both at home and on my work laptop (when I'm not working through lunch, natch.)

Anyway, I kept getting the following error:  permissionerror: [errno 1] operation not permitted: 'lib' -> (and then the path to a symlink to lib64.) 

I figured it was an issue with my locked down work laptop, so I just kept manually navigating to a local python interpreter at work.  I said I'd get around to fixing it when I got home.  But low and behold, same shit at home. 

I tried manually running the command that PyCharm uses so that I could "sudo" it (thinking it was a permissions error.  That simple solution, of course, wasn't the issue.

The error is ACTUALLY caused by the fact that my USB drive was FAT32.  For some reason (beyond my knowledge level) you can't create symlinks using FAT32.  The fix is to reformat your drive into something that's a little more modern.

Since I need to use this drive on both my work machine (Win10) and home (Debian), I went with NTFS.  Wango, bango I was able to install the new venv on the USB drive on the first go after I had reformatted the drive.

Luckily, I had recently started using a sync tool called Unison to keep my USB drive synced up with my desktop due to a catastrophic loss of my drive data (during Finals week of my last Python course) that was caused by my wife putting a little percussive force on the door of my desk while trying to move a carpet.  Snapped a few pins off of the drive connection to the board that my shitty, shitty soldering skills couldn't fix.  But, it had the positive effect of getting me to finally start backing my shit up properly, haha.

So, if you too are having a problem setting up a venv on a thumb drive, fix that FATfuck32 drive and you'll be ready to rock.

Monday, July 30, 2018

Converting Picasa XMP Face Tags to Usable Exif Metadata Tags


Is this the future?
2022 already?

I guess I finally broke the delayed post pattern now that I'm finally finding a good use for this thing--psuedomemory for the technology shit I always forget about.  I spend half my life trying to Google shit I Googled five years ago (and again three years ago, and again eighteen months ago...)  Bookmarking pages hasn't really done me any good, because I forget that I bookmarked a site (and also because there are times I find the bookmark, but can't remember why I saved it, haha.)

So today's episode of "Chris' only reason to post an entry on this elderly blog" is brought to you because I have like 15,000+ pics that aren't really organized.  Back when I used Windows, Picasa made things easier because of the face tagging technology.  If you wanted to find a pic of a certain person, you could just click their name and voila, you were good to go.

However, Picasa typically writes those tags to an internal DB and not to the images themselves.  There's a way to get Picasa to do that, but it writes them to a weird XMP field that isn't typically used by any other photo organizer.

I'm using Debian and GNOME as my desktop environment, so I'm using the default image manager that comes with the distribution.  Unfortunately, it does not use XMP tags for organizing or searching, so I was basically stuck trying to find some way of migrating those Picasa XMP face tags (mwg-rs: Regions/ mwg-rs:RegionList[1]/mwg-rs:Name) into something that another application could search.

The solution is actually really easy to use, but the hard part was actually finding it!  Google searching was a little wonky and the results weren't all that clear.  I finally found this post in the Exif forum, but if you didn't phrase your search terms precisely that way, you'd never find it.   Here's my useless search history:

shotwell search xmp
mwg-rs:Name to exif tag
mwg-rs:Name
linux photo program that can read xmp face
how to search xmp tags 

The post I linked to above was exactly what I needed and it actually was super easy to do.  It's literally one line, assuming all of your photos are in a hierarchical directory.

Here's a video walk-through of how to make that happen:


It only took around 20 minutes to run through about 17,000 files in 254 directories.  Not too shabby!

Here are some links to the stuff that powered today's post (all excellent, Open Source projects)

ExifTool by Phil Harvey- "a platform-independent Perl library...for reading, writing and editing meta information in a wide variety of files."

Shotwell- A digital photo organizer designed for the GNOME desktop environment.

Kazam Screencaster- The screen recording software I used to record the above video.

Monday, July 23, 2018

ComicTagger Error StrpTime


Long time, no see/speak/etc.    You can thank an annoying, seemingly obscure technical problem I ran into for breaking my 42 months of blog silence.  These hiatuses (yatus #bigbrother) seem to be getting longer and longer over the years.

So anyways, I decided to try to organize my electronic comic book collection yesterday and installed a program called ComicTagger, which helps grab and write metadata for comic books.  

I get it installed and ran into my first problem right off the bat.  The application wants you to put in the path to WinRar (or any RAR/UnRAR program) but the little tool you use to navigate through your filesystem doesn't actually navigate anything.  It'll open the box and show you your root folder, but none of the contents.  The workaround for that was to just manually type in the path.  Since I'm running Linux, my path was "/usr/bin/rar" and "usr/bin/unrar"

Problem solved!  Let's get to tagging comics!  I drag and drop a file over to test and wait.  And wait.  And wait some more.  The dialog box that popped up is just sitting at 0% for a few minutes before I realize that there's an error in the terminal window and I'm stuck.  Here's what I see:

Traceback (most recent call last):  File "/usr/local/lib/python2.7/dist-packages/comictaggerlib/taggerwindow.py", line 540, in dropEvent    self.fileSelectionList.addPathList( self.droppedFiles )  File "/usr/local/lib/python2.7/dist-packages/comictaggerlib/fileselectionlist.py", line 196, in addPathList    row = self.addPathItem( f )  File "/usr/local/lib/python2.7/dist-packages/comictaggerlib/fileselectionlist.py", line 271, in addPathItem    if ca.seemsToBeAComicArchive() :  File "/usr/local/lib/python2.7/dist-packages/comictaggerlib/comicarchive.py", line 618, in seemsToBeAComicArchive    ( self.getNumberOfPages() > 0)  File "/usr/local/lib/python2.7/dist-packages/comictaggerlib/comicarchive.py", line 775, in getNumberOfPages    self.page_count = len( self.getPageNameList( ) )  File "/usr/local/lib/python2.7/dist-packages/comictaggerlib/comicarchive.py", line 751, in getPageNameList    files = self.archiver.getArchiveFilenameList()  File "/usr/local/lib/python2.7/dist-packages/comictaggerlib/comicarchive.py", line 395, in getArchiveFilenameList    for item in rarc.infolist():  File "/usr/local/lib/python2.7/dist-packages/comictaggerlib/UnRAR2/__init__.py", line 127, in infolist    return list(self.infoiter())  File "/usr/local/lib/python2.7/dist-packages/comictaggerlib/UnRAR2/__init__.py", line 122, in infoiter    for params in RarFileImplementation.infoiter(self):  File "/usr/local/lib/python2.7/dist-packages/comictaggerlib/UnRAR2/unix.py", line 171, in infoiter    data['datetime'] = time.strptime(fields[2]+" "+fields[3], '%d-%m-%y %H:%M')  File "/usr/lib/python2.7/_strptime.py", line 478, in _strptime_time    return _strptime(data_string, format)[0]  File "/usr/lib/python2.7/_strptime.py", line 332, in _strptime    (data_string, format))ValueError: time data '2006-03-29 18:32' does not match format '%d-%m-%y %H:%M'
The highlighted section is the actual error.  There's nothing about this on the project Github site, the Google site the code was originally housed on, or the application's web forum.  NOTHING.  There is literally one post on an Ubuntu forum where a dude asks about the issue in 2016, but no one ever responded!  And if he ever discovered the fix, he didn't post it in that thread.  DON'T EVER DO THAT.  If you fix your own problem, update the fucking thread!

Anyway, I DID figure out a fix and I decided to post it on my blog, so if anyone else runs into the problem, it's a 30 second fix and not hours of googling like a moron (me!)  I should've just sat down and worked through the problem like I finally did this morning. It took me about 45 minutes and 25ish minutes of that was trying to find and install a text editor that had line numbers on it, haha.  I tried Sublime and it wasn't.  Now I know why the editor war has been ongoing for over 30 years.

In this case, ComicTagger is choking while trying to strip out and reformat the date it finds in my CDisplay RAR Archived Comic Book (CBR) file.  It looks like the (or A) programmer hardcoded the date format as %d-%m-%y %H:%M, which is Day-Month-Year (two digit) Hour:Minute (Military format.)  However, it looks like the file date that was getting pulled from my CBR files were in YYYY-MM-DD HH:MM. The strptime Python module was throwing up an error because the date that was getting passed to it wasn't matching. 

Here's the fix:  I went into /usr/local/lib/python2.7/dist-packages/comictaggerlib/UnRAR2/unix.py and edited line 171 to reflect the actual format that was needed:

data['datetime'] = time.strptime(fields[3]+" "+fields[4], '%Y-%m-%d %H:%M')
There you go.  Now I've wasted another 90 minutes writing this up. I hope you appreciate all that I do for you!

See you in 2022, bitches!

Tuesday, January 6, 2015

Automatically using the Multipurpose Feeder on a Dell B2360DN Printer

Why is this like sacrificing a goat to an angry and judgmental dark lord?  All I wanted to do was be able to print stupid UPS shipping labels without a lot of hassle.  I want the print from the Multipurpose Feeder if there's something in the slot, but from the tray if not.  Automatically.  But, the default setup on my Dell B2360DN printer makes that impossible.  Sure, I could just load up my Tray 1 with all those free, delicious UPS labels, but then I still have to manually tweak something when I send a regular print job.  
RTFM?  Not anymore.  Dell's documentation is shit.  But it can be done! It’s a multi-step process that I’ve pieced together from a few different forums and a bit of dicking around.
After these changes, I can now just send a print job to the printer and unless I shove something into the Multipurpose Feeder (MP Feeder) it’s going to route out of Tray 1.  If I want to print one of my UPS labels, I just stick it in the MP Feeder and the B2360DN will THAT instead of the paper out of Tray 1.  You know, like pretty much every other printer I’ve owned has done out of the box.  But no judgments, Dell.
  1. Front of B2360DN
    Change the default MP Feeder settings in the Diagnostic Menu:
    1. Power off the printer
    2. Hold the OK and left arrow key
    3. Switch the printer on
    4. Release the keys once the amber light comes on
    5. Scroll through the Diagnostic menu using the right arrow.
    6. Select Printer Setup
    7. Select ENGINE 2 (push the right arrow 5 times to reach this option)
    8. Change ENGINE 2 setting to 8* and press OK
    9. Press the return arrow key to return to the Diagnostic Menu
    10. Press the left arrow to select EXIT DIAGNOSTICS
    11. The printer will reboot
  2. Change the Default Source and Paper Type for the Multipurpose Feeder
    1. Press the Wrench key to reach the Admin Menu
    2. Press OK to reach the Paper Menu
    3. Press OK to select Default Source
    4. Press the right arrow to select MP Feeder and press OK
    5. Press the right arrow to reach the Paper Size/Type Menu and press OK
    6. Press the right arrow to select MP Feeder Size and press OK
    7. Select Letter and press OK
    8. Press the right arrow to select MP Feeder Type and press OK
    9. Select Plain Paper and press OK