Zobrazují se příspěvky se štítkemLinux. Zobrazit všechny příspěvky
Zobrazují se příspěvky se štítkemLinux. Zobrazit všechny příspěvky

sobota 27. dubna 2019

Running Docker on Windows 10 Home

If you try to install Docker for Windows on Windows 10 Home edition, it would fail with a message that it requires Windows Professional. The reason is, that the current Docker requires Hyper-V enabled. But do not worry. If you have a CPU with Hyper-V (you can check it with msinfo32), there's a way, how install Docker on your machine. All credits goes to the Docker users in this forum post, especially to Marcel Hesselbarth and his blog Windows 10 Home Hyper-V aktivieren (in German).

1. Make a file hyperv.bat file and run is at Administrator:
@rem Install Hyper-V on Windows Home
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V -All /LimitAccess /ALL
pause
You need to reboot a computer after that.

2. Change your registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion and change EditionID from Core to Professional

3. Install Docker for Windows.

4. Change your registry back.

And voilà, we have a Docker running on Windows 10.

čtvrtek 14. října 2010

Fixing Line Terminators for Cygwin CVS

I have to use a Windows operating system (unfortunately :-)) and CVS in my current job. Thanks to the Cygwin, I can work with Windows almost as effectively as in Linux. The CVS (CVSNT) installation in Windows and other CVS tools installed in on my Windows box (TortoiseCVS, Eclipse) stores the CVS files with CRLF line terminators (EOLs). The Cygwin CVS client requires the classic UNIX LT terminator. Fortunatelly, the Windows CVS clients can read the UNIX-way text files, too. So, I have creates a simple bash script to forx this problem:
#!/bin/sh
find . -type f -path '*/CVS/*' -print0 | xargs -0 dos2unix 
Hope, someone may find it useful.

středa 16. září 2009

Linux: How to Convert Binary File into Byte Array

Sometimes, a programmer needs to embed a content of a binary file into a program, usually as an array of bytes. For instance, I needed to embed an icon into a Java code, to be really sure the icon is always available for the program. So I have saved an icon in a GIF format and then used the od command. But the result was an unusable list of octal numbers. After a minute with playing, I have found a feasible solution
od -A n -v -t d1 image.gif | sed -e 's/^ *//g' -e 's/  */,/g' -e 's/$/,/g'
I have copied a result into my Java code as
private static final byte[] MISSING_ICON_BYTES = new byte[] { /* copy result here */ };
public static final ImageIcon MISSING_ICON = new ImageIcon(MISSING_ICON_BYTES);