Skip to content

Instantly share code, notes, and snippets.

@Stanback
Stanback / nginx.conf
Last active March 29, 2024 10:20 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@rserafim
rserafim / next.config.js
Created December 3, 2023 17:01
Next Config redirects Bots
const withPWA = require('next-pwa')
module.exports = withPWA({
async redirects() {
return [
{
source: "/(.*)",
has: [
{
type: "header",
key: "User-Agent",
@caruccio
caruccio / migrate-pv-to-zone.sh
Last active March 29, 2024 10:17
Migrate EBS Volume based PVs across AWS availability zones
#!/bin/bash
if [ $# -lt 6 ]; then
echo "Usage: $0 [source-namespace] [source-pvc-name] [target-namespace] [target-pvc-name] [target-aws-zone] [target-pv-name] [kind/workload=None]"
echo "Clone EBS, PV and PVC from source to target. Will stop kind/workload if defined."
exit
fi
set -eu
@OrionReed
OrionReed / DOM3D.js
Last active March 29, 2024 10:17
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@Stevoisiak
Stevoisiak / SO-7zip-extract-icon
Created March 6, 2017 19:38
Extract .ico icon file from .exe with 7zip
You can extract .ico icons from an exe with 7-zip!
@xen0n
xen0n / check-new-world.tiny.s
Last active March 29, 2024 10:12
Tiny helper checking for LoongArch new world UAPI
# SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#
# how to build this:
#
# $ as -o check-new-world.tiny.o check-new-world.tiny.s
# $ ld check-new-world.tiny.o -o check-new-world.tiny.tmp
# $ objcopy -O binary --only-section=.blob ./check-new-world.tiny.tmp ./check-new-world.tiny
.section ".blob", "aw", @progbits
@Cartexius
Cartexius / install_gtest_ubuntu.md
Last active March 29, 2024 10:11
Install gtest in Ubuntu
@BenjaminPoncet
BenjaminPoncet / ffmpeg-wrapper
Last active March 29, 2024 10:11
Synology VideoStation ffmpeg wrapper with DTS, EAC3 and TrueHD support. This project is no longer maintained: Please see the following projects: https://github.com/darknebular/Wrapper_VideoStation/ - https://github.com/AlexPresso/VideoStation-FFMPEG-Patcher
#!/bin/bash
rev="12"
_log(){
echo "$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - $1" >> /tmp/ffmpeg.log
}
_log_para(){
echo "$1" | fold -w 120 | sed "s/^.*$/$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - = &/" >> /tmp/ffmpeg.log
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active March 29, 2024 10:10 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active March 29, 2024 10:08
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line