Skip to content

Instantly share code, notes, and snippets.

@bohwaz
bohwaz / dns_get_record_from.php
Last active November 21, 2023 07:56
PHP script to retrieve a DNS record from a custom nameserver
<?php
/**
* Make a DNS a request to a custom nameserver, this is similar to dns_get_record, but allows you to query any nameserver
* Usage: dns_get_record_from('ns.server.tld', 'A', 'mydomain.tld');
* => ['42.42.42.42']
* @author bohwaz
*/
function dns_get_record_from(string $server, string $type, string $record): array
{
@alexdanilowicz
alexdanilowicz / queries.sql
Last active March 15, 2023 01:49
sql queries to read chat.db file
-- author: alex.danilowicz@gmail.com
-- SQlite Queries to Read chat.db file
-- top 5 sent / receieved words, just pass is_from_me as param
WITH RECURSIVE split_text(guid, text, etc) AS
(
SELECT
m.guid, '', m.text || ' '
FROM message m
-- make sure the text isn't blank
@ivan
ivan / grab-anchor-episode.sh
Last active June 14, 2023 19:54
Download a podcast episode from anchor.fm
#!/usr/bin/env bash
# Download a podcast episode from anchor.fm
#
# Usage:
# grab-anchor-episode "https://anchor.fm/emerge/episodes/Robert-MacNaughton---Learnings-from-the-Life-and-Death-of-the-Integral-Center-e31val" # (m4a example)
# grab-anchor-episode "https://anchor.fm/free-chapel/episodes/Are-You-Still-In-Love-With-Praise--Pastor-Jentezen-Franklin-e19u4i8" # (mp3 example)
#
# anchor.fm serves a list of m4a or mp3 files that need to be concatenated with ffmpeg.
#