Skip to content

Instantly share code, notes, and snippets.

View azubkokshe's full-sized avatar
💭
I may be slow to respond.

Alexandr Zub azubkokshe

💭
I may be slow to respond.
  • Kazdream Technologies
  • Kokshetau
View GitHub Profile
@azubkokshe
azubkokshe / main_test.go
Created October 20, 2023 09:14
matchIPv4Subnet
package main
import (
"testing"
)
func matchIPv4Subnet(addr, cidrAddr, prefix uint32) bool {
var mask uint32
if prefix >= 32 {
mask = 0xffffffff
@azubkokshe
azubkokshe / rvictl.md
Created November 30, 2022 04:22
rvictl for Linux and Windows
@azubkokshe
azubkokshe / apktool.md
Created February 9, 2022 09:11
Mofiying and repackaging an Android app
  1. Install apktoll
  2. Disassemble APK apktool d ./TestApp.apk
  3. Make any changes... 3.1. For example modify "network_security_config.xml" in the res/xml directory 3.2 Add <certificates src="user" />
<network-security-config> 
    <base-config> 
        <trust-anchors> 
  
@azubkokshe
azubkokshe / .screenrc.md
Last active December 7, 2021 09:30
.screenrc
startup_message off
caption always "%?%F%{-b gk}|%:%?%c|%{-b wk}%d.%m.%Y%{-b wr}|%H%?%F|%{+u wb}%?%L=%-Lw%45>%{+b bw}|%n%f*%t|%{-}%+Lw%-0<"

image

@azubkokshe
azubkokshe / screen.md
Created December 7, 2021 09:15
Executing a command in the existing screen in a new tab from CLI
# Create new screen with name test_1, run ping and detach
screen -dmS test_1 -t TAB-0 bash -c 'ping mail.ru; exec sh'
# Create new tab in existing screen and run htop app
screen -S test_1 -X screen -t TAB-1 bash -c 'htop ; bash'
# Create new tab in existing screen and run uptime app
screen -S test_1 -X screen -t TAB-2 bash -c 'watch uptime ; bash'
@azubkokshe
azubkokshe / gist:e26cb34e3e836356106a470ce9fcf674
Last active August 23, 2024 20:03
Write all tmux scrollback to a file
  1. Use prefix + :, then type in capture-pane -S -3000 + Return. (Replace -3000 with however many lines you'd like to save, or with - for all lines.) This copies those lines into a buffer.
  2. Then, to save the buffer to a file, just use prefix + : again, and type in save-buffer /home/{user}/filename.txt + return.

(By default Prefix is Ctrl+B.)

@azubkokshe
azubkokshe / gist:e080e36f50b0b943e079872bd9e40b64
Created November 22, 2021 04:33
Elegant algorithm to detect overlapping periods
a.start <= b.end AND a.end >= b.start