Skip to content

Instantly share code, notes, and snippets.

@dynax60
dynax60 / subnets.pl
Created February 3, 2023 09:15
Script to get subnets in CIDR notation for the selected countries
View subnets.pl
#!/usr/bin/perl
# dnf install perl-Net
# wget ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.inetnum.gz
# wget https://ftp.apnic.net/apnic/whois/apnic.db.inetnum.gz
# zcat ripe.db.inetnum.gz | ./subnets.pl RU BY
# zcat apnic.db.inetnum.gz | ./subnets.pl MN
use Net::CIDR qw(range2cidr);
use Symbol;
use strict;
@dynax60
dynax60 / install-hpe-sdr.yml
Last active March 30, 2022 07:01
Example of ansible playbook for hp proliant gen10
View install-hpe-sdr.yml
---
- hosts: node1
become: yes
roles:
- role: ansible-role-hpe-common
- role: ansible-role-hpe-spp
hpe_spp_packages:
- amsd
- hponcfg
- ssacli
View gist:752a02b404f4918fe69c39f9e2a2672f
https://12factor.net/ru/
https://www.redhat.com/architect/12-factor-app
https://kubernetes.io/
https://kubespray.io/
https://kube101.jeffgeerling.com/
https://www.youtube.com/watch?v=Mw_rEH2pElw&list=PL8D2P0ruohOBSA_CDqJLflJ8FLJNe26K-
View gist:f365f90453ffe7937da4021a3d9567b3
https://www.netmeister.org/blog/tlds.html
https://www.netmeister.org/misc/zonestats.pl
https://czds.icann.org/home
@dynax60
dynax60 / gist:a32240d9ad0b216fa0671cec9a3d0c4b
Created June 11, 2021 06:21
The current position of the International Space Station
View gist:a32240d9ad0b216fa0671cec9a3d0c4b
curl -s http://api.open-notify.org/iss-now.json | jq '.'
View gist:bd11e788f552fa7de6a11c73afef1ca1
smsc2_rout() -> smscconn_usable()
http://doxygen.kannel.org/d3/d05/smscconn_8c.html#aeaca8fdaf047fab86a82ed5890c4ecc3
Смотрим список живых каналов.
1. Канал не подходит, если (ret=-1):
- есть allowed-smsc-id, а в сообщении smsc-id не определён или он не был найден
- есть denied-smsc-id, и он полностью совпадает с smsc-id из сообщения
- есть allowed-smsc-id-regex, но в сообщении нет smsc-id или он не совпадает с тем что в сообщении
- есть denied-smsc-id-regex и он совпадает с smsc-id из сообщения
@dynax60
dynax60 / gist:80db096112857f36ae96087511078f5b
Created January 21, 2021 11:35
To get a tags from the remote docker repository
View gist:80db096112857f36ae96087511078f5b
wget -q https://registry.hub.docker.com/v1/repositories/gitlab/gitlab-ce/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}' | egrep '^12.'
@dynax60
dynax60 / kafka-cheat-sheet.md
Created December 2, 2020 07:08 — forked from ursuad/kafka-cheat-sheet.md
Quick command reference for Apache Kafka
View kafka-cheat-sheet.md

Kafka Topics

List existing topics

bin/kafka-topics.sh --zookeeper localhost:2181 --list

Describe a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic

Purge a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000

... wait a minute ...

@dynax60
dynax60 / main.py
Created November 21, 2020 19:10
lg-android-shortcuts
View main.py
#!/usr/bin/env python
import os
import re
import sqlite3
from urllib.parse import unquote
def process(filename):
connection = sqlite3.connect(f'{filename}')
@dynax60
dynax60 / promo.py
Created September 15, 2020 18:25
Papa Johns promo code
View promo.py
bits='000011100010110100011011000011100010111100101011000011100010111000011111000011100010111000101111000011100010111100011001000011100010111000101110000011100010111000011100000011100010111100011001000011100010111000011001000011100010111000101100000011100010111000101100000011100010111000100001000011100010111100011010000011100010111100011011'
_bytes = [ int(bits[k:k+8],2) for k in range(0, len(bits), 8)]
for i in range(0, len(_bytes), 3):
byte1, byte2 = _bytes[i+1:i+3]
c = ((byte1 & 0x0f) << 4) | (byte2-0x20 if byte2 > 0x22 else byte2-0x19)
print(c.to_bytes(1, byteorder='little').decode('cp1251'), end="")