Skip to content

Instantly share code, notes, and snippets.

@pertsevds
pertsevds / git-use-main.md
Created October 28, 2022 15:03 — forked from clarkphp/git-use-main.md
Use default branch name of "main" instead of "master" in Git repositories

Set default branch name for new repositories to "main"

git version 2.28+

$ git config --global init.defaultBranch main

git version 2.27 or less

@pertsevds
pertsevds / tunnel.py
Created September 29, 2022 17:57 — forked from carlohamalainen/tunnel.py
check ssh tunnel from Python
"""
From the man page for ssh:
-f Requests ssh to go to background just before command execution. This is useful if ssh is going to ask
for passwords or passphrases, but the user wants it in the background. This implies -n. The recommended way
to start X11 programs at a remote site is with something like ssh -f host xterm.
If the ExitOnForwardFailure configuration option is set to “yes”, then a client started with -f will wait
for all remote port forwards to be successfully established before placing itself in the background.
@pertsevds
pertsevds / atom.py
Created July 13, 2021 19:50 — forked from Morgul/atom.py
Atoms/Symbols in Python
class atom(object):
"""An implementation of the atom concept, inspired by Erlang.
Modified from here: http://www.me.net.nz/blog/atoms-slash-symbols-in-python/
"""
def __init__(self, a):
self._a = intern(a)
def __eq__(self, other):