Skip to content

Instantly share code, notes, and snippets.

@zakkarry
zakkarry / xseed.sh
Last active May 26, 2025 02:20
#!/usr/bin/env bash
### UPDATED FOR SEASON PACK FROM USENET SUPPORT IN
### CROSS SEED v6 ONLY!! v5 IS NOT SUPPORTED FOR USENET
### SEASON PACKS AND WILL ALWAYS FAIL TO FIND MATCHES
### TO ENABLE THIS FEATURE YOU _MUST_ SWITCH TO THE
### ON IMPORT COMPLETE EVENT TYPE IN YOUR SONARR SETTINGS
# Load environment variables from .env file if it exists
# in the same directory as this bash script
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@ParkWardRR
ParkWardRR / install_searxng.sh
Last active May 26, 2025 02:10
This script automates the installation and setup of SearXNG using Podman on AlmaLinux. It includes steps to update the system, install Podman, pull the SearXNG Docker image, create necessary configuration files, and run the SearXNG container with the correct port mapping.
#!/bin/bash
# Filename: install_searxng.sh
# Description: This script automates the installation and setup of SearXNG using Podman on AlmaLinux.
# It includes steps to update the system, install Podman, pull the SearXNG Docker image, create necessary
# configuration files, run the SearXNG container with the correct port mapping, and set up a systemd service
# to ensure the container starts automatically on system boot.
# Update system
sudo dnf update -y
@brennanMKE
brennanMKE / IDETemplateMacros.plist
Last active May 26, 2025 02:09
Xcode File Header Templates
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>FILEHEADER</key>
<string>
// Copyright © ___YEAR___ ___ORGANIZATIONNAME___.
// All Rights Reserved.
</string>
<key>ORGANIZATIONNAME</key>
@tuelwer
tuelwer / pytorch-lbfgs-example.py
Last active May 26, 2025 02:09
pytorch-L-BFGS-example
import torch
import torch.optim as optim
import matplotlib.pyplot as plt
# 2d Rosenbrock function
def f(x):
return (1 - x[0])**2 + 100 * (x[1] - x[0]**2)**2
@ssugimoto
ssugimoto / Dockerfile
Created August 8, 2021 12:26
AWS Lambda and VSCode Remote container ,for Python3.8
FROM mcr.microsoft.com/vscode/devcontainers/python:3.8
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get -y install --no-install-recommends java-common zip \
&& wget https://corretto.aws/downloads/latest/amazon-corretto-8-x64-linux-jdk.deb \
&& dpkg --install amazon-corretto-8-x64-linux-jdk.deb \
&& wget https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip \
&& unzip awscli-exe-linux-x86_64.zip \
&& ./aws/install \
# Clean up
@fellipec
fellipec / pihole-dhcp.md
Last active May 26, 2025 02:03
Pi-Hole DHCP configuration guide

Introduction

Pi-Hole's primary function is to be a DNS server with the ability to block domains, usually used for advertising, tracking or other unwanted sites. It also features a built-in DHCP Server.

Usually, your router will also have a built-in DHCP server, pre-configured from factory, and for most users this is perfectly fine. But in some cases you may want to run another DHCP server instead of relying on your router's one. This guide will help you understand how a DHCP server works and how to configure it without disturbing your network.

If you already know the networking basics, you can cut to the chase and read just the configuration part

Understanding the IP Addressing

#!/usr/bin/env bash
# --slave /usr/bin/$1 $1 /usr/bin/$1-\${version} \\
function register_clang_version {
local version=$1
local priority=$2
update-alternatives \
--install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${version} ${priority} \
@slightfoot
slightfoot / page_turn.dart
Created September 9, 2019 21:28
Page Turn Effect - By Simon Lightfoot. Replicating this behaviour. https://www.youtube.com/watch?v=JqvtZwIJMLo
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@unphased
unphased / bat-lf-previewer.sh
Created April 15, 2025 13:56
bat-lf-previewer-final
#!/bin/bash
# lf Previewer Script with Caching for Performance
#
# Design Goals:
# 1. Fast Scrolling: Avoid re-running expensive generation (like bat) on every scroll.
# 2. Caching: Generate full preview content once per file version, store it.
# 3. Cache Invalidation: Use file modification time (mtime) in cache keys to automatically
# handle file changes.
# 4. Large File Handling: For text-based files, only process the head and tail lines for faster generation.
# 5. File Type Handling: Support various types (text, json, binary, compressed).