Categories
fun geek opensource programming software tips tools

pimp your powershell with some ascii art

ASCII art in a PowerShell console window.

Wouldn’t you like to be greeted with some random ASCII art when you open up a new PowerShell command window? I thought so!

Here’s a project just for you. Download the ASCII Art Message of the Day project, link the script in your PowerShell profile and bam!, random ASCII art awesomeness every time you open a shell.

Follow the installation instructions from the readme f ile, and you are set. You can even customize what color you want to use. I know, it’s fantastic.
The random ASCII art comes from asciiart.eu, so check it out if you want to have an idea of what you’ll be getting.

Categories
photography software tips tools

fastest way to copy photos from a Sony A5100 camera

I love it when you can hook up peripherals, and they expose their files like a simple external USB drive. You already know how to copy files from a USB drive, so no need to install a new piece of software, and learn how to use it.

Unfortunately, a lot of peripherals do want you to install some fancy piece of software to import your files. The Sony A5100 camera is no different and wants you to install the PlayMemories software. I used it in the past, but it doesn’t bring me any extra value, so I’d rather not. This is how I export my photos now, and I guess this also works for similar Sony cameras.

  1. Hook up the camera using the USB cable to your PC.
  2. Power on the camera and select USB mode.
  3. Navigate to the \DCIM\100MSDCF folder on your camera’s USB drive.
  4. Copy the files to your hard drive.
  5. Delete the files from the SD card folder.

It works even faster if you have an SD card slot in your PC. In that case, put the camera’s card in your PC, and copy the files. Then put the card back in the camera.

Now we still have to restore the image database.

Because we removed the files manually, the camera’s image database needs to be reset using the settings menu. If you don’t do this, you’ll see missing images in the camera gallery. This makes sense because we just deleted them.

To reset the image database:

  1. Power on the camera.
  2. Go to the Settings menu.
  3. Use the Recover Image DB option.

There you have it, files copied neatly to your PC without needing the PlayMemories software. For videos, this doesn’t work, unfortunately. They are saved in a different format and need to be converted to mp4. In that case, I still use the software to extract the video’s to mp4’s.

Categories
gadget tips

fossil hr collider screen reset

The Fossil HR Collider is a great hybrid smartwatch. With the e-paper screen, it last for weeks without having to recharge, and it has just enough features to make it worth the title of a smartwatch. It also looks great with its retro analog watch style, instead of a dark, dead screen on your wrist.
Nothing is perfect however, and I’ve run into a few occasions where the watch didn’t show what it was supposed to on the e-paper screen. Sometimes that was due to my own doing, sometimes it was a glitch.
Since I keep forgetting about the reset options the watch has, I’ve listed them all 3 here.

Let’s start with the easiest one: how to show or hide the dials on the screen. Your background (if you have one) should be showing, but you’re missing the dials for your steps, heart rate, weather, and date?

1. Press and hold the top button for two seconds.

You’ll see the screen flash, and it will hide or show the dials. I’ve turned these off by accident, thinking my watch was broken. Simply using that button brought them back.

If that doesn’t work, you might have to reset your watch. This could help with all sorts of funny business.

2. Reset your watch by holding the middle button for 10 seconds.

You will see a reset message appear, and the watch will vibrate. Keep going and the watch will then reset.

Hopefully you have the problem fixed by now.
If not, there’s still the last resort.

3. Do a factory reset on the watch.

You have to do the factory reset from the mobile app, so unfortunately these steps can change when the app gets an update.
With the current version (2022) you have to open the app, and tap the small watch icon in the top right corner. There you see a list of the watches you have connected with the app.
Select your watch, slide down and choose the “Remove device” option.
Follow the necessary steps to disconnect the watch.

Afterwards, reconnect the watch to the app using the link wizard.

Did this fix your problem? Awesome. You can now buy me a beer. ;)
If not, time to contact support, I’m afraid.

Categories
geek mystuff n3wjack opensource software tools

inbox clean up tool update

A while ago, I wrote a command line tool to clean up any IMAP inbox, and delete the oldest emails if the inbox gets over a certain amount of mails.
This is handy and has been doing its thing for a long time, but recently I wanted to extend that, and also delete emails in a specific timeframe. Let’s say between 23h and 6h of each day.

Say hello to v2.0 of the IMAP Cleanup tool, which now has a slightly modified command line, where you can specify if you want to delete using the count, or if you want to use time as the criteria.

It looks like this if you want ot use count (without the login credentials):

.\ImapCleanup.exe count --keep 500

or to use time:

.\ImapCleanup.exe time --from 23:00 --to 6:00

It’s pretty fast in doing its job, so you can run it a number of times sequentially for more specific cleanup jobs.

You can find all the details on how to set it up and use it on the Github page.

Categories
geek linux microsoft programming software tips tools ubuntu windows

WSL setup, tips and tricks

WSL or Windows Subsystem for Linux allows you to run a fully functional Linux environment, inside your Windows 10 system, without having to set up a virtual machine. It’s a lot more lightweight too, and it integrates nicely with the Windows OS, so it’s a great way to explore Linux, or use the two systems side by side for cross-platform development. This also skips the need for setting up Cygwin and whatever hacky way to access those Linux command line tools on Windows.

I’ve been using it for a while, so I’ll list a short setup guide here, and some tips & tricks to help you along.

Installing WSL

Installing WSL is really easy now. Just open an administrator PowerShell or a Command window and type:

wsl --install

That will install WSL with the default Ubuntu distribution. If you prefer something else, like Debian, you can use this command:

wsl --install -d Debian

The username and password for your WSL system is specific to the Linux distribution. So make sure you don’t forget that password. :)

There are 2 versions of WSL. If you can, run on v2. It’s faster, better and euhm, harder? Anyway, it’s faster, so that’s what you want. But sometimes, you might want to run things on v1 anyway. For example, some VPN clients break with the WSL v2 networking. The easiest way is to set your WSL distro to v1, and see if that works. It did the trick in my case with the CheckPoint VPN on my work machine.

To check your WSL version, run:

wsl -l -v

It should show something like this, if you’re on Debian and v2

  NAME                   STATE           VERSION
* Debian                 Stopped         2

To switch the Debian distro to v1, you can run this:

wsl --set-version Debian 1

Makes sense right? But you just have to know.
Switching versions can take a while as it’s being converted, so do this when you have the time for it.

Accessing your files in WSL

Ok, now let’s do some work in WSL, by typing wsl in a PowerShell window.

That’s it, you now have a shell in your local WSL system.
You’ll see something like this on your prompt:

n3wjack@Mjolnir:/mnt/c/Users/n3wjack$

That’s a mount of your Windows C-drive into the Linux system. So you can access any file from your Windows system in your Linux shell. The other way around also works.

Open up an Explorer window and enter \\wsl$ in the address bar and hit return.
You’ll see a folder pop up for each WSL distribution you have installed. So if you’ve installed Debian, you’ll see a Debian folder. From there you can access any file on your WSL system.

Windows Explorere windows showing the Debian distribution folder under the \\wsl$ network drive.

Keep in mind that this cross OS file access is pretty slow, certainly for lots of small files. So if you are planning on working on files, it’s better to choose your OS and stick with it. But it’s super handy that you can easily copy and access files from any system.

Installing software in WSL

Well, this is easy. If you’ve installed Debian or Ubuntu, so you probably know you can install more software using apt or apt-get.
WSL pretty much behaves as it should, and you can just install whatever you like using known tools.
The account you created when setting up your distro is an administrator account, so you can use sudo commands.

Moving your WSL distro to a new PC

So you have your Linux distro all set up the way you want to, and now you’ve got yourself a brand new shiny piece of hardware to work and play on. How do you move that WSL distro over to the new machine?
Luckily, it’s as simple as backup and restore. Really. It’s actually easier than moving your Windows files over.

Creating a backup of WSL works like this:

wsl --export <distribution> <filename.tar>

So if you see that your distro is called Debian after running wsl -l -v, you do this:

wsl --export Debian debian.tar

This takes a while. After it’s done, you copy the tar file over to your new shiny machine and run the following command:

wsl --import <distribution name> <install path> <tar file path>

Or actually:


wsl --import Debian c:\users\YourName\AppData\Local\Packages\Debian c:\temp\debian.tar

That’s it! You now have your full distro moved to a new machine, including all settings and files.

For more info on WSL, see the excellent official Microsoft documentation.