Skip to content

Instantly share code, notes, and snippets.

View alyssadev's full-sized avatar

Aly Smith alyssadev

View GitHub Profile
blueprint:
name: Send a camera snapshot when motion is detected
description: >
This automation blueprint creates a camera snapshot if motion is detected
and sends a notification to your phone with the picture.
based on https://community.home-assistant.io/t/send-camera-snapshot-notification-on-motion/254565
domain: automation
input:
motion_sensor:
name: Motion sensor
@alyssadev
alyssadev / DedicatedServerAPIDocs.md
Created September 12, 2024 00:20
Satisfactory 1.0 API Documentation (from Satisfactory/CommunityResources/DedicatedServerAPIDocs.md)

Introduction

Dedicated Server API consists of two separate endpoints, both operating on the same port as the game server, which is normally 7777. If the server port is changed (through Engine.ini configuration file, or through -Port= command line argument), the API will listen on the specified port instead.

Dedicated Server API endpoints:

  • Dedicated Server Lightweight Query API is a simple UDP protocol designed for polling the server state through UDP continuously with minimal overhead.
  • Dedicated Server HTTPS API is a HTTPS server serving the requests to retrieve the more detailed state of the server, and control it's behavior.
#!/bin/bash
# mkdist.sh
apt update; apt install -y jq libfuse2 wget file
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x *.AppImage
mkdir discord
cd discord
wget https://discord.com/api/download\?platform\=linux\&format\=tar.gz
mv * discord.tar.gz
tar -xf discord.tar.gz

Keybase proof

I hereby claim:

  • I am alyssadev on github.
  • I am alyssile (https://keybase.io/alyssile) on keybase.
  • I have a public key whose fingerprint is 4304 1865 9397 3CC0 FBF0 A109 F4D2 C7A4 26DD A1BD

To claim this, I am signing this object:

@alyssadev
alyssadev / fedipost.py
Last active October 24, 2023 03:23
a script to forward fediverse posts from a jsonfeed url to a discord webhook, optionally filtering by keyword/hashtag
#!/usr/bin/env python3
# usage: fedipost.py jsonfeed_url webhook_url [filter_text]
# e.g: fedipost.py https://blahaj.zone/@alypet.json webhook #alyblog
from markdownify import markdownify
from requests import get,post
import os, sys
WH = sys.argv[2]
try:
@alyssadev
alyssadev / _firstboot.js
Last active October 17, 2023 16:13
My bitburner scripts. adapted from alain mostly
/** @param {NS} ns */
// script to be run after each augment to recover hack level and money
// 1. run scan.js, backdoor n00dles and foodnstuff using the links provided
// 2. run this script, starts hacking those servers
// 3. once you have 200k, go to aevum, then run alain/casino.js
// 3a. go to tech store, buy darkweb, connect darkweb, buy -a
// 4. run scan.js, nuke and backdoor all available servers
// 5. run purchase.js, update with higher ram allowance (32>2048) if you have enough money
// * run delete-pserv.js if there's an issue with buying the servers
// 6. run init.js, this will boot up stockmaster and stats, as well as starting the hack scripts running across all pservs and home
@alyssadev
alyssadev / ssh-setup.sh
Last active September 27, 2023 08:00
A script to pull .ssh authorized_keys and config from a repository and update the current user's .ssh with them.
#!/bin/bash -x
# curl s.aly.pet/ssh-setup | GIT_HOSTNAME=dotfiles.example.com GIT_USERNAME=you GIT_PASSWORD=password bash -x
if [ -z $GIT_HOSTNAME ]; then
echo -n "Git hostname: "
read -s GIT_HOSTNAME
fi
if [ -z $GIT_USERNAME ]; then
echo -n "Git username: "
read -s GIT_USERNAME
fi
@alyssadev
alyssadev / configuration.yml
Last active December 31, 2023 17:03
My Authelia setup https://auth.aly.pet
# authelia/config/configuration.yml
# run `openssl rand -hex 20` three times and update `jwt_secret`, `session.secret` and `storage.encryption_key`
server:
host: 0.0.0.0
port: 9091
log:
level: info
jwt_secret: TODO
default_redirection_url: https://auth.example.com
totp:
#!/usr/bin/env python3
import requests
from datetime import datetime, timedelta
with open(".bottoken") as f:
token = f.read().strip()
t = '\u2705'
f = '\u274c'
class Channel:
@alyssadev
alyssadev / aoc1.py
Created December 1, 2022 13:24
aoc 2022
with open("aoc1.txt") as f:
data = f.read().strip()
elves = [list(map(int,_.split("\n"))) for _ in data.split("\n\n")]
ans1 = max(sum(_) for _ in elves)
ans2 = sum(sorted(sum(_) for _ in elves)[-3:])
print(ans1,ans2)