otl

joined 3 years ago
[–] otl@lemmy.sdf.org 1 points 2 years ago
[–] otl@lemmy.sdf.org 0 points 3 years ago (1 children)

Curious: why no leather? Is it for the rain? (I’m from Australia so I don’t have any really warm gloves)

 

The design goal of Pikchr is to enable embedded line diagrams in Markdown or other simple markup languages.

Cool project. Created by the same group as SQLite. The scripting language is based on pic(1) but outputs SVG instead of troff.

1
submitted 3 years ago* (last edited 3 years ago) by otl@lemmy.sdf.org to c/plan9@lemmy.sdf.org
 

Lemmy uses the packages olowe.co/lemmy (source), which provides a io/fs filesystem interface to a Lemmy instance, and 9fans.net/go/acme to interact with acme. What you get is an Acme Mail inspired program for Lemmy. As you can see, it's a work in progress!

But it's been fun so far. Sorry that this isn't running on Plan 9 (running on OpenBSD). I'm on the road at the moment and don't have a way to connect to a server right now!

 

I recently wrote a command-line utility lemmyverse to find communities indexed by Lemmy Explorer. A quick count shows almost 14%(!) of all communities indexed by lemmyverse are junk communities created by a single user @LMAO (reported here):

% lemmyverse . | wc -l
  30376
% lemmyverse enoweiooe | wc -l
   4206

Here's a python script, using no external dependencies, which uses Lemmy's HTTP API to delete all communities that @LMAO moderates:

#!/usr/bin/env python

import json
import urllib.parse
import urllib.request

baseurl = "https://lemmy.world"
username = "admin"
password = "password"

def login(user, passwd):
	url = baseurl+"/api/v3/user/login"
	body = urllib.parse.urlencode({
		"username_or_email": user,
		"password": passwd,
	})
	resp = urllib.request.urlopen(url, body.encode())
	j = json.load(resp)
	return j["jwt"]

def get_user(name):
	query = urllib.parse.urlencode({"username": name})
	resp = urllib.request.urlopen(baseurl+"/api/v3/user?"+query)
	return json.load(resp)

def delete_community(token, id):
	url = baseurl+"/api/v3/community/delete"
	params = {
		"auth": token,
		"community_id": id,
	}
	body = urllib.parse.urlencode(params)
	urllib.request.urlopen(url, body.encode())

token = login(username, password)
user = get_user("LMAO")
for community in user["moderates"]:
	id = community["community"]["id"]
	try:
		delete_community(token, id)
	except Exception as err:
		print("delete community id %d: %s" % (id, err))

Change username and password on lines 8 and 9 to suit.

Hope that helps! :) Thanks for the work you all put in to running this popular instance.

[–] otl@lemmy.sdf.org 1 points 3 years ago

In Australia on my 13,000+km ride I used a combo of paper maps and HEMA Offline Topo Maps. Paper maps are handy on long trips as when you're done with them, you can pass them on to someone else; less luggage. I brought my iPhone with me anyway but would leave it on aeroplane mode or just keep it off entirely if I knew where I was going. Battery lasts ages (several days) like that. Offline maps on the smartphone are handy for planning.