Skip to content

Instantly share code, notes, and snippets.

<?php
require __DIR__.'/vendor/autoload.php';
set_time_limit(600);
$app = require_once __DIR__.'/bootstrap/app.php';
$app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap();
use Statamic\Facades\Stache;
use Statamic\Facades\Entry;
@hastinbe
hastinbe / rc.inet1
Created December 6, 2024 22:22
Dynamic File Descriptor Limit for dhcpcd on Unraid OS 6.12.12. Modified script to dynamically calculate and set the nofile limit for dhcpcd based on the number of network interfaces. Ensures child processes inherit appropriate limits to prevent warnings in tools like Netdata.
#!/bin/sh
# /etc/rc.d/rc.inet1
# This script is used to bring up the various network interfaces.
#
# @(#)/etc/rc.d/rc.inet1 10.2 Sun Jul 24 12:45:56 PDT 2005 (pjv)
# Adapted by Bergware for use in unRAID - April 2016
# - improved interface configuration
# - added VLAN (sub-interface) support
# - removed wireless (unsupported)
@hastinbe
hastinbe / qbittorrent_hash.py
Created January 9, 2024 15:20
Generates a PBKDF2 hash for qBittorrent WebUI password. This is useful for setting the password in the config file.
#!/usr/bin/env python
#
# Generates a PBKDF2 hash for qBittorrent WebUI password. This is useful for setting the password in the config file.
#
# NOTE: Hashing algorithm must match https://github.com/qbittorrent/qBittorrent/blob/master/src/base/utils/password.cpp
#
# Usage: python qbittorrent_hash.py
#
# Author: Beau Hastings (https://github.com/hastinbe)
# Date: 2024-01-09
@hastinbe
hastinbe / 0_main.dart
Created January 1, 2021 13:07 — forked from boformer/0_main.dart
Flutter Service Architecture
import 'package:architecture_playground/home_page.dart';
import 'package:architecture_playground/services.dart';
import 'package:flutter/material.dart';
void main() async {
// perform long-running tasks before "runApp" to display the native splash screen
final services = await Services.initialize();
runApp(ServicesProvider(
services: services,
*.html diff=html
*.inc diff=php
*.php diff=php
*.phtml diff=php
@hastinbe
hastinbe / gist:fa77f41c68d7a014394f281721450fa4
Created July 14, 2017 20:55 — forked from pmknutsen/gist:7521a29fe8125c24eb3e
HOWTO Run Sia host on Ubuntu server
#HOWTO Run Sia host on Ubuntu server
#Updated: 13 august, 2016
#Tested with Sia 1.0.2 and Ubuntu 16.04
#Update 13.08.2016: Changed from using supervisor to systemd
# Create user `siad`
adduser siad
su siad
@hastinbe
hastinbe / auto-sellpower.js
Last active April 28, 2017 03:03
Auto-sell power in Reactor Idle
const DEFAULT_SELL_DELAY_IN_SECONDS = 60;
function showReactorMenu() {
$('#reactorsButton').click();
}
function selectReactor(name) {
var reactors = $('.reactorSelect');
var reactor = reactors.find('.description:contains("' + name + '")').parent();
var selectButton = reactor.children('.button');
defmodule Terraria.IO.WorldFile do
@moduledoc false
import Terraria.BinaryUtils
use Bitwise, only_operators: true
alias Terraria.IO.FileData
alias Terraria.IO.FileMetadata
alias Terraria.IO.WorldFileData
Current map: orig.wld
Current release: 156
Map release: 156
File type: World
Revision: 1120
IsFavorite? N
World name: PTS 151003, ID=1246390825
World rect: left=0 right=134400 top=0 bottom=38400
Max tiles: X=8400 Y=2400
Expert? N
@hastinbe
hastinbe / fixup-ids.sh
Created October 15, 2015 01:25
Cleans up decompiled TerrariaServer code
#!/bin/bash
#
# fixup-ids
#
# Searches and replaces integer literals with their equivalent enumerated type
#
# Requires:
# dos2unix
# GNU awk >= 4.1.0
#