Skip to content

Instantly share code, notes, and snippets.

@odan
odan / mysq_uuid_v4.md
Last active May 10, 2024 15:31
Generating UUID v4 in MySQL

Generating UUID v4 in MySQL

SELECT
  LOWER(
    CONCAT(
      # 1th and 2nd block are made of 6 random bytes
      HEX(RANDOM_BYTES(4)),
      '-',
 HEX(RANDOM_BYTES(2)),
@nasirhafeez
nasirhafeez / openvpn-server-for-mikrotik-on-docker.md
Last active August 20, 2024 06:49
OpenVPN Server for Mikrotik on Docker
@adamsrog
adamsrog / mg-webhook.php
Last active September 6, 2020 12:24
Mailgun webhook for delivering messages to Telegram Channel
<?php
// check for POST method
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// get payload data
$post = json_decode(file_get_contents('php://input'), true);
$signature = $post['signature'];
$data = $post['event-data'];
$key = "MAILGUNAPIKEY";
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active September 22, 2024 15:21
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active September 19, 2024 19:00
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@slav0nic
slav0nic / backports.pref
Last active May 26, 2022 08:36
debian bullseye sources.list
Package: *
Pin: release n=bullseye-backports
Pin-Priority: 900