Skip to content

Instantly share code, notes, and snippets.

View DzeryCZ's full-sized avatar
🎸

Jaroslav Živný DzeryCZ

🎸
  • ErsteBank
  • Vienna
View GitHub Profile
@DzeryCZ
DzeryCZ / Readme.md
Last active July 23, 2020 09:31
WSL Git under JetBrans IDEs

How to set up WSL Git under JetBrans IDEs

  1. Create file git-wsl.bat (contect can be found below)
  2. Go to JetBrains IDE (InteliJ, PyCharm, PHPStorm, ...)
  3. Go to File -> Settings -> Vesion Control -> GIT
  4. Set path to the git-wsl.bat file (created in a step above)
  5. Click Test to check the functionality
  6. Done 🎉
@DzeryCZ
DzeryCZ / ReadingHelmResources.md
Last active October 17, 2024 15:44
Decoding Helm3 resources in secrets

Helm 3 is storing description of it's releases in secrets. You can simply find them via

$ kubectl get secrets
NAME                                                TYPE                                  DATA   AGE
sh.helm.release.v1.wordpress.v1                     helm.sh/release.v1                    1      1h

If you want to get more info about the secret, you can try to describe the secret

$ kubectl describe secret sh.helm.release.v1.wordpress.v1
@DzeryCZ
DzeryCZ / Minikube_WSL.md
Last active December 9, 2018 22:40
Minikube in WSL

Minikube in WSL

  1. Install minikube in windows
  2. Add this to ~/.bashrc:
function minikube()
{
    if [ $1 == "docker-env" ]; then
 minikube.exe $1 $2 --shell bash | sed 's/C:/\/c/' | sed 's/\\/\//g' | sed 's/"//g'
@DzeryCZ
DzeryCZ / YubikeyOnWindows.md
Created September 14, 2018 09:06
How to use YubiKey On Windows

How to make GPG agent restart with every connection of YubiKey:

GPG agent sometimes stuck when you put your PC to sleep mode or when you unplug and plug your YubiKey back. This Solution will restart the GPG agent with every connection of YubiKey.

  • Create a "yubi-reset.bat" file on your disk and put there this content:
gpg-connect-agent killagent /bye
gpg-connect-agent /bye
  • Open Event Viewer
@DzeryCZ
DzeryCZ / DateTimeHandler.php
Created August 6, 2018 16:12
Symfony + FOS Rest + JMS serializer - Serialization handler
<?php
declare(strict_types=1);
namespace MyApp\Infrastructure\Handler;
use JMS\Serializer\Handler\SubscribingHandlerInterface;
use JMS\Serializer\GraphNavigator;
use JMS\Serializer\JsonSerializationVisitor;
use JMS\Serializer\Context;
@DzeryCZ
DzeryCZ / Show GIT branch.md
Created June 26, 2018 15:08
Linux bash - Show Git branch

Add to your ~/.bashrc file

parse_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\033[36m\]\u@\h\[\033[00m\] \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
@DzeryCZ
DzeryCZ / Set tab title in Hyper.md
Last active May 4, 2018 15:54
Set tab title in Hyper

Add this to ~/.bashrc

# Setting Title in Hyper
function title() { echo -e "\033]0;${1:?please specify a title}\007" ; }

Log out and back in the terminal

Use as

@DzeryCZ
DzeryCZ / Mount drives.md
Last active June 18, 2018 20:34
Bind custom mount points to fix Docker for Windows and WSL difference

In Windows 10 version >= 1803

Edit/Create /etc/wsl.conf and add this content:

[automount]
root = /
options = "metadata"
@DzeryCZ
DzeryCZ / docker-machine-wsl.md
Last active December 9, 2018 22:40
Make docker-machine works properly on WSL

docker-machine Doesn't work properly inside of WSL, this function makes it work.

Add this to ~/.bashrc:

function docker-machine()
{
    if [ $1 == "env" ]; then
            docker-machine.exe $1 $2 --shell bash | sed 's/C:/\/c/' | sed 's/\\/\//g' | sed 's/"//g'
    else

docker-machine.exe "$@"

@DzeryCZ
DzeryCZ / cleanDocker.sh
Last active December 17, 2018 14:17
Clean Docker Containers and Images
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
# Delete all volumes
docker volume rm $(docker volume -q)