This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
begin | |
require 'minisky' | |
rescue LoadError | |
puts "Install minisky: '[sudo] gem install minisky'" | |
exit 1 | |
end | |
require 'time' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# to install minisky: `gem install minisky` | |
require 'minisky' | |
list_id = ARGV[0] | |
if list_id.nil? | |
puts "Usage: #{$PROGRAM_NAME} <list_rkey>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Munin graph CGI | |
After=network.target syslog.target | |
[Service] | |
Type=simple | |
User=root | |
ExecStart=/usr/bin/spawn-fcgi -n -s /var/run/munin/fastcgi-graph.sock -u www-data /usr/lib/munin/cgi/munin-cgi-graph | |
TimeoutSec=15 | |
Restart=on-failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
## gem install minisky | |
require 'minisky' | |
sky = Minisky.new('api.bsky.app', nil, progress: '.') | |
joe_follows = sky.fetch_all('app.bsky.graph.getFollows', { actor: 'mergesort.me', limit: 100 }, field: 'follows') | |
ap_followers = sky.fetch_all('app.bsky.graph.getFollowers', { actor: 'ap.brid.gy', limit: 100 }, field: 'followers') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "$1" = "config" ]; then | |
echo "graph_title Bluesky firehose events" | |
echo "graph_category bluesky" | |
echo "graph_vlabel Events per second" | |
echo "graph_args --base 1000 -l 0" | |
echo "events.label Events" | |
echo "events.type DERIVE" | |
echo "events.min 0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'skyfall' | |
AVG_EVENTS_PER_SEC = 50 | |
desc "Download a part of the firehose cache to a file" | |
task :fetch do | |
current_head = nil | |
sky = Skyfall::Stream.new(ENV['FIREHOSE'] || 'bsky.network', :subscribe_repos) | |
sky.on_message do |m| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# "proper" way, more future- and federation-proof | |
handle = form.get('handle') | |
password = form.get('password') | |
if dns_record = lookup_dns("_atproto.#{handle}") | |
did = did_from_dns(dns_record) | |
elsif res = open_url("https://#{handle}/.well-known/atproto-did") | |
did = did_from_well_known(res) | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Created by Kuba Suder on 25/04/2023 | |
# Licensed under WTFPL License | |
require 'json' | |
require 'net/http' | |
require 'open-uri' | |
require 'set' | |
require 'time' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Bluesky.swift | |
// Created by Kuba Suder on 24/04/2023. | |
// Licensed under WTFPL License | |
// | |
import Foundation | |
struct LoginData: Encodable { | |
let identifier: String |
NewerOlder