How to delete Hyper-V Virtual Networkcards in Windows 10

As a "Edge" Version user of Docker for Windows, I tend to reinstall Docker from time to time, just to get a clean base. However, Hyper-V digs quite deep into the system and creates its own virtual network interfaces, which you just can't delete from the Hyper-V Manager.

Best option is to use (READ ALL BEFORE COPY AND PASTE, PLEASE!):

netcfg -d

in a Administrator CMD window.

This does only delete virtual network devices - HOWEVER, it does delete devices like i.e. your OpenVPN interface AS WELL - AND does DELETE ALL SETTINGS of other network interfaces, i.e. your IP configuration or all your saved WIFI credentials.

So use with care!

Taken from: https://serverfault.com/questions/584316/how-to-delete-hyper-v-virtual-switch-extensions-adapters-from-device-manager

Upgrade WSL (Windows Subsystem for Linux) on Windows 10

I had installed WSL (Windows Subsystem for Linux) a long time ago to gain access to Ubuntu 14.04 LTS directly from my Windows 10 Desktop. However, as time passes, Software grows old. Upgrading the Ubuntu Subsystem via apt-get update / do-release-upgrade should work, but that could have some nasty sideeffects, considering that the 14.04 LTS WSL release had been a beta test - so, a reinstall should be better.

Luckily, TechRepublic got this covered. Just open a CMD and run:

lxrun /uninstall /full /y

to uninstall the current WSL version.

Afterwards, try

lxrun /install

to reinstall it. With this "reinstall", Ubuntu 16.04 LTS will be installed.

Nonetheless, I recommend a nice

sudo apt-get update
sudo apt-get dist-upgrade

afterwards in your BASH session to get the WSL to the latest version ;).

 

Solve Windows 10 does not automount USB Drives anymore

My Windows 10 machine started behaving weirdly and did not mount any USB Drives / Harddrives and such anymore. I had to open the Disk Management Tool and mount them manually, which is quite inconvenient. So I was looking up the error and came across the nearly perfect solution at http://woshub.com/windows-doesnt-assign-letters-to-external-and-usb-flash-drives/ . However, I did change it a bit so that the VDS is changed to automatically start on boot via the CLI :).

Oh, and yes, you need to do this from an admin cmd 😉

First thing to check if something is wrong, is if your VDS (Virtual Disk Service) works. If not, set it to start on boot and start the service:

sc query vds
sc config vds start= auto
sc start vds
sc query vds

If automounting still not works, it could be deactivated. Start diskpart, watch the status of automount and if it is disabled, activate it.

diskpart
DISKPART> automount
DISKPART> automount enable
DISKPART> exit

Now everything should be working fine again 🙂

[Windows/Ubuntu] ADB and Fastboot - useful stuff for your Android

1.) Setup on Linux (Ubuntu)

sudo apt-get update 
sudo apt-get install -y android-tools-adb android-tools-fastboot

1b.) Setup on Windows

I recommend the Minimal ADB and fastboot Package by shimp208, which you can get from: https://forum.xda-developers.com/showthread.php?t=2317790.

After you've installed it, you should add the folder of the installation to your PATH Variable: Press WIN+X Key, choose System, Advanced Systemsettings, Advanced, Path Variables - or just press WIN+R and enter "C:\Windows\system32\rundll32.exe" sysdm.cpl,EditEnvironmentVariables- you will need to click on the entry Path in the User Variables, edit and then create a new entry by clicking on new. There, you'll need to enter the path to Minimal ADB and Fastboot, i.e. C:\Program Files (x86)\Minimal ADB and Fastboot, click ok and close everything. Now you can use adb and fastboot from CMD in every folder.

 

2) Using it!

ADB can be used to do almost anything with Android Devices - as long as Android Debugging is activated. Developer Mode is activated via Settings -> Status and clicking 7 times on "Build number". After that, the Developer Options are available in the Settingsmenu. In this menu, you need to activate Android Debugging and connect your Phone via USB to your PC. You can start i.e. the Android Shell by accessing your Terminal and starting adb shell

In the Android Shell, you can navigate the file system of your phone or change different settings, i.e. you can change the brightness of your screen via:

settings put system screen_brightness 200

There are a lot of settings you can change, some are listed here:

Settings System: https://developer.android.com/reference/android/provider/Settings.System.html

Settings Global: https://developer.android.com/reference/android/provider/Settings.Global.html

Settings Secure: https://developer.android.com/reference/android/provider/Settings.Secure.html

You can also get a list of your current settings with settings list [namespace], i.e.

settings list system

You can also reboot your phone if it is rooted, move files, edit them, delete them - everything you can do on a normal linux system.

Another useful adb commands are pull and push. With adb pull  you can pull a file from your phone to your pc. And with adb push you can upload a file to your phone.

Also, you can adb install  install apk files / apps or adb uninstall  uninstall them.

Important for debugging is the access to the logcat daemon via adb logcat so you can see what happens on your phone. You can even filter for different apps, i.e. chromium: adb logcat -s chromium

There is a bunch of other goodies like forwarding socket connections or reverse sockets and backup / restore of apps - which you can find out by looking at the useful adb help output.

Fastboot is the last command I want to describe here. You can use adb to reboot your phone to bootloader (adb reboot bootloader) or recovery (adb reboot recovery). If your phone is rooted and you get it into the bootloader, you can access it via fastboot. This tool is vital to flashing new kernels, images, recoverys and other stuff if everything else fails. Knowing that it exists should be enough for the "normal status of operation" - but if something breaks - use it ;)!

SSH and Git on Windows (with Public\Private Key Authentication)

This Blog Post consists in huge parts of Daniel Hüskens awesome work, but I still had to rewrite it a bit as I tended to add some stuff on :).

1.) Download latest Git for Windows: https://git-for-windows.github.io/

2.) Install (Entires with * can be changed to your own liking, ** can be changed, but this setting is recommended)

  • "Without Windows Explorer Integration" *
  • "Run Git and included Unix tools from Windows Command Prompt"
  • "Use OpenSSH"
  • "Checkout Windows-style, commit Unix-style endings" **
  • "Use Windows default console window" **

3.) Configure

  • set set HOME=%HOMEDRIVE%%HOMEPATH% in your Windows User Path Variables: Press WIN+X Key, choose System, Advanced Systemsettings, Advanced, Path Variables - or just press WIN+R and enter "C:\Windows\system32\rundll32.exe" sysdm.cpl,EditEnvironmentVariables- you will need to click on New, then create a new Variable HOME  with the Value %HOMEDRIVE%%HOMEPATH%, click ok and close everything.
  • create the Folder .ssh in your User Folder (C:\Users\YourName\)
  • if you want to store your ssh Config and Credentials somewhere else, you need to use a symlink. Start your CMD in Administrator Mode (Press Windows Key, type cmd, rightclick on the found program, start as Administrator) and create the link with mklink /D "C:\Users\YourName\.ssh" "D:\mySecretFolder\.ssh" The path D:\mySecretFolder\.ssh does have to exist before this action, .ssh in the YourName folder not :).

4.) Create a key and test access to Github

  • Go to your .ssh folder and open a CMD there
  • ssh-keygen -t rsa -C "a good comment on what this key is for" -b 4096
  • Your key has been created, it should be named id_rsa and id_rsa.pub. The content of id_rsa.pub can be added as new ssh key to your Github profile on: https://github.com/settings/keys
  • After that you can test your setup with ssh -T git@github.com
  • If anything goes wrong, add verbosity to your SSH command, i.e. with -vvv (more v's equals more debug messages)

5.) Word of advice:

SSH can be a bit tricky, as it tends to only look for id_rsa named keys in your .ssh folder. So if you have multiple keys with different names chances are high that this won't work. However, you can get around that with entries in the user defined ssh config file (called "config" and placed in the .ssh folder of the user) to tell ssh which key to use with which ssh connection. I will add a post on that topic later and link it here.
EDIT: Here is the link

MacType - A better font rasterizer for Windows

If you're tired of the ClearType Fonts in Windows and long for a more Unix/Mac Style Font Rasterizer, you most probably have heard GDI++ and GDIPP. And as both projects are somehow dead (for 6+ years), someone started a new one, called MacType.

How to install the latest version?

1.) Download and Install MacType (chose English!): http://www.mactype.net/

2.) Download the latest patch: http://silight.hatenablog.jp/entry/MacTypePatch currently the latest version is MacTypePatch_1.19.zip (2016/11/17).

3.) Unpack the patch and copy EasyHK32.dll, EasyHK64.dll and UserParams.ini (from win8.1_or_later folder) to the C:\Program Files\MacType folder

4.) Copy EasyHK32.dll, EasyHK64.dll to C:\Windows\System32

5.) Start MacType as Tray Version and chose an default settings, i.e. FT Opt

Here you can see an example - left without, right with MacType:

[Ubuntu] Networked UPS with apcupsd, APC 750 and Windows

Due to some serious power outages, I had to install an UPS at the Office of one client. It is an rather small setup: One low-power Ubuntu Server, one Laptop with one TFT Screen, one i3 Desktop with two TFT Screens, one network switch. All in all, about 400VA. I had an old APC Smart UPS 750 VA at hand and used it.
Idea was to connect the UPS via USB directly to the Server and hook Laptop and Desktop to that Server via Network. As soon as the Server found that the whole Powergrid went offline, all pcs should shutdown automatically: Enter apcupsd.

Power installation:
Connect the UPS input to the power grid, connect the UPS out to your PCs. NEVER CONNECT ANY LASER PRINTER TO THAT OUTPUT!
Power up the UPS.

Server installation:
Connect the UPS USB Port to the Server.
Install apcupsd:
sudo apt-get install apcupsd
Configure apcupsd:
sudo vi /etc/apcupsd/apcupsd.conf
In my case I configured that settings:

UPSNAME blaUPS # How you want to name your ups
UPSCABLE smart # in my case, it is a smart cable
UPSTYPE usb # on usb
POLLTIME 60 # poll ups every 60 seconds
ONBATTERYDELAY 10 # delay alarm for 10 seconds
BATTERYLEVEL 10 # on less than 10 percent battery level shutdown server
MINUTES 3 # on less than 3 minutes battery runtime shutdown server
NETSERVER on # activate network server
NISIP 0.0.0.0 # allow access from all nics
NISPORT 3551 # default port for network server

Allow port 3551, tcp through iptables!

Restart apcupsd:
sudo service apcupsd restart

Give status of current apcupsd session:
sudo service apcupsd status

Client installation on Windows:
Download latest version for Windows (i.e. winapcupsd-3.14.13.exe), you only need apcupsd Service and Tray Applet.
Leave everything on default on setup and configure apcupsd.conf

UPSNAME blaUPS # How you want to name your ups
UPSCABLE ether # network to server
UPSTYPE net # on network
DEVICE IP:3551 # for IP, enter the IP of the server
POLLTIME 15 # poll ups every 15 seconds
ONBATTERYDELAY 10 # delay alarm for 10 seconds
BATTERYLEVEL 20 # on less than 20 percent battery level shutdown client
MINUTES 3 # on less than 3 minutes battery runtime shutdown client
NETSERVER on # activate network server
NISIP 127.0.0.1 # allow access only from localhost

And thats it 🙂

[Windows/Ubuntu] Install chromeIPass: KeePass2 to Chromium Password Management

This post is outdated, the plugin in question does not exist anymore. I would recommend to use "Kee" (https://www.kee.pm/) plugin - but please as bridge to KeePass Password Safe 2 - and not in its own database mode 🙂

I really loved KeeFox, an cool tool which let you use KeePass2 as Password Safe for your Firefox Passwords.
But today, I use Chrome - so no KeeFox for me anymore. And I really do not like the "Synchronize Password" Feature of Google.
So... chomeIPass it is ;)!

Windows:
( from http://diantokam.blogspot.de/2013/12/integrating-keepass-2-with-chrome.html )
1.) Install Chrome and KeePass2 ( http://keepass.info/download.html )
2.) Download KeePassHttp.plgx from the Github Repo: https://github.com/pfn/keepasshttp/blob/master/KeePassHttp.plgx?raw=true
3.) Move the KeePassHttp.plgx to the C:\Program Files (x86)\KeePass Password Safe 2\ folder
4.) Start KeePass2
5.) Install the Chrome Plugin: https://chrome.google.com/webstore/detail/chromeipass/ompiailgknfdndiefoaoiligalphfdae
6.) Click on the new KeePass Icon in Chrome, click on Connect and check KeePass which should Ask for a "New Key Association" - aka Pairing from Chrome with KeePass2. Give it a uniqe Key name, like Chrome Windows Main PC - and klick Save.
7.) Go to a password protected website - a pop up from KeePass2 should ask wheter it is allowed to give the already saved credentials to Chromium, Allow it.

Ubuntu:
( from http://askubuntu.com/questions/130627/how-to-integrate-keepass-and-chrome-chromium-using-chromipass )

Hint: As correctly pointed out by "H.R." in the comments, it is not recommended to install software from an untrusted source, like jtaylors keeps ppa. It is correct that jtaylor does not seem to be a part of the keepass2 team, hence his ppa is flagged as outside of keepass and "untrusted" - however, his ppa linked and recommended by the keepass team to install on Ubuntu. You can always build the program from sourcecode yourself, which I will not describe here, hence this post is over 4 years old and not applicable anymore, as the Chromium Password Manager does not even exist anymore.

1.) Install Chromium and KeePass2:
sudo apt-add-repository ppa:jtaylor/keepass
sudo apt-get update
sudo apt-get install keepass2 mono-complete chromium
2.) Download KeePassHttp.dll and Newtonsoft.Json.dll from the Github Repo: https://github.com/pfn/keepasshttp/blob/master/mono/KeePassHttp.dll?raw=true
https://github.com/pfn/keepasshttp/blob/master/mono/Newtonsoft.Json.dll?raw=true
3.) Move both files to /var/lib/keepass2
cd ~/Downloads
sudo mv KeePassHttp.dll /usr/lib/keepass2/
sudo mv Newtonsoft.Json.dll /usr/lib/keepass2/
4.) Start KeePass2
5.) Install the Chrome Plugin: https://chrome.google.com/webstore/detail/chromeipass/ompiailgknfdndiefoaoiligalphfdae
6.) Click on the new KeePass Icon in Chrome, click on Connect and check KeePass which should Ask for a "New Key Association" - aka Pairing from Chrome with KeePass2. Give it a uniqe Key name, like Chrome Windows Main PC - and klick Save.
7.) Go to a password protected website - a pop up from KeePass2 should ask wheter it is allowed to give the already saved credentials to Chromium, Allow it.

Removing Windows 10 Diagnostics from Windows 7/8/8.1

Windows 10 "Security?": We got opt-out-only-all-included-private-Wifi-Password-Sharing with all your Facebook Friends, access to all data, addressbooks, emails, voice and video as well as the possiblity to shutdown hardware you attached to your PC - if MS does not like it. Quite some people from the Facebook and Computerbild Front already upgraded to the new Windows 10 - "don't get left behind and get your upgrade" - well... it sounds more like a really evil episode of Dr. Who and the Cyberman to me. Ugh.

To get to the point: Microsoft did backport some of his Windows 10 telemetry magic to Windows 7/8/8.1 and installed it unasked as updates. So your data can enjoy its "freedom" even without you upgrading to Windows 10.

Sweet.

TL;DR - Microsoft did backport Windows 10 telemetry to Windows 7/8/8.1. Xvitaly on Github made a nice cmd file, just download it and execute it to remove all the bad updates and Windows 10 Ads. Restart. After that, check the Windows Update Section and disable the Updates in Question. Otherwise, you will install these again on your next Update.
Link: https://gist.github.com/xvitaly/eafa75ed2cb79b3bd4e9

Private Dropbox/Google Drive/File Sync: Syncthing

I tested quite a lot of sync tools out there: Dropbox, G-Drive, Bittorrent Sync, ownCloud, plain Rsync,... You name it.
But to be true, I never really liked any tool that much: It never really *worked out* somehow: The Mobile Apps were bad, "Servers" did eat up too much performance, etc. etc.
And we don't want to forget these little itching problems with privacy - thinking about Dropbox, G-Drive and the now closed source Bittorrent Sync...
Well - enter Syncthing: https://syncthing.net/
In truth I can only say one thing: It works. It just, plainly, works for syncing data from your mobile devices to your swarm of servers or pcs.
So give it a shot :)!