This is a fairly common question, and there isn't a One True Answer.
These are the most common techniques:
| #!/usr/bin/env ruby | |
| # encoding: utf-8 | |
| # x264 presets guide : https://forum.handbrake.fr/viewtopic.php?f=6&t=19426 | |
| X264 = "b-adapt=2:rc-lookahead=50:me=umh:bframes=5:ref=6:direct=auto:trellis=2:subq=10:psy-rd=1.0,0.10:analyse=all" | |
| FORMAT = "--optimize --format mp4" | |
| QUALITY = "--ab 64 --mixdown mono --quality 23 -e x264 -x '#{X264}'" | |
| SIZE = "--width 1280 --height 720" | |
| ARGV.each do |param| |
| #!/bin/bash | |
| find . -name "*.mkv" | while read FILE | |
| do | |
| # What would the output file be? | |
| DST=/Volumes/USBRAID/Converted/$(dirname "$FILE") | |
| MKV=$(basename "$FILE") | |
| MP4=${MKV%%.mkv}.mp4 | |
| # If it already exists, don't overwrite it | |
| if [ -e "$DST/$MP4" ] |
| #!/bin/bash | |
| # www.fduran.com | |
| # script that will send an email to EMAIL when disk use in partition PART is bigger than %MAX | |
| # adapt these 3 parameters to your case | |
| MAX=95 | |
| [email protected] | |
| PART=sda1 | |
| USE=`df -h |grep $PART | awk '{ print $5 }' | cut -d'%' -f1` | |
| if [ $USE -gt $MAX ]; then |
| import json | |
| import tornado.web | |
| class JsonHandler(BaseHandler): | |
| """Request handler where requests and responses speak JSON.""" | |
| def prepare(self): | |
| # Incorporate request JSON into arguments dictionary. | |
| if self.request.body: | |
| try: |
| from functools import update_wrapper | |
| from django.contrib import admin | |
| from django.contrib.admin import ModelAdmin | |
| from django.contrib.admin.templatetags.admin_urls import add_preserved_filters | |
| from django.core.exceptions import PermissionDenied | |
| from django.shortcuts import render | |
| from myapp.models import Widget | |
| from myapp.forms import ManageWidgetForm |
| { | |
| "logging": { | |
| "version": 1, | |
| "disable_existing_loggers": true, | |
| "formatters": { | |
| "brief": { | |
| "class": "logging.Formatter", | |
| "datefmt": "%I:%M:%S", | |
| "format": "%(levelname)-8s; %(name)-15s; %(message)s" | |
| }, |
This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.
A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:
| server { | |
| listen 80; | |
| server_name your_server_name; | |
| access_log /var/log/nginx/access.log; | |
| location / { | |
| proxy_pass http://localhost:1880; | |
| proxy_http_version 1.1; | |
| proxy_set_header Upgrade $http_upgrade; |