Rsync for NAS beginner
rsync -ahvP [-c] [-m] [-W] [-n] [--remove-source-files] [--log-file=FILE] src dest
use sudo to keep file ownership!
import wave | |
FILENAME = 'Eternal Snow_이용신_Returned Fullmoon.wav' | |
wav = wave.open(FILENAME, mode='rb') | |
n_channels, sample_width, frame_rate, no_frames, _, _ = wav.getparams() | |
sample_bits = sample_width * 8 | |
print(f'{FILENAME}') |
# check PID | |
if [[ $EUID -ne 0 ]]; then | |
echo "Not a superuser... run with sudo." | |
exit 1 | |
fi | |
# some magic values | |
SSH_PORT=42222 | |
MACHINE_DIST="ubuntu"$(lsb_release -sr | sed -e "s/\.//g") | |
MACHINE_ARCH=$(uname -m) |
@ECHO OFF | |
REM 1280x 720 30fps = 5000k | |
REM 60fps = 7500k | |
REM 1920x1080 30fps = 8000k | |
REM 1920x0180 60fps = 12000k | |
:BEGIN | |
IF [%1]==[] GOTO :eof |
#!/usr/bin/env python3 | |
import argparse | |
from pytube import YouTube | |
def download(url): | |
def progress_callback(stream, chunk, file_handle, bytes_remaining): | |
# this function is called by download process... do not call directly! | |
total_size = stream.filesize | |
downloaded_size = total_size - bytes_remaining |
On some Display Manager events (login, screen-lock, etc) screen resolution changes to 800x600 forcefully, even though user setting is different.
LightDM's display-setup-script
or .config/autostart
methods does not fix this problem.
These methods changes resolution after specified events by executing xrandr
command,
but other events (escpecially screen-lock) reset resolution to 800x600 and annoy me.
import os | |
import os.path as path | |
import re | |
from PIL import Image | |
IMAGE_EXTENSION = ['.jpg', '.jpeg', '.png', '.gif'] | |
CAPTURE_SIZE = [(2048, 1536), (1136, 640)] | |
SCREEN_RATIO = [w/h if w > h else h/w for w, h in CAPTURE_SIZE] |
from datetime import datetime, timedelta | |
from datetime import time | |
from copy import deepcopy | |
# settings | |
start_date = datetime(2016, 9, 20, 15, 00, 00) | |
boost_date = datetime(2016, 9, 23, 15, 00, 00) | |
end_date = datetime(2016, 9, 26, 21, 00, 00) | |
now_date = deepcopy(start_date) |