From the Proxmox Forum
pct list
pct stop 999
#!/usr/bin/env ruby | |
require 'bundler/inline' | |
#gemfile do | |
# source 'https://rubygems.org' | |
# gem 'zip' | |
# gem 'nokogiri' | |
# gem 'tty-prompt' | |
# gem 'debug' |
def zzz | |
t = `pbpaste` | |
`echo "#{t.split.map {|t| t.tr(',', '') }.join(', ')}" | pbcopy` | |
end | |
From the Proxmox Forum
pct list
pct stop 999
#... | |
WORKDIR /rails | |
#... | |
# https://github.com/libjxl/libjxl/blob/main/BUILDING.md | |
FROM base as buildjxl | |
ENV CC=clang | |
ENV CXX=clang++ | |
RUN apt-get update -qq && \ | |
apt-get install --no-install-recommends -y git cmake pkg-config libbrotli-dev libgif-dev libjpeg-dev libopenexr-dev libpng-dev libwebp-dev clang make build-essential && \ |
Feedjira.parse(URI.open("https://blog.booko.com.au/feed/").read).entries.max_by {|e| e.categories.max_by {|c| c.length }.then {|c| c.length } } |
# https://isni.org/page/linked-data/ | |
# https://isni.oclc.org:2443/isni/public_export/ISNI_persons.jsonld.gz | |
wget https://isni.oclc.org:2443/isni/public_export/ISNI_persons.jsonld.gz | |
# The file I downloaded was full of the 0x1E character, or ^^ in ASCII. This will strip that | |
sed 's/\x1E//g' ISNI_persons.jsonld > cleaned_ISNI_persons.jsonld | |
# Then use JQ to convert the file into the way more sane JSONL format. By default, it tries to read it all into |
def random_isbn13 | |
isbn12 = rand(978_000_000_000..979_999_999_999).to_s | |
chksum = (10 - isbn12.each_char.with_index.sum { |digit, i| digit.to_i * (i.even? ? 1 : 3) } % 10 ) % 10 | |
"#{isbn12}#{chksum}" | |
end | |
def risbn13 = rand(978_000_000_000..979_999_999_999).then {|isbn12| "#{isbn12}#{(10 - isbn12.to_s.each_char.with_index.sum { |digit, i| digit.to_i * (i.even? ? 1 : 3) } % 10 ) % 10}" } |
class Favicon | |
def initialize(doc, url: nil) | |
@doc = doc | |
@url = if url | |
@url = URI(url.to_s) | |
elsif canonical | |
URI(canonical) | |
else |
# This ( https://gist.github.com/hatarist/675dc3debf6cf5f825b5c15aed4cbac0 ) with TOAST size formatting | |
SELECT | |
table_name, | |
pg_size_pretty(table_bytes) AS table, | |
pg_size_pretty(index_bytes) AS index, | |
pg_size_pretty(toast_bytes) AS toast, | |
pg_size_pretty(total_bytes) AS total | |
FROM ( | |
SELECT |
#!/usr/bin/env ruby | |
require 'cgi' | |
require 'net/http' | |
require 'json' | |
abort("songlink <url>") if ARGV[0].nil? | |
def copy_to_clipboard(text) = IO.popen('pbcopy', 'w') { |clipboard| clipboard.puts text } |