Skip to content

Instantly share code, notes, and snippets.

@daktak
daktak / ffmpeg_record_screen.sh
Last active December 22, 2023 20:34
Ffmpeg record selected window. Written for Qubes-OS
#!/bin/bash
#pass in alsa or pulse to record from sound device
IFS=$
#omit the top pixels to hide tabs and address bar
FIREFOX_Y_BUFFER=94
FIREFOX_X_BUFFER=2
if [[ ${1} =~ alsa ]] ; then
sound="-f alsa -ac 2 -i hw:0"
fi
if [[ ${1} =~ pulse ]] ; then
@daktak
daktak / bot.txt
Last active July 15, 2023 23:33
ZOffline bot.txt 400 male and female with Team initials
{
"riders": [
{
"country_code": 705,
"is_male": true,
"first_name": "Tadej",
"last_name": "Poga\u010dar (UAD)",
"ride_jersey": 1751349769,
"bike_frame": 3628259811,
"bike_wheel_front": 2223270801,
@daktak
daktak / sabToKindle.sh
Last active February 18, 2023 19:24
Sabnzbd script to auto convert your epubs to mobis and send to kindle account using Calibre
#!/bin/bash
#based off
#https://github.com/ghuntley/sabToCalibre
#Requires Calibre, sabnzbd
#latest version at
#https://gist.github.com/daktak/8347325
DOWNLOAD_DIRECTORY="/pub/sabnzbd/books"
CALIBRE_PATH=/usr/bin
EXPECTED_ARGS=7
PORT="25"
@daktak
daktak / update-template.sh
Created June 29, 2022 01:44
Qubes-os update template
#!/bin/bash
NEW_TEMPLATE=$2
OLD_TEMPLATE=$1
DVM_NAME=$4
OLD_DVM_NAME=$3
if [[ -z ${NEW_TEMPLATE} ]]; then
echo "update-template.sh oldtemplate newtemplate [olddvm] [newdvm]"
exit 1
fi
if [[ -z ${DVM_NAME} ]]; then
@daktak
daktak / qvm-exposeip.sh
Last active June 17, 2022 02:59
Qubes-os port forwarding to allow external connections
#!/bin/sh
#4.0
#ip() { qvm-ls --raw-data ip -- "$1"; }
##4.1
ip() { qvm-ls --raw-data --fields ip -- "$1"; }
netvm() { qvm-prefs -g -- "$1" netvm; }
forward() {
local from_domain=$1
local to_domain=$2
@daktak
daktak / zwift_world.sh
Created December 14, 2021 08:35
Set world in Zwift prefs.
#!/bin/bash
USER=`whoami`
DIR="/home/${USER}/Games/zwift/drive_c/users/daktak/Documents/Zwift"
case $1 in
1 | Watopia )
WORLD=2
;;
2 | Richmond )
WORLD=2
@daktak
daktak / zwift.sh
Last active December 10, 2021 00:08
Execute Zwift via cli (lutris)
#!/bin/bash
xset s off # don't activate screensaver
xset -dpms # disable DPMS (Energy Star) features.
xset s noblank # don't blank the video device
USER=`whoami`
PATH=/home/${USER}/Games/zwift
GAME_LOCATION="${PATH}/drive_c/Program Files (x86)/Zwift"
RUNNER=lutris-fshack-6.21-6-x86_64
#!/bin/env python2
#
#
##############################################################################
### NZBGET POST-PROCESSING SCRIPT ###
# chmod for nzbget
# NOTE: This script requires Python to be installed on your system.
##############################################################################
### OPTIONS ###
@daktak
daktak / .screenrc
Last active December 30, 2018 22:39
screenrc
# set a big scrolling buffer
defscrollback 5000
# Set the caption on the bottom line
caption always "%{= kw}%-w%{= BW}%n %t%{-}%+w %-= @%H - %LD %d %LM - %c"
defutf8 on
termcapinfo xterm* ti@:te@
term xterm-256color
@daktak
daktak / .zshrc
Last active December 30, 2018 22:38
zshrc from system rescue cd
#
# This file is based on the configuration written by
# Bruno Bonfils, <asyd@debian-fr.org>
# Written since summer 2001
# colors
eval `dircolors /etc/DIR_COLORS`
autoload -U zutil
autoload -U compinit