This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Deps: | |
- pip install requests pafy youtube-dl | |
""" | |
import pafy | |
import requests | |
import string | |
import unicodedata | |
import re | |
from multiprocessing.pool import ThreadPool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Watch log | |
# | |
# Script that will "tail -f" a log file and push the new lines to your phone | |
# using a Telegram bot (@PushItBot - https://fopina.github.io/tgbot-pushitbot/) | |
function pushit() { | |
# this function receives the first parameter passed to the script | |
# plus the latest line of the log file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import pyaudio | |
import socket | |
import sys | |
FORMAT = pyaudio.paInt16 | |
CHANNELS = 1 | |
RATE = 44100 | |
CHUNK = 4096 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# requires ansible 2.4 | |
# usage: | |
# ansible-playbook playbook.yml -i 192.168.1.254, | |
- hosts: all | |
gather_facts: false | |
tasks: | |
# ansible 2.4 telnet plugin does not add \r | |
# and the router requires it so... | |
- name: disable ipv6 in meo router |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"os" | |
"fmt" | |
"math/rand" | |
"github.com/veandco/go-sdl2/sdl" | |
) | |
const ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# https://www.youtube.com/watch?v=mmGB9ADKr5Y | |
import argparse | |
from PIL import Image | |
DEFAULT_STRIPS = 8 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# directly from | |
# https://docs.python.org/3/library/concurrent.futures.html#threadpoolexecutor-example | |
import concurrent.futures | |
import urllib.request | |
def check_port(port): | |
print('testing %d \r' % port, end='') | |
# smaller response text! | |
r = urllib.request.Request('http://portquiz.net:%d' % port, headers={'User-Agent': 'curl'}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Restart Fluentbit | |
service: | |
name: td-agent-bit | |
enabled: true | |
state: restarted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: all | |
gather_facts: True | |
become: True | |
roles: | |
- role: fluentbit | |
fluentbit_inputs: | |
- systemd: | |
- Tag: docker | |
- Systemd_Filter: _SYSTEMD_UNIT=docker.service | |
- cpu: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__force_django_debug = False | |
def pytest_runtest_setup(): | |
if __force_django_debug: | |
# required for logging SQL as pytest always sets DEBUG to False (why?) | |
# https://github.com/pytest-dev/pytest-django/blob/master/pytest_django/plugin.py#L473 | |
from django.conf import settings | |
settings.DEBUG = True |