Skip to content

Instantly share code, notes, and snippets.

View anton-petrov's full-sized avatar
:octocat:
🥷

Anton Petrov anton-petrov

:octocat:
🥷
View GitHub Profile
@anton-petrov
anton-petrov / .gitconfig
Created November 17, 2022 18:15
Git config for mac
credential.helper=osxkeychain
init.defaultbranch=master
user.name=Anton Petrov
[email protected]
user.signingkey=/Users/anton/.ssh/id_ed25519.pub
core.pager=delta
core.editor=nano
interactive.difffilter=delta --color-only
delta.navigate=true
delta.light=false
@anton-petrov
anton-petrov / gist:f1cdea5b713f79a112a7898c33ec699b
Created February 13, 2023 17:30
Copy SSH Public Key from Windows to Ubuntu
Windows host:
cp C:\Users\anton\.ssh\id_rsa.pub C:\Users\anton\authorized_keys
cd C:\Users\anton\
scp authorized_keys [email protected]:~/.ssh
Ubuntu host:
service ssh status Start sshd if necessary
mkdir ~/.ssh/
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
@anton-petrov
anton-petrov / postgres_queries_and_commands.sql
Created March 4, 2023 11:25 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@anton-petrov
anton-petrov / pritunl.yaml
Created March 23, 2023 02:54
Pritunl vpn docker-compose
version: '3'
services:
mongo:
image: mongo:latest
restart: always
container_name: pritunldb
hostname: pritunldb
network_mode: bridge
volumes:
@anton-petrov
anton-petrov / parser.py
Created March 23, 2023 11:51 — forked from ashmigelski/parser.py
Python server for Wialon Retranslator 1.0
# -*- coding: utf-8 -*-
import binascii
import struct
def parse(fmt, binary, offset=0):
'''
Unpack the string
@anton-petrov
anton-petrov / launchctl_man.md
Created April 4, 2023 18:22 — forked from stevekm/launchctl_man.md
macOS OS X login items

[source]

This manual page is for Mac OS X version 10.9

If you are running a different version of Mac OS X, view the documentation locally:

    In Terminal, using the man(1) command

Reading manual pages
@anton-petrov
anton-petrov / ssh-copy-id.ps
Created April 10, 2023 10:56
Windows 10/11 ssh-copy-id
type $env:USERPROFILE\.ssh\id_rsa.pub | ssh {IP-ADDRESS} "cat >> .ssh/authorized_keys"

Keybase proof

I hereby claim:

  • I am anton-petrov on github.
  • I am antonpetrov (https://keybase.io/antonpetrov) on keybase.
  • I have a public key ASA_OIsuTA3sXxk1yEE1sVVEOD0_m3xFWGV_9WzLenkq2Ao

To claim this, I am signing this object:

@anton-petrov
anton-petrov / 0-go-os-arch.md
Created July 17, 2023 17:29 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH