Skip to content

Instantly share code, notes, and snippets.

@vanodevium
vanodevium / Caddyfile
Created December 8, 2023 11:20
Caddy server: enable CORS for any domain
(cors) {
@cors_preflight method OPTIONS
header {
Access-Control-Allow-Origin "{header.origin}"
Vary Origin
Access-Control-Expose-Headers "Authorization"
Access-Control-Allow-Credentials "true"
}
@jimothyGator
jimothyGator / README.md
Last active December 20, 2024 09:08
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@dmfigol
dmfigol / asyncio_loop_in_thread.py
Last active December 20, 2024 09:08
Python asyncio event loop in a separate thread
"""
This gist shows how to run asyncio loop in a separate thread.
It could be useful if you want to mix sync and async code together.
Python 3.7+
"""
import asyncio
from datetime import datetime
from threading import Thread
from typing import Tuple, List, Iterable
/*
* Easy Files
* Written by Tam710562
*/
(() => {
'use strict';
const gnoh = {
stream: {
@tmo1
tmo1 / nextcloud-caddy-docker.md
Last active December 20, 2024 09:06
Nextcloud behind Caddy as a reverse proxy, using Docker

Introduction

This is a guide to deploying Nextcloud behind a Caddy reverse proxy, both running in Docker containers (an official Nextcloud one and a caddy-docker-proxy one), with the goal of implementing as much as possible via docker-compose files. This is much more difficult than it should be, for a variety of reasons:

  • As with Docker versions of software in general, documentation of the software does not always apply to the Docker versions, and the Docker documentation does not always include the Docker equivalent ways of doing things.

  • Docker images do not always expose the desired configuration knobs of the underlying software.

  • Nextcloud requires special configuration to run correctly behind a reverse proxy (and again, some of the instructions for this configuration requires modification for

@mvaisakh
mvaisakh / Bringup.md
Last active December 20, 2024 09:05
An Android Device Tree Bringup Guide

A small Device Tree Bringup Guide

Introduction

So, you guys might be wondering, how do these "Developers" get your favourite Custom roms, such as LineageOS, Paranoid Android etc., to their own devices. Well I'm here to Guide you on how to do it, specifically on how to bringup or make your own device tree from scratch or adapting.

Gist of this Guide: This is for people with genuine interest in Android OS porting/development. After going through this guide, you should be able to do a total device tree bringup on your own.

Prerequisite: Certain requirements are to be met before you start with this amazing journey.

@patrickstorm
patrickstorm / txt
Created June 17, 2024 21:04
Perfect Prompt Builder
You are an expert prompt engineer. Your task is to deeply understand what I want, and in return respond with a well crafted prompt that, if fed to a separate AI, will get me exactly the result I want.
The prompt follows this rough outline, and makes sure to include each part as needed:
1. A persona. At the start, you write something to the affect of "Act as an expert in ..." This primes the LLM to respond from info relating to experts in the specific field.
2. The task. This part of the prompt involves exhaustively laying out the task for the LLM. It is critical this part is specific and clear. This is the most important part of the prompt.
3. Context. Make sure to include *any* context that is needed for the LLM to accurately, and reliably respond as needed.
4. Response format. Outline the ideal response format for this prompt.
5. Examples. This step is optional, but if examples would be beneficial, include them.
6. Input. If needed, leave a space in the prompt for any input data. This should be highlight
@dopple10
dopple10 / gist:c28abe1a8c4a0cab638151f90dbcf2a8
Created December 16, 2024 13:36
Master Packager Pro 24.4.8894 Crack 2024 + License Key [Latest]
Master Packager Pro License Key
@MRW01F
MRW01F / ASLR_DEP.ps1
Created April 26, 2023 11:02
A powershell script to Enable/Disable, ASLR & DEP. Mainly for security testing purpose. !!! DO NOT RUN THIS SCRIPT ON PERSONAL/WORK DEVICE !!!
# Prompt the user for input
$choice = Read-Host "Enter 1 to enable DEP and ASLR, 2 to disable DEP and ASLR"
if ($choice -eq "1") {
# Enable DEP and ASLR
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" -Name "MoveImages" -Value 1
bcdedit.exe /set {current} nx AlwaysOn
Write-Host "DEP and ASLR have been enabled."
}
elseif ($choice -eq "2") {
@m1chaelwilliams
m1chaelwilliams / gist:a083b4b11dbf7fdd8444742a6934f930
Created December 19, 2024 21:52
script for searching cht.sh with fzf
#!/bin/bash
topic_constraint="none"
while [[ "$#" -gt 0 ]];do
case $1 in
l|lang)
topic_constraint="lang"
shift;;
esac