Monday, 11 March 2024

Fitbit Inspire 2 Android Not getting notifications

My Fitbit Inspire 2 was not receiving notifications from Android (Google Pixel 4a). Much gnashing of teeth and fruitless googling later, I went to Settings>Notifications>Privacy-Device & App notifications and Fitbit was under "not allowed". That's not helping, is it?


I find it sad that in trying to Google an answer for getting one Google product to talk to another on a Google Search engine that the top search result is a five year old article that not only doesn't answer my question but refers to a UI layout that no longer exists.

 

Saturday, 21 June 2014

Fstab notes

Coupla handy fstab commands for the next time a hard drive blows up.


To list UUIDs of attached drives:
sudo blkid

To list all drives attached to the system:
sudo fdisk -l
(that's a lowercase L, not a one)

To edit fstab:
gksu gedit /etc/fstab

To enact changes you've just made to fstab:
sudo mount -a

To see what devices are currently mounted (will include stuff other than drives)
mount



Tuesday, 11 March 2014

Resizing images with Imagemagick

I like the command line-driven program Imagemagick for resizing images.  There are lots of examples on the net, but when I wanted to resize a bunch of images at once I couldn't find how to use wildcards.  Most people seem to expect you to know how to use wildcards in your expressions, which I didn't.

I wanted to take a directory of .png scans, resize them, and save them as .jpgs.  I navigate to the directory they're in using my file manager, then right-click and choose "open in terminal window".  Then I typed

convert *.png -resize 800x800 -quality 80 outputfilename.jpg

This will give you .jpgs numbered consecutively, at a maximum size of 800 vertical or 800 horizontal, while preserving aspect ratio, at fairly good quality (between 0-100).

Obviously, this will resize every .png file in the directory, but you can be more selective by giving more info for the input file

convert P1070*.png -resize 800x800 -quality 80 outputfilename.jpg

Imagemagick is staggeringly powerful for what it is, I'm not going to go into great deal of info but check out the website for more details.  It pays to become fluent with simple conversions.  You hear the old saw from diehards about how the command line is faster, and in this case I admit it's true.  Tip - I resize images often enough that I just have to up-arrow through my history in the terminal a few times to come to a recent usage, edit it, and go.

www.imagemagick.org


Thursday, 13 June 2013

Combine (concatenate) PDF files

I'm a digital packrat - OK, well, I hoard real stuff too, but I like to collect scans of interesting bits.  I had scanned a bunch of pages out of a book about steam engines.  This was back before I knew how to scan a bunch of pages into one pdf with Simple Scan.  So I had a directory with a dozen pdfs that I wanted to make into one pdf for easy viewing.  Enter pdftk.

At first I was going to do the following:

pdftk 'steam engine1.pdf' 'steam engine2.pdf' 'steam engine3.pdf' cat output steamengines.pdf

Note single quotes to allow use of spaces in filenames, which I've stopped doing as apparently it's a Bad Thing in Linux.  But then I realised that with the magic of wildcards, I could save a bit of typing:

pdftk steam*.pdf cat output steamengines.pdf

and voila, a dozen files into one, and a "booyah" and fist pump and an odd look from my wife at the other end of the couch.

And it's in the usual repositories so getting it is as easy as:

sudo apt-get install pdftk



Tuesday, 24 July 2012

Dealing with filenames that have spaces in them

If you're like me and every now and then are forced to do something on the command line, you may come across a situation where you need to do something to a file that has a space in it.  This is problematic on the command line as spaces indicate separation between different commands.

I came across this tonight when trying to transcode an mp4 file to an avi file so I could watch it on my hopeless Panasonic LCD which apparently only understands one video format.  Use single quotes around the filename and extension.

mencoder 'Jubbly Bits.mp4' -oac pcm -ovc copy -o 'Jubbly Bits.avi'



Thursday, 21 June 2012

Cutting and pasting into the terminal

Have you tried to Ctrl-C some text from a webpage and Ctrl-V into a terminal window only to find it didn't work?  That's because it's Ctrl-Shift-V, you numpty.

Also, middle click (mouse wheel), at least in Linux Mint.

Tuesday, 12 June 2012

Converting ogg files to mp3 from the command line

Problem - I've downloaded a podcast in .ogg format and want to listen to it on my Nokia phone, which doesn't support .ogg.

So the procedure will be to convert the .ogg file back to .wav, then encode it into .mp3

Change from Home directory to Desktop:
cd /Desktop

install Lame and Vorbis tools:
sudo apt-get install lame
sudo apt-get install vorbis-tools

Decode .ogg file:
oggdec tuxradar_s04e09.ogg

Encode to .mp3, using low-quality setting:
lame -f tuxradar_s04e09.wav tuxradar_s04e09.mp3

I'm sure if I did this sort of thing every day this would all seem logical and fall off the fingertips as quickly as my typed whinging, but it took me twenty minutes to Google and do.  Ah, Linux, how do I love thee? (Don't make me answer that question)