Skip to content

Instantly share code, notes, and snippets.

View mark99i's full-sized avatar
😀

Mark mark99i

😀
View GitHub Profile
def ip2hex(cidr, router):
addr, mask = cidr.split("/")
mask = int(mask)
addr = [("%2s" % hex(int(i))[2:]).replace(" ", "0") for i in addr.split(".") if i != "0"]
parts = mask/8 - len(addr)
if mask%8 > 0:
parts += 1
if parts > 0:
for i in range(int(parts)):
addr.append("00")
@sergei-mironov
sergei-mironov / vkontakte_m3u8_downloader.sh
Last active October 21, 2023 20:04
vkontakte_m3u8_downloader.sh
#!/bin/sh
# VKontakte *m3u8 downloader
# Worked at the time of writing
mkdir /tmp/m3u8
set -e -x
cd /tmp/m3u8
rm *