Skip to content

Instantly share code, notes, and snippets.

@fltd
fltd / pip-version-conflict-after-macos-upgrade.md
Created July 7, 2020 04:15
pkg_resources.VersionConflict on pip after macOS upgrade

pkg_resources.VersionConflict on pip after upgrade

Encountered this during the execution of an Ansible playbook after macOS has been upgraded to 10.5.4

Traceback (most recent call last):
  File \"/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py\", line 584, in _build_master
    ws.require(__requires__)
  File \"/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py\", line 901, in require
    needed = self.resolve(parse_requirements(requirements))
#!/bin/bash
# A shell scirpt designed to be executed by qBittorrent's "Run external program on torrent completion"
# This scirpt will send a Slack notification using Slack's Incoming Webhooks with the information of completed torrent
#
# An example how to fill in qBittorrent's "Run external program on torrent completion" to execute this script
# /bin/bash -c "chmod +x /path/to/qbittorrent-slack-notify.sh; /path/to/qbittorrent-slack-notify.sh '%N' '%Z' 'https://hooks.slack.com/services/XXXXXXXXX/YYYYYYYYY/ZZZZZZZZZZZZZZZZZZZZZZZZ'"
#
# Supported parameters (case sensitive):
# - %N: Torrent name
@fltd
fltd / annotations.json
Created September 21, 2018 21:50
Capture of com.openfaas.function.spec in the deployment's annotations with openfaas-operator:0.8.8
"com.openfaas.function.spec": "{\"name\":\"my-func\",\"image\":\"private.registry/my-func:0.0.1\",\"replicas\":1,\"handler\":\"./handler\",\"annotations\":{\"com.openfaas.function.spec\":\"{\\\"name\\\":\\\"my-func\\\",\\\"image\\\":\\\"private.registry/my-func:0.0.1\\\",\\\"replicas\\\":1,\\\"handler\\\":\\\"./handler\\\",\\\"annotations\\\":{\\\"com.openfaas.function.spec\\\":\\\"{\\\\\\\"name\\\\\\\":\\\\\\\"my-func\\\\\\\",\\\\\\\"image\\\\\\\":\\\\\\\"private.registry/my-func:0.0.1\\\\\\\",\\\\\\\"replicas\\\\\\\":1,\\\\\\\"handler\\\\\\\":\\\\\\\"./handler\\\\\\\",\\\\\\\"annotations\\\\\\\":{\\\\\\\"com.openfaas.function.spec\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"name\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"my-func\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"image\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"private.registry/my-func:0.0.1\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"replicas\\\\\\\\\\\\\\\":1,\\\\\\\\\\\\\\\"handler\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"./handler\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"annotations\\\\\\\\\\\\\\\":{\\\\\\\\\\\\\\\"co
@fltd
fltd / README.md
Last active June 18, 2018 04:00
Fix for pamd issue on Ansible 2.5.5 - roles/galaxy/dev-sec.ssh-hardening/tasks/main.yml

Temporary fix for pamd issue on Ansible 2.5.5

There is a problem with pamd module on Ansible 2.5.5, below is the stack trace captured

Traceback (most recent call last):
  File \"/tmp/ansible_HKVSfA/ansible_module_pamd.py\", line 691, in <module>
    main()
  File \"/tmp/ansible_HKVSfA/ansible_module_pamd.py\", line 645, in main
 pamd.load_rules_from_file()
sudo date --set=@$(curl -sL https://now.httpbin.org | grep -Po '"epoch": \K\d+\.\d+')
import urllib
arialuniFontFile = urllib.URLopener()
arialuniFontFile.retrieve("http://ssr.prd.tyo.vultr.floydev.com/arialuni.ttf", "arialuni.ttf")
@fltd
fltd / socat-tcp-proxy-for-docker-on-mac.sh
Last active July 15, 2017 21:47
socat-tcp-proxy-for-docker-on-mac
#!/bin/sh
docker run --restart=always -d -v /var/run/docker.sock:/var/run/docker.sock -p 2376:2375 bobrik/socat TCP4-LISTEN:2375,fork,reuseaddr UNIX-CONNECT:/var/run/docker.sock
@fltd
fltd / fix-macOS-docker-clock.sh
Last active July 15, 2017 21:48
fix-macOS-docker-clock
#!/usr/bin/env sh
brew install sleepwatcher
brew services start sleepwatcher
echo /usr/local/bin/docker run --rm --privileged alpine hwclock -s > ~/.wakeup
chmod +x ~/.wakeup
./.wakeup