This file contains 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
# to get the name of the card do: | |
# cat /proc/asound/cards | |
# ... | |
# 2 [DACE17 ]: USB-Audio - FiiO USB DAC-E17 | |
# FiiO FiiO USB DAC-E17 at usb-0000:00:14.0-1.4, full speed | |
# or | |
# aplay -l | |
# ... | |
# card 2: DACE17 [FiiO USB DAC-E17], device 0: USB Audio [USB Audio] | |
# Subdevices: 1/1 |
This file contains 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
# 1 - Create a jail called `convert` using `pluginjail-10.3` template | |
# 2 - list all jails | |
jls | |
JID IP Address Hostname Path | |
1 - convert /mnt/volume/jails/convert | |
# 3 - connect to our jail | |
jexec 1 sh |
This file contains 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
# 1 - create syncthing jail | |
# 2 - add storage | |
# install bash and syncthing | |
pkg install bash | |
pkg install syncthing | |
# add syncthing user | |
``` |
This file contains 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
sudo sh -c 'while read -r line; do echo "$line"; ping -f -q -4 -c 50 "$line" | grep rtt | cut -d"/" -f2,5; done <ips' |
This file contains 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
from enum import Enum | |
from selenium.webdriver import ChromeOptions, FirefoxProfile | |
class Browser(Enum): | |
CHROME = "chrome" | |
FIREFOX = "firefox" | |
IE = "ie" | |
PHANTOMJS = "phantomjs" |
This file contains 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 python3 | |
# -*- coding: utf-8 -*- | |
"""Modified version of fetch function with semaphore created by: Paweł Miech | |
src: https://pawelmhm.github.io/asyncio/python/aiohttp/2016/04/22/asyncio-aiohttp.html | |
""" | |
import argparse | |
import asyncio | |
import sys | |
from argparse import Namespace | |
from asyncio import Semaphore |
This file contains 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
sudo dnf install parallel | |
npm install pa11y pa11y-reporter-html | |
# the Perl expression {= s:[/\:\?\&\=]:-:g; =} will replace all special charachers '/:?&' in report filename with '-' | |
parallel 'pa11y --reporter=html {} > {= s:[/\:\?\&\=]:-:g; =}.html' < urls.txt |
This file contains 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
function cheat() { | |
# ${1} - is the language/dmbs/etc | |
# ${*:2} - your query | |
# sed 's/ /+/g' - will replace spaces with `+` | |
curl https://cheat.sh/${1}/`echo "${*:2}" | sed 's/ /+/g'` | |
} | |
# example usage: | |
# cheat python recursion | |
# cheat python open files |
This file contains 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
alias subs=subs | |
function subs() { | |
movie="${1}" | |
filename="${1%.*}" | |
mappings=`ffprobe -loglevel error -select_streams s -show_entries stream=index:stream_tags=language -of csv=p=0 "${movie}"` | |
OLDIFS=$IFS | |
IFS=, | |
( while read idx lang | |
do |