Skip to content

Instantly share code, notes, and snippets.

@MasWag
MasWag / post_to_mastodon.org
Last active January 18, 2023 08:48
(Almost automatically generated by ChatGPT) Shell script to post to mastodon using curl

Mastodon Posting Script

This script allows you to post a message to Mastodon from the command line. It reads the message from the command line argument or standard input. It uses the curl command to interact with the Mastodon API.

Note

In order to use this script you need to create an encrypted token file called token.gpg in the directory ~/.config/mastodon/ and put your access token in it. You can encrypt the token using gpg.

@MasWag
MasWag / post_to_mastodon.py.org
Created January 18, 2023 03:25
(The document is automatically generated by ChatGPT) An org-mode document that can be tangled to a script to post to mastodon.

Mastodon Posting Script

This script allows you to post a message to Mastodon from the command line. It reads the message from the command line argument or standard input. It uses the Mastodon.py library to interact with the Mastodon API.

Note: Obtaining the Access Token

In order to use this script, you will need to register an application with your Mastodon instance and obtain an access token. Here are the general steps you will need to follow:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{automata, positioning}
\begin{document}
\begin{tikzpicture}
\node[state,initial,accepting] (q0) {$q_0$};
\node[state] (q1) at (1,2) {$q_1$};
\node[state] (q2) [below right=of q0] {$q_2$};
\path[->]
(q0) edge node[above left] {hoge} (q1)
@MasWag
MasWag / PKGBUILD
Last active November 24, 2022 08:54
PKGBUILD for linux kernel with rv support
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
pkgbase=linux-rv
pkgver=6.0.9.arch1
pkgrel=1
pkgdesc='Linux'
_srctag=v${pkgver%.*}-${pkgver##*.}
url="https://github.com/archlinux/linux/commits/$_srctag"
arch=(x86_64)
license=(GPL2)
#include <iostream>
using namespace std;
template<bool Flag>
class Hello {
public:
void hello() const {
if constexpr (Flag) {
std::cout << "Wahoooo\n";
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: loginwindow [171]
Path: /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow
Identifier: com.apple.loginwindow
Version: 9.0 (2062.5)
Build Info: loginwindow-2062005000000000~83
Code Type: X86-64 (Native)
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: clion [2049]
Path: /Applications/CLion.app/Contents/MacOS/clion
Identifier: com.jetbrains.CLion
Version: 2021.3.4 (CL-213.7172.20)
Code Type: X86-64 (Native)
Parent Process: launchd [1]
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: Activity Monitor [1633]
Path: /System/Applications/Utilities/Activity Monitor.app/Contents/MacOS/Activity Monitor
Identifier: com.apple.ActivityMonitor
Version: 10.14 (1097)
Build Info: ActivityMonitor-1097000000000000~1413
Code Type: X86-64 (Native)
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: Activity Monitor [1633]
Path: /System/Applications/Utilities/Activity Monitor.app/Contents/MacOS/Activity Monitor
Identifier: com.apple.ActivityMonitor
Version: 10.14 (1097)
Build Info: ActivityMonitor-1097000000000000~1413
Code Type: X86-64 (Native)
panic(cpu 7 caller 0xffffff80143d38f3): Kernel trap at 0xffffff801436fe62, type 14=page fault, registers:
CR0: 0x000000008001003b, CR2: 0xffffff7f80008020, CR3: 0x0000000423d0f18e, CR4: 0x00000000003626e0
RAX: 0xffffff802be00000, RBX: 0xffffff7f80008000, RCX: 0xffffff7f80000000, RDX: 0x0000000044aa2000
RSP: 0xffffffd07f0137b0, RBP: 0xffffffd07f0137e0, RSI: 0xffffff9529c10550, RDI: 0x0000000000000000
R8: 0xffffff80143c8020, R9: 0x0000000000000001, R10: 0x00000000000effef, R11: 0xffffff7f80000000
R12: 0xffffff8029a00000, R13: 0x00000000169480d0, R14: 0x00000000021a7000, R15: 0xffffff8525203400
RFL: 0x0000000000010286, RIP: 0xffffff801436fe62, CS: 0x0000000000000008, SS: 0x0000000000000010
Fault CR2: 0xffffff7f80008020, Error code: 0x0000000000000000, Fault CPU: 0x7, PL: 1, VF: 5
Panicked task 0xffffff8b8dfeda20: 68 threads: pid 989: Dropbox