#!/bin/sh
RSYNC='ionice -c 3 nice -n 17 rsync'
$RSYNC --inplace --bwlimit=2000 -Wvr [-pgo] [--progress] --log-file=/tmp/rsync.log \
--rsync-path="$RSYNC" src dest
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 | |
# Usage: scrape.py urls.txt | |
# Based on: https://pawelmhm.github.io/asyncio/python/aiohttp/2016/04/22/asyncio-aiohttp.html | |
import sys | |
import asyncio | |
import aiohttp | |
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
;----------------------------------------------; | |
; Coder plugin syntax file ; | |
;----------------------------------------------; | |
;Author: wisgest | |
;=============== | |
;Colors | |
; Color need to be in #RRGGBB format. | |
; If color equal to zero, then color ignored. |
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
#!/bin/bash | |
# Add systemd-nspawn machine, install base packages, create builder user | |
set -eu | |
if [ $# -ne 1 ]; then | |
echo "usage: $0 MACHINE" | |
exit 1 | |
fi |
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
func setupLog(debug, datetime bool) { | |
filter := &logutils.LevelFilter{ | |
Levels: []logutils.LogLevel{"DEBUG", "INFO", "WARN", "ERROR"}, | |
MinLevel: logutils.LogLevel("INFO"), | |
Writer: os.Stdout, | |
} | |
if debug { | |
filter.MinLevel = logutils.LogLevel("DEBUG") | |
} |
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 python | |
# -*- coding: utf-8 -*- | |
import json | |
import os.path | |
def md5sum(): | |
return "test" | |
class File(object): |
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
logger.Print("fetch metatile data to buffer") | |
var buf bytes.Buffer | |
err = mt.FetchEncodeTo(url, &buf) | |
if err != nil { | |
logger.Fatal(err) | |
} | |
logger.Print("write buffer to cache") | |
err = c.Write(t, &buf) | |
if err != nil { |
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/python3 | |
# try this for long-running processes: | |
# | |
# $ cat example.service | |
# ... | |
# Type=simple | |
# ExecStart=systemd-notify-wrapper.py "/opt/scripts/long-running.sh -a -b FLAG" "%n" | |
# ... | |
# | |
# send "successful complete" notification if exit code valid |
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
''' | |
args: {'--append': True, 'FILE1': 'test', 'normal': 'normal'} | |
cfg: {'append': True, 'file1': 'test', 'normal': 'normal'} | |
''' | |
# simple way | |
cfg = {} | |
for arg in args: | |
cfg[arg.lower().replace('-','')] = args[arg] |
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
[SeatDefaults] | |
allow-guest=false | |
# user=root, run on greeter start | |
greeter-setup-script=/usr/bin/numlockx on | |
# user=user, run on session start | |
# session-setup-script=/usr/local/bin/resolution.sh | |
#greeter-hide-users=true | |
#greeter-show-manual-login=true |