Skip to content

Instantly share code, notes, and snippets.

@vitiko98
vitiko98 / get_keys.py
Last active September 17, 2025 20:31
Get Qobuz App ID and Secrets
from qobuz_dl.bundle import Bundle
bundle = Bundle()
app_id = bundle.get_app_id()
secrets = "\n".join(bundle.get_secrets().values())
print(f"App ID: {app_id}")
print("#" * 20)
@dunderrrrrr
dunderrrrrr / GeoIP Block NGINX Ubuntu 20.04.md
Created April 19, 2021 08:28
Allow or block GeoIP in Nginx on Ubuntu 20.04

GeoIP Block NGINX Ubuntu 20.04

Block or filter IPs based on location in Nginx (tested on 1.18.0) on Ubuntu 20.04.

Install Nginx modules

To make use of the geographical filtering, we must first install the Nginx GeoIP module as well as the GeoIP database containing the mappings between visitors’ IP addresses and their respective countries. To do so, let’s execute:

$ sudo apt install libnginx-mod-http-geoip geoip-database
@tkim90
tkim90 / http.ts
Last active September 27, 2023 13:00
typescript fetch pattern
// Source: https://www.carlrippon.com/fetch-with-async-await-and-typescript/
// Source: https://eckertalex.dev/blog/typescript-fetch-wrapper
interface HttpResponse<T> extends Response {
parsedBody?: T;
error?: T;
}
export async function http<T>(request: RequestInfo): Promise<HttpResponse<T>> {
const response: HttpResponse<T> = await fetch(request);
@vasilakisfil
vasilakisfil / deadpool_postgres.rs
Created July 20, 2020 11:48
deadpool postgres simple setup
use deadpool_postgres::tokio_postgres::NoTls;
use deadpool_postgres::{Config, ManagerConfig, Pool, PoolError, RecyclingMethod};
use once_cell::sync::Lazy;
use std::sync::Arc;
static DB_POOL: Lazy<Arc<Pool>> = Lazy::new(|| {
let mut cfg = Config::new();
cfg.dbname = Some(
std::env::var("DATABASE_URL")
.map_err(|_| String::from("Environment variable Database URL could not be read"))
@dnozay
dnozay / My Exiftool Cheatsheet.md
Last active May 17, 2025 20:25 — forked from rjames86/My Exiftool Cheatsheet.md
Cheatsheet for image / video metadata manipulation.

Cheatsheet for image / video metadata manipulation.

Last updated 2019-07-24

Disclaimer

until more specific license...

THE CONTENT BELOW IS PROVIDED "AS-IS",
WE DISCLAIM LIABILITY FOR ALL USES TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW.
# frozen_string_literal: true
require 'rails_helper'
RSpec.configure do |config|
config.use_transactional_fixtures = false
# DatabaseCleaner settings
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
@mehaase
mehaase / sshtranger_things.py
Last active August 26, 2024 10:28
SSHtranger Things Exploit POC
'''
Title: SSHtranger Things
Author: Mark E. Haase <mhaase@hyperiongray.com>
Homepage: https://www.hyperiongray.com
Date: 2019-01-17
CVE: CVE-2019-6111, CVE-2019-6110
Advisory: https://sintonen.fi/advisories/scp-client-multiple-vulnerabilities.txt
Tested on: Ubuntu 18.04.1 LTS, OpenSSH client 7.6p1
We have nicknamed this "SSHtranger Things" because the bug is so old it could be
@sevaldes
sevaldes / sidekiq_cleaner.rb
Created December 4, 2017 13:46
Clear Sidekiq data
# inside a rails console
Sidekiq.redis { |conn| conn.flushdb }
@subfuzion
subfuzion / curl.md
Last active November 6, 2025 06:24
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

// Kotlin + HttpURLConnection
val connection = URL("https://api.github.com/user").openConnection() as HttpURLConnection
val auth = Base64.getEncoder().encode("user:pass".toByteArray()).toString(Charsets.UTF_8)
connection.addRequestProperty("Authorization", "Basic $auth")
connection.connect()
println(connection.responseCode)
println(connection.getHeaderField("Content-Type"))
val text = connection.inputStream.use { it.reader().use { reader -> reader.readText() } }
println(text)