Skip to content

Instantly share code, notes, and snippets.

View vladget's full-sized avatar

Volodymyr Hetmanshchuk vladget

View GitHub Profile
### Keybase proof
I hereby claim:
* I am vladget on github.
* I am vladget (https://keybase.io/vladget) on keybase.
* I have a public key whose fingerprint is DACD 0D1C 7E22 DB4E D4E0 9A45 F4B7 60C6 6EF8 E70E
To claim this, I am signing this object:
@vladget
vladget / gist:1de9aa3f10fe20638cd61356064738fb
Created September 6, 2022 18:41
Mikrotik dual-wan failover with both private DHCP WANs
# sep/04/2022 17:59:15 by RouterOS 6.49.6
/interface bridge
add name=bridge
/interface ethernet
set [ find default-name=ether1 ] name=ether1-wan1
set [ find default-name=ether2 ] name=ether2-wan2
/interface wireless
set [ find default-name=wlan1 ] ssid=MikroTik
set [ find default-name=wlan2 ] ssid=MikroTik
/interface list
@vladget
vladget / strace.md
Created May 11, 2021 13:37 — forked from graste/strace.md
strace process for network and memory and other syscalls

File activity

strace -e trace=file -fp PID (file) or strace -e trace=desc -fp PID (file descriptors)

Common calls:

  • access
  • close – close file handle
  • fchmod – change file permissions
  • fchown – change file ownership
For fresh installed Mac OS X or after migration to new machine. TODO: Make own ansible role for install all stuff.
##### Ansible related
###### Python 3.x and libcrypto issue
*Problem:*
After update to Mac OS X Catalina or frash install there is issue with libcrypto
```
Python Abort trap: 6
crashed with invalid load of libcrypto.dylib
@vladget
vladget / example.md
Created December 13, 2018 22:33
Пример выпадающих блоков с текстом
Все директивы поддерживаемые в dappfile.yaml
dimg: <dimg_name... || ~>
from: <image>
fromDimg: <dimg_name>
fromDimgArtifact: <artifact_name>
git:
@vladget
vladget / gitlab-registry.gc.sh
Created January 25, 2018 11:41 — forked from eedugon/gitlab-registry.gc.sh
Manual garbage collector for gitlab registry, it removes old revisions that are not referenced by any tag
#!/bin/bash
# This is a modification of gitlab-gc.sh script created by Peter Bábics (pbabics/gitlab-gc.sh)
# Improvements
# - Searching in all BASE_PATH, not fixing the search to a depth of 2
# - Directories without valid tags or revisions directories won't be processed (to avoid unexpected issues)
# - Logging in case there's nothing to delete
# - running registry-garbage-collect only when something has been deleted
@vladget
vladget / report_pg_stat_statements.sh
Created July 6, 2017 22:15
report_pg_stat_statements.sh
#!/bin/bash
# variables
database="database"
to="email@email.com"
cc="email2@rmail.com"
# export top 100 statements to temporary file
psql -U postgres $database -c "copy (select query,min_time,mean_time,max_time,total_time,calls from pg_stat_statements where calls>100 and mean_time > 30 and min_time >10order by mean_time desc limit 100) to '/tmp/pg_stat_statements_top100.csv' delimiter ';'"