Skip to content

Instantly share code, notes, and snippets.

View check
ls /directory/Show/Season\ number/ | cut -d '-' -f3- | cut -d '[' -f2- | column -t
pueue add --stashed --label rclone -- "rclone copy put-io: uni-drive-api-crypt:put.io --checksum --stats-one-line-date --stats-log-level NOTICE 2>&1"
View ceph.md

from IRC channel:

17:17:39 <dirtwash> wowas: no
17:17:51 <dirtwash> wowas: out + purge, no further steps needed to remove
17:18:03 <dirtwash> purge command does everything
18:50:43 <devster> anyone can figure out what's wrong with this ceph-osd (in docker with ceph-ansible) that keeps crashing? It's a single OSD that keeps going up and down every 3 minutes almost exactly... https://pastebin.com/5q5XYLXY
18:55:44 <dirtwash> devster: just purge it and redo, had this few times, could be any number of known bugs
18:55:59 <dirtwash> devster: or ask on ML
18:56:03 <dirtwash> there wont be an answer here
18:58:20 <devster> thanks dirtwash never did a purge with ceph-ansible
View ffmpeg.md
ffmpeg -hide_banner -y \
  -c:a aac -ar 48000 \
  -c:v h264 -profile:v baseline \
  -crf 20 -sc_threshold 0 \
  -pix_fmt yuv420p -hls_time 10 \
  -strict -2 -vsync 2 \
  -vf scale=w=<vwidth>:h=<vheight> \
  -b:v <vbrate> -maxrate <maxrate> \
  -bufsize <bufsize> -b:a 96k \
View awk-deduplicate.md
awk '!visited[$0]++' your_file > deduplicated_file
  • The awk "script" !visited[$0]++ is executed for each line of the input file.
  • visited[] is a variable of type associative array (a.k.a. Map). We don't have to initialize it because awk will do it the first time we access it.
  • The $0 variable holds the contents of the line currently being processed.
  • visited[$0] accesses the value stored in the map with a key equal to $0 (the line being processed), a.k.a. the occurrences (which we set below).
View antibody.py
import requests
from bs4 import BeautifulSoup
css = """
table {
color: #666;
font-family: 'Raleway', sans-serif;
font-size: 16px;
font-weight: 400;
@devster31
devster31 / tasks.jsonc
Created Feb 11, 2020
yamllint Visual Studio Code task
View tasks.jsonc
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "yamllint",
"type": "shell",
"command": "/usr/local/bin/yamllint",
"args": [
View issue.md
SUMMARY

query is not returning an empty list.

ISSUE TYPE
  • Bug Report
View hyper.js
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@devster31
devster31 / joseph_reagle.bash
Last active Feb 23, 2019
ssh-agent automation done well
View joseph_reagle.bash
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
@devster31
devster31 / post-script.sh
Created Feb 25, 2018
messy post-processing
View post-script.sh
#!/bin/bash -u
MEDUSA_API_KEY=*****
file=$1 # {f}
location=$2 # {f.dir.dir}
database=${3} # {info.DataBase}
id=${4:-x} # {info.id}
name="${5}" # {info.Name}
if [[ ! -f "$1" ]]; then