Skip to content

Instantly share code, notes, and snippets.

@jikamens
jikamens / auto-dnsbl.pl
Last active February 17, 2023 05:07
auto-dnsbl.pl (iptables version)
#!/usr/bin/env perl
=pod
=head1 SUMMARY
auto-dnsbl.py - add DNSBL entries to iptables automatically
=head1 DESCRIPTION
@aymericbeaumet
aymericbeaumet / delete-likes-from-twitter.md
Last active May 3, 2024 11:24
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
@cschiewek
cschiewek / x11_docker_mac.md
Last active May 2, 2024 17:53
X11 in docker on macOS

To forward X11 from inside a docker container to a host running macOS

  1. Install XQuartz: https://www.xquartz.org/
  2. Launch XQuartz. Under the XQuartz menu, select Preferences
  3. Go to the security tab and ensure "Allow connections from network clients" is checked.
  4. Run xhost + ${hostname} to allow connections to the macOS host *
  5. Setup a HOSTNAME env var export HOSTNAME=`hostname`*
  6. Add the following to your docker-compose:
 environment:
@pstoll
pstoll / remsh.erl
Created July 25, 2013 17:11 — forked from davisp/remsh.erl
#! /usr/bin/env escript
%%! -hidden -noshell -noinput
-mode(compile).
-export([
init_shell_log/1
]).

Windows Azure "ResourceProvider" Design

This doc outlines how to create a ResourceProvider to integrate Cloudant into the Microsoft Azure markertplace.

What?

Microsoft requires us to have a ResourceProvider (RP) that responds to HTTP requests, in order to mediate requests around Subscriptions and Resources.

Subscriptions are roughly analogous to a Cloudant account, while Resources equivocate to databases. The ResourceProvider must provide CRUD operations against both of these entity types. Various gotchas complicate this:

@juanje
juanje / gist:3797297
Created September 28, 2012 00:38
Mount apt cache of a Vagrant box in the host to spin up the packages installation

This is a little trick I use to spin up the packages instalation on Debian/Ubuntu boxes in Vagrant.

I add a simple function that checks if a directory named something similar to ~/.vagrant.d/cache/apt/opscode-ubuntu-12.04/partial (it may have another path in Windows or MacOS) and create the directory if it doesn't already exist.

def local_cache(basebox_name)
  cache_dir = Vagrant::Environment.new.home_path.join('cache', 'apt', basebox_name)
  partial_dir = cache_dir.join('partial')
  partial_dir.mkdir unless partial_dir.exist?
 cache_dir