Skip to content

Instantly share code, notes, and snippets.

@kuguma
kuguma / mape-install.sh
Last active June 10, 2025 11:35
map-e scripts
cat >/root/mape-auto-restart.sh << 'EOF'
#!/bin/bash
run_mape_setup_script() {
if ping6 -c 1 google.com > /dev/null 2>&1; then
echo "ping6 google.com was successful."
/root/mape-setup.sh
echo "mape setup."
else
echo "ping6 google.com failed."
@pojntfx
pojntfx / main.sh
Last active May 16, 2025 03:04
Bluesky/AT Protocol: cURL API Interaction Cheatsheet
#!/bin/bash
# This script resolves a DID, retrieves an API key, fetches a user's feed,
# and posts a "Hello, world" message to the user's feed.
# Resolve DID for handle
HANDLE='felicitas.pojtinger.com'
DID_URL="https://bsky.social/xrpc/com.atproto.identity.resolveHandle"
export DID=$(curl -G \
--data-urlencode "handle=$HANDLE" \
@subrezon
subrezon / openwrt-on-proxmox.md
Last active June 14, 2025 05:25
How to set up an OpenWRT VM in Proxmox
  1. Go to OpenWRT release page, select the latest release stable release, then targets -> x86 -> 64. Right-click generic-ext4-combined.img.gz (not the "efi"!) and copy the link.

  2. On the Proxmox host, download the archive and unpack it:

wget *paste link here*
gunzip openwrt-*.img.gz
  1. Resize the image to be the size you want your VM's disk to be (example with 8 GiB):
@stephanlachnit
stephanlachnit / clean_apt-cacher-ng_cache.sh
Last active June 18, 2025 11:28
Clean apt-cacher-ng cache
#!/bin/sh
# Cleans apt-cacher-ng cache
# SPDX-FileCopyrightText: 2022 Stephan Lachnit <[email protected]>
# SPDX-License-Identifier: 0BSD
systemctl stop apt-cacher-ng
rm -rf /var/lib/apt/*
rm -rf /var/cache/apt/*
rm -rf /var/cache/apt-cacher-ng/
mkdir -p /var/cache/apt-cacher-ng/{headers,import,packages,private,temp}
chown apt-cacher-ng:apt-cacher-ng -R /var/cache/apt-cacher-ng
//vrchat_world_loader
//VRChatのワールドを順次キャッシュにロードするuwscスクリプト
//License: CC0
PUBLIC instance_id, check_interval, user_id
//使い方
// 下記のuser_idの「usr_xxx...」の部分に、自分のユーザIDを設定して保存し、
// 保存したスクリプトをUWSC.exeにドラッグ&ドロップして放置する。
// 数分おきにVRCウィンドウがアクティブになり、ワールドが自動でロードされる。
@TheNetJedi
TheNetJedi / ExportLambdaFunctions.sh
Last active December 24, 2024 17:44
Bash script to download all your Lambda functions.
#!/usr/bin/env bash
#You need to have aws-cli installed and configured
#Credits to Reddit user u/aa93 for the suggestions
mkdir code
aws lambda list-functions | \
grep FunctionName | \
cut -d '"' -f4 | \
while read -r name; do
aws lambda get-function --function-name $name | tail -n 3 | egrep -o 'https?://[^ ]+' | sed 's/"//' | xargs wget -O ./code/$name.zip
@uemuraj
uemuraj / kishou-xml.md
Last active November 15, 2021 03:21
気象庁防災情報XMLチュートリアル

気象庁防災情報XMLチュートリアル

気象庁防災情報XMLをご存知でしょうか。天気予報や警報を主に、多種多様な情報が気象庁から公開されています。
現在、ユーザ登録をすれば誰でも無料で受け取ることができます。
2020年8月で運用終了しました。

実際、どんな情報が来るのか簡単に見てみましょう。

@Roadmaster
Roadmaster / google-chrome-lxc.sh
Created October 18, 2017 21:16
Set up an lxc container with google chrome so it runs confined but displays on localhost.
#!/bin/bash
# Set up an lxc container with google chrome so it runs confined but displayed on the
# localhost.
# Adapted from https://blog.simos.info/how-to-run-graphics-accelerated-gui-apps-in-lxd-containers-on-your-ubuntu-desktop/
# Assume setguid/setid for root is properly setup
# root:1000:1
# Assume aptcache profile exists, see https://gist.github.com/Roadmaster/754110f3f49fef19ec89ae29f29edd11
LXC_NAME=chrome-container
@okapies
okapies / mastodon-ostatus.md
Last active September 5, 2021 11:39
Mastodon OStatus API の叩き方

Mastodon が他のインスタンスと情報交換をする OStatus API の使い方。使ってるだけのユーザは知る必要がない裏側の話。

host-meta

Mastodon インスタンスに対して、RFC6415 が規定する /.well-known/host-meta というパスを要求すると以下の XML が返ってくる.

<?xml version="1.0"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
  <Link rel="lrdd" type="application/xrd+xml" template="https://[MASTODON_HOST]/.well-known/webfinger?resource={uri}"/>
</XRD>
@nunomorgadinho
nunomorgadinho / gist:b2d8e5b8f5fec5b0ed946b24fa288a91
Created February 10, 2017 13:30
PHPCS + WordPress Coding Standards
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile