COOKIES! This blog uses cookies!
I am completely out of control of cookies here, otherwise I would have disabled them (it is controlled by the platform).
If you don't like cookies and being tracked please leave this blog immediately.

Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Friday, 7 April 2017

Windows Creators Update and compatibility of Linux subsystem with Windows binaries

Windows 10 “Creators Update” is finally available to install outside from “insiders programme”, it will soon land on most of windows 10 machine, and those who impatient can install it directly from the website: https://www.microsoft.com/en-us/software-download/windows10

Most valuable thing in this update for me is update of linux subsystem to the Ubuntu 16 and compatibility of this subsystem with Windows binaries, so you now can call pretty much any windows binary from the windows bash. (it is available in build Builds above 14951)


Unfortunately the update of subsystem is not 100% smooth, the subsystem has to be installed and re-installed back (hopefully will not be required soon).


  • (option for impatient) download “Update Now” from the https://www.microsoft.com/en-us/software-download/windows10 and install the update, the system will restart a few times.
  • After update is installed open “bash” and do “lsb_release -a” to check that you’re still on Ubuntu 14;
  • Backup any files and config from the subsystem, for example copy your ~/.bashrc to outside of the subsystem with `cp ~/.bashrc /mnt/c/temp/`
  • Exit the bash and go to windows cmd
  • Uninstall subsystem with `lxrun /uninstall`
  • Re-install linux subsystem with `lxrun /install`
  • Go to the `bash`
  • Ensure that it is now Ubuntu 16 with `lsb_release -a`
  • Try running Windows binary from the bash for example `/mnt/c/Windows/System32/ipconfig.exe /all`

This ability to seamlessly run windows binaries gives many useful opportunities, for example controlling VirtualBox virtual machines from vagrant running inside of linux subsystem.

Tuesday, 24 November 2015

Decrypting and encrypting messages with gpg in linux (ubuntu)

Encrypting and decrypting files with gpg tool is quite easy:
>gpg --recipient Ben --encrypt test.txt
>gpg --decrypt test.txt.gpg

But if you don't want to create a file and just need to encrypt or decrypt a message quickly?

This workflow will work

Encrypt with your gpg key for some known recipient:
>gpg --armor --encrypt --recipient bend
It might prompt you to type a password for your key at this stage.
Now type your message in and here goes the tick: press CTRL+D, which means the end of a input!
After that it will print your encrypted message into standard output.
Shortcut for the command above:
>gpg --aer bend

Encrypt symmetrically with some passphrase:
>gpg --armor --symmetric
It will prompt you to type a passphrase for symmetric encryption
Now type your message in and press CTRL+D
Shortcut:
>gpg -ac

Decrypt some pgp message:
>gpg --decrypt
Paste your pgp message, for example:
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1

jA0EAwMC1c4w0+3hgT9gySDDFx7lNx0Jwf3aGOwQ8yQc6KKWjnew6LkdtEg3mhOS
bQ==
=7kxT
-----END PGP MESSAGE-----
Type your passphrase (for example 123 for this symmetric message) or a password to your gpg key if it is encrypted for you as a recipient.
And again press CTRL+D to see decrypted message.