Skip to content

Instantly share code, notes, and snippets.

schedules:
- tasks: 'emailfeeds'
interval:
hours: 6
- tasks: [Baibako, Lostfilm, Newstudio, Alexfilm, To4ka, tvfedor, 'rutracker-films']
interval:
minutes: 10
templates:
global:
make_rss:
@darkxanter
darkxanter / dnsmasq
Created November 26, 2015 11:45 — forked from denji/dnsmasq
nginx config - dynamic virtual hosts
# sudo apt-get install dnsmasq
# echo "address=/.dev/127.0.0.1" | sudo tee /etc/dnsmasq.conf
# sudo update-rc.d dnsmasq enable
# sudo service dnsmasq restart
@darkxanter
darkxanter / redirect_example.sh
Created December 8, 2015 09:38
redirect both standard output and standard error of all commands in a bash script
#!/bin/bash
logfile=$$.log
exec > $logfile 2>&1
@darkxanter
darkxanter / batch-mkvmerge.sh
Created February 27, 2016 20:38 — forked from holms/batch-mkvmerge.sh
Batch mkvmerge
ls *.mkv | while read i; do mkvmerge -o "converted/${i}" "${i}" "${i%mkv}mka" ; done
@darkxanter
darkxanter / bash-cheatsheet.sh
Created October 30, 2016 06:34 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@darkxanter
darkxanter / run_qemu
Last active February 7, 2017 17:47
windows 10 + vga passthrough Nvidia GTX 980
#!/bin/bash
# QEMU name and PID
OPTS="-name windows-10-pro"
OPTS="$OPTS -pidfile /tmp/windows-10-pro.pid"
# Processor
#OPTS="$OPTS -cpu host,kvm=off"
OPTS="$OPTS -cpu host,kvm=off,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_vendor_id=whatever"
Sub RefNoText()
'Подавить постоянную часть перекрестной и оставить
'только номер вставкой ключа числового формата в поле Ref
With Selection
.Fields.ToggleShowCodes
.Find.ClearFormatting
.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "_Ref^#^#^#^#^#^#^#^#^#"
.Replacement.Text = "^& \# 0"
@darkxanter
darkxanter / dbus_handler.py
Last active April 21, 2018 09:15
Python DBus handle hibernate, sleep and resume
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'xanter'
#from datetime import datetime
import signal
import time
import dbus
import gobject
import urllib2
#!/bin/sh
easylist() {
echo -n 'Getting EasyList list ... '
out=/etc/dnsmasq.d/easylist.conf
tmp=$(mktemp)
wget -q -nv https://easylist-downloads.adblockplus.org/easylist.txt -O $tmp
egrep '^\|\|([a-Z\.]+)\^$' $tmp | cut -d '^' -f1 | sed 's#||#address=/# ; s#$#/127.0.0.1#' | sort | uniq >$tmp.$$
[ $? -eq 0 ] && sudo mv -f $tmp.$$ $out && wc -l $out || echo -42
rm $tmp