How to change File Creation time using Windows Powershell

I don’t want to blame the time shift 2x a year. At least as long as I do not forget to change the time on my camera as well! As I am doing most of my photography on hikes and geo tag them afterwards, It makes quite a difference if the file creation time is right or wrong.

This year I forgot to change it on the camera and needed to bulk-change the file time later. Luckily this is pretty easy using Windows Powershell and the Windows PowerShell ISE (Integrated Scripting Environment):

$files = Get-ChildItem "C:\Users\[....]\*.arw"
foreach ($f in $files){
    $d1 = [System.IO.File]::GetCreationTime($f.FullName)
    $d2 = $d1.addHours(1)
	[System.IO.File]::SetCreationTime($f.FullName, $d2)
    echo $d1 
    echo $d2
    echo ---
}

Just copy it into the ISE, execute, done.

How To Quickly delete large folders in Windows

Deleting folders with a huge amount of files can be tedious in Windows Explorer: You might end up in watching a progress bar preparing and deleting a lot of files. Even if you don’t want the files to be moved to trash.

If the files should just be deleted, this can be done easier with the command line:

cd foldername
DEL /F/Q/S *.* > NUL
cd ..
RMDIR /Q/S foldername

That’s it!

A lot of explanation / evaluation and even a Context-Menu-Shortcut can be found at this Ghacks article.

How to fix: Samsung Soundbar does not connect to SmartTV

When you own both a Samsung Soundbar (HW-[something]) and a Samsung Smart-TV, you would assume that they work in nice harmony. Which they usually do! Just once in a (seldom) while, the both just don’t connect any more and it seems there is no way to connect them again.

Recently we ran into the same trouble. It required a lot of forum reading, searching, reading support pages. Especially as it requires sound-resetting both devices and does not require hard-resetting the TV (loosing channel list, favourites et. al). As it was a real pain to figure it out, I wrote down my process.

The following steps worked for me the last time I had to try it.

  1. Soundbar (maybe this is not required?)
    • turn off
    • press (and hold) the stop button until the soundbar displays “init, ok”
  2. TV:
    • Remove soundbar from the config:
      Menu > System > Device manager > Soundshare > remove Soundbar
    • turn off the TV
    • disconnect from power
    • wait ~3 min
    • reconnect & power on
  3. Soundbar:
    • Power on
    • switch to TV mode and wait for connection
    • MAYBE reset soundbar: press & hold “play” until it displays “reset”

Hope this helps! Leave a comment if it helped you or if there’s a faster way to reconnect both devices.

Google Maps SDK does not show map in Release Build (works in Emulator)

I’ve been waisting some hours by hunting a stupid “bug”:
I am using Android Studio and was following the “Maps SDK for Android > Getting Started” guide. Of course I also ran into the issue of a wrong API key. But this was all solved by Googling and StackOverflow.

The map still showed up in the Emulator but NOT if deployed as stable release into the (beta) release channel to the PlayStore! LogCat was also silent … After a while I realized thetiny hint in AndroidStudio:

The light grey “(debug)” tells us that AndroidStudio placed the XML in “src/debug/res/values/” instead of “src/main/…”. Simply moving the file did the trick …

 

How to make space/storage efficient backups of Raspberry Pi SD-cards

RaspberryPi mini computers are great for all kinds of home automation, media centers, home servers. Yet it should be known that the draw back for permanent operation can be the SD-card. Especially when applications on the RasperrbyPi cause excessive read/writes or if it is used outsides where temperatures can reach the SD-Card operating limits, IO errors should be expected that can just f* up the operating system.

Continue reading How to make space/storage efficient backups of Raspberry Pi SD-cards

How to install TvHeadend on a Raspberry Pi

Tvheadend is a TV streaming server and recorder for Linux. It also offers a great possibility to combine a SAT-recorder with KODI mediacenter on a Raspberry Pi (I would recommend a raspberry Pi 3 due to RAM requirements).

Installing Tvheadend by compiling from source was not so easy, so it is definately easier to install via precompiled packages. In order to do so, the following steps are required:

Continue reading How to install TvHeadend on a Raspberry Pi

Let’s Encrypt with Tomcat 7

Using HTTPS on Tomcat with a let’s encrypt certificate is quite easy – as soon as you know how to do it (as usual). acme.sh provides a quite convenient way of getting and renewing certificates. This is extremely important as the certificates have a lifetime of just 60 days.

So get and “install” acme.sh first! And make sure Tomcat is running on port 80. Then start getting your certificate:

Continue reading Let’s Encrypt with Tomcat 7

Where to install custom / portable programs in Windows10/8.x?

There are a couple of programs that cannot be installed / put into the regular locations (c:\Program Files and c:\Progam Files (x86)) as they cannot be run in non-administrator mode. So – where should you put / install those programs?

Fortunately Windows comes with a good place for those programs. Just put them into %LOCALAPPDATA%\Programs which expands to C:\Users\...\AppData\Local\Programs.
No need to tweak permissions (as it is in your user directory).

Downside: If you are part of a large domain (which you will not be with your private computer), your programs will not be synchronized to other computers where you log on. If you would like that you would have to place it in %appdata% (which expands to C:\Users\...\AppData\Roaming). But it would also mean that possibly large installations are synchronized. Don’t blame Windows if you are suffering from long login-times then!

In case you want to go deeper into the differences between Roaming, Local and LocalNow, have a look at the answers at superuser.com:

Roaming. (%appdata%) contains data that can move with your user profile from PC to PC – because data is synced with a server (e.g. web browser favorites or bookmarks.

Local. (%localappdata%) contains data that can’t move with your user profile. This data is typically specific to a PC or too large to sync with a server (e.g. temporary files).

LocalLow. (%appdata%/…/locallow) contains data that can’t move, but also has a lower level of access. E.g., a web browser in protected or safe mode, will only be able access data from the LocalLow Folder.

Mount vmWare shared folder in Ubuntu guest

If you want to share files between a Windows Host and a Ubuntu Linux guest, the “shared folder” feature is really handy. Just enable it in the VM-Settings, install guest additions and … then wonder where this shows up in the VM. “They appear under /mnt/hgfs” I read everywhere.

Well, they do – as soon as you do a

sudo mount.vmhgfs .host:/ /mnt/hgfs/

It took me a couple of minutes to figure this out as all tutorials endet with “the folder appears” …
If it doesn’t work, maybe just rerun

sudo vmware-config-tools.pl