Skip to content

Instantly share code, notes, and snippets.

Avatar

Alice wheresalice

  • 17:44 (UTC +01:00)
View GitHub Profile
@wheresalice
wheresalice / imgur-to-rimgo.user.js
Last active February 10, 2023 19:43
Redirect Imgur links to rimgo to avoid endless hate scrolling. Working version as of January 2023
View imgur-to-rimgo.user.js
/*
DESCRIPTION: This is a file that after installing a greasemonkey
extension can be used to convert imgur to any rimgo instance.
NOTE: I might change this really often because instances may fail.
----
Copyright (C) 2021 Zortazert and other contributors
This program is free software: you can redistribute it and/or modify
@wheresalice
wheresalice / openapi.yaml
Created June 10, 2019 15:53
OpenAPI spec for Confluent Schema Registry
View openapi.yaml
openapi: 3.0.1
info:
title: Schema Registry
version: 5.2.1
description: Schema Registry provides a serving layer for your metadata. It provides a RESTful interface for storing and retrieving Avro schemas. It stores a versioned history of all schemas, provides multiple compatibility settings and allows evolution of schemas according to the configured compatibility settings and expanded Avro support. It provides serializers that plug into Apache Kafka® clients that handle schema storage and retrieval for Kafka messages that are sent in the Avro format.
externalDocs:
url: >-
https://docs.confluent.io/current/schema-registry/develop/api.html#schemaregistry-api
description: Confluent's API reference
paths:
View script.sh
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then
@wheresalice
wheresalice / .htaccess
Created February 25, 2011 15:56
webfont .htaccess rules
View .htaccess
# ----------------------------------------------------------------------
# Webfont access
# ----------------------------------------------------------------------
# allow access from all domains for webfonts
# alternatively you could only whitelist
# your subdomains like "sub.domain.com"
<FilesMatch "\.(ttf|otf|eot|woff|font.css)$">
<IfModule mod_headers.c>
@wheresalice
wheresalice / redisdns.py
Created November 27, 2011 12:56
Python DNS server with Redis backend
View redisdns.py
# A naive dns server with a Redis backend
# Set keys in Redis you want to be authoritative for (set google.com. 127.0.0.1)
# Tip: Use Redis's ttl functions to have temporary names
# Currently only does A records, feel free to fix that
#
# Licensed under the PSF License
# Thanks to: http://code.activestate.com/recipes/491264-mini-fake-dns-server/
# Author: @Kaerast <alice@kaerast.info>
import socket
@wheresalice
wheresalice / gist:2978019
Created June 23, 2012 11:54
Useful UK Train Tools
View gist:2978019

Free Tools

@wheresalice
wheresalice / rest_proxy.yaml
Last active April 14, 2022 08:28
Swagger OpenAPI spec for Confluent REST Proxy
View rest_proxy.yaml
openapi: 3.0.1
info:
title: REST Proxy API
description: >-
The Confluent REST Proxy provides a RESTful interface to a Kafka cluster, making it easy to produce and consume messages, view the state of the cluster, and perform administrative actions without using the native Kafka protocol or clients.
<p>Some example use cases are</p>
<ul>
<li>Reporting data to Kafka from any frontend app built in any language not supported by official Confluent clients</li>
<li>Ingesting messages into a stream processing framework that doesn’t yet support Kafka</li>
<li>Scripting administrative actions</li>
@wheresalice
wheresalice / settings.yml
Created March 13, 2022 10:56
Searxh settings
View settings.yml
general:
debug : False # Debug mode, only for development
instance_name : "searx" # displayed name
contact_url: False # mailto:contact@example.com
enable_stats: False # activate /stats page - note: it may leak usage data
brand:
git_url: https://github.com/searx/searx
git_branch: master
issue_url: https://github.com/searx/searx/issues
@wheresalice
wheresalice / gist:3780828
Created September 25, 2012 09:26
Show largest tables in MySQL and Postgresql
View gist:3780828
# MySQL
SELECT CONCAT(table_schema, '.', table_name),
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA,
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx,
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
ORDER BY data_length + index_length DESC
LIMIT 10;
View jenkins_last_good_commit.rb
require 'net/http'
require 'json'
# We could just use localhost, but it's nice to print usable urls in debug
@jenkins = `hostname`.strip
# Get the list of jobs on the Jenkins instance
res = Net::HTTP.get_response(URI('http://'+@jenkins+'/api/json'))
jobs = JSON.parse(res.body)['jobs']