Skip to content

Instantly share code, notes, and snippets.

@dillera
dillera / HTTP.cpp
Created May 11, 2024 01:06
refactored http.cpp
NetworkProtocolHTTP::~NetworkProtocolHTTP()
{
for (int i = 0; i < collect_headers_count; i++)
if (collect_headers[i] != nullptr)
{
free(collect_headers[i]);
collect_headers[i] = nullptr;
}
}
@dillera
dillera / create-startup.bash
Created November 22, 2023 20:46
A bash script that will create a systemd startup file using local env vars for security
#!/bin/bash
#
# create flask startup scripts for flask apps.
# a typical path: /home/ubuntu/yourProject
# with a venv at: /home/ubuntu/yourProject/venv
#
# adiller oct 2023
#
#################################################################
# Function to display usage notes
@dillera
dillera / gist:3efa529674685b2d23e996fff29d54cc
Created September 19, 2023 13:52
simple openAI translation service
python3 -m venv venv
source venv/bin/activate
pip install Flask openai
python ./app.py
----------------------------------------------
from flask import Flask, request, jsonify
@dillera
dillera / mastodon_backup.sh
Created December 23, 2022 21:06 — forked from nolanlawson/mastodon_backup.sh
Script to back up a Mastodon instance (for non-dockerized installs)
#!/usr/bin/env bash
#
# Make a backup file of a Mastodon instance. The backup file is a TGZ containing
# the Postgres dump as well as the /public/system (media) files and the
# .env.production file. For loading the dump file contents, see:
# https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Migration-guide.md
#
# Usage: ./mastodon_backup.sh my_dump_file.tgz
#
# Advanced usage: MASTODON_LIVE_DIRECTORY=/path/to/live ./mastodon_backup.sh my_dump_file.tgz
brew install cask maestral
brew install cask microsoft-edge
brew install google-chrome
brew install firefox
brew install vivaldi
brew install cask slack
brew install cask discord
#!/usr/local/bin/bash
# chddeck_osx.sh for Macintosh OSX 2022
# original script from https://www.emudeck.com/ EmuDeck installation.
# https://github.com/dragoonDorise/EmuDeck/blob/main/tools/chdconv/chddeck.sh
# modified to run on a local copy of ROM files to compress them before installing on SteamDeck
#
# N O T E S:
#
# install chdman from brew! You need this for the script to do anything...
'########:'##::::'##:::::::'##:'####:'##::: ##:'########:'########:
##.....:: ##:::: ##::::::: ##:. ##:: ###:: ##: ##.....::... ##..::
##::::::: ##:::: ##::::::: ##:: ##:: ####: ##: ##:::::::::: ##::::
######::: ##:::: ##::::::: ##:: ##:: ## ## ##: ######:::::: ##::::
##...:::: ##:::: ##:'##::: ##:: ##:: ##. ####: ##...::::::: ##::::
##::::::: ##:::: ##: ##::: ##:: ##:: ##:. ###: ##:::::::::: ##::::
##:::::::. #######::. ######::'####: ##::. ##: ########:::: ##::::
..:::::::::.......::::......:::....::..::::..::........:::::..:::::
-----------------------
#!/usr/sgug/bin/bash
# This script should be run as your user!
# Some useful variables
build_progress_dir="/usr/people/edodd/btw/tiny_build/output/PROGRESS"
sgug_rse_srpm_archive_root="/usr/people/edodd/rpmbuild/SRPMS"
sgug_rse_git_root="/usr/people/edodd/btw/tiny_build/sgug-rse.git"
sgug_rse_srpm_output_root="/usr/people/edodd/btw/tiny_build/output/SRPMS"
sgug_rse_rpm_output_root="/usr/people/edodd/btw/tiny_build/output/RPMS"
_rpmbuild=$1
if [[ -z $_rpmbuild ]] ; then
7:11:54.942 > Entering iwmDisk::mount - /APPLE/GAMES/CHOPLIFTER.PO
17:11:54.942 >
17:11:54.942 > Looking for Media Type- should be a PO image...
17:11:54.944 > Media Type PO
17:11:54.946 > idle
17:11:54.948 > enable
17:11:54.948 > f3 fc ff ff ff c3 83 80 80 80 80 82 81 80 84 83 90 c1 d1 f9 80 80 80 80 ee bf c8
17:11:54.949 > handling control command
17:11:54.949 > Device 83 Control Code f9
17:11:54.950 > Control List is at 41 51
@dillera
dillera / 332-ip12.txt
Last active February 28, 2022 21:38
IRIX 4D1 3.3.2 Full Install on IP12
______________________________________________________________________________
8888888888 Y88b d88P
888 Y88b d88P
888 Y88o88P
8888888 Y888P
888 d888b
888 d88888b