Skip to content

Instantly share code, notes, and snippets.

View gorshkov-leonid's full-sized avatar

Leonid Gorshkov gorshkov-leonid

View GitHub Profile
@gorshkov-leonid
gorshkov-leonid / update-unsupported-ubuntu-debinan.md
Created August 28, 2021 10:29
How to install software or upgrade from an old unsupported release?
@gorshkov-leonid
gorshkov-leonid / ssh-for-github-windows.md
Last active August 19, 2025 11:26
ssh for github in windows
@gorshkov-leonid
gorshkov-leonid / wsl-remove-with-paths.md
Last active November 5, 2021 13:58
WSL How to remove the Win10's PATH from WSL

How to remove the Win10's PATH from WSL Create or edit /etc/wsl.conf

 [interop]
 enabled=false # enable launch of Windows binaries; default is true
 appendWindowsPath=false # append Windows path to $PATH variable; default is true

then wsl --shutdown

@gorshkov-leonid
gorshkov-leonid / docker-in-docker.md
Created August 13, 2021 19:22
Docker in docker mount sock
docker run -it -v $(pwd):/home/docker -v /var/run/docker.sock:/var/run/docker.sock -w /home/docker docker:19.03.8 /bin/sh
@gorshkov-leonid
gorshkov-leonid / how-to-split-pem-certs.md
Created August 12, 2021 22:14
How to split PEM certificates
IN_CERTS=$(cat in.pem)
echo -e "$IN_CERTS" > ./tmp.pem 
sed -i '/^[[:space:]]*$/d' ./tmp.pem
mkdir -p _certs 
csplit -s -z -f './_certs/cert-' -b '%02d.crt' ./tmp.pem '/-----BEGIN CERTIFICATE-----/' '{*}'
@gorshkov-leonid
gorshkov-leonid / update-file-permissions-in-git-repo.md
Created August 11, 2021 12:38
Update file permissions in GIT repo
find . -name "*.sh" -exec git ls-files -s {} \;
find . -name "*.sh" -exec git update-index --chmod=+x {} \;
@gorshkov-leonid
gorshkov-leonid / wsl-vcxsrv.md
Last active August 7, 2021 20:07
WSL2 on Windows and X Server

VcXsrv

Install VcXsrv on Windows. Launch X Server with the settings: Display number: 0, Disable access control: yes

Test

# DISPLAY in WSL
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0

#check
apt install x11-apps
@gorshkov-leonid
gorshkov-leonid / unknown-ca-in-ubuntu-wsl2.md
Last active August 12, 2021 20:23
Unknown CA in WSL2 (Ubuntu as example)

How to check that CA certificate is untrasted under WSL2 (Ubuntu) and fix it

  1. Check that certificate is untrusted under WSL2
    HOST=abc.foo.cloud # or another
    openssl s_client -connect ${HOST}:443 -showcerts
    
    Result:
      CONNECTED(00000003)
    
@gorshkov-leonid
gorshkov-leonid / wrap-git-command.md
Last active August 7, 2021 20:12
wrap git command
cat | tee -a ~/.bashrc > /dev/null << "EOF"

# supported cases: 
#   git config user.email
#   git clone https://aaa.git bbb && ls -al ~/.gitconfig
#   git clone https://aaa.git aaa
#   git checkout -b test
#   git commit  -am 'issue-42"s '
#   git commit  -am "issue-42's "
@gorshkov-leonid
gorshkov-leonid / vertx-websocket.md
Last active August 7, 2021 20:15
vertx websocket
package aaa;

import com.google.common.util.concurrent.Uninterruptibles;
import io.vertx.core.Vertx;
import io.vertx.core.http.*;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.*;