View flatten_folders.sh
#!/usr/bin/env bash | |
# | |
# Some car head units have restrictions on the number of folders they can access, | |
# this scripts aims to reduce the number of folders taken by a music collection. | |
# Assumes the music collection is set up as Artist / Album | |
# This also ensures the folders and files don't exceed the maximum file size. | |
# My own head unit restrictions: 255 folders, folder/filename size: 63 chars | |
export MAX_FILE_SIZE=63 | |
export APPLY_CHANGES=false |
View .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
View clip
#!/bin/bash | |
# Linux version | |
# Use this script to pipe in/out of the clipboard | |
# | |
# Usage: someapp | clip # Pipe someapp's output into clipboard | |
# clip | someapp # Pipe clipboard's content into someapp | |
# | |
if command -v xclip 1>/dev/null; then | |
if [[ -p /dev/stdin ]] ; then |
View bs4_display.js
(function(window){ | |
'use strict'; | |
// wrapper | |
function bs4Display() { | |
var _bs4Display = {}; | |
_bs4Display.DUMMY_PREFIX = 'dummy' | |
// private methods |
View xgettext-loader.js
let child = require("child_process") | |
let source_map = require("source-map") | |
let SourceMapConsumer = source_map.SourceMapConsumer | |
let path = require("path") | |
var crypto = require('crypto'); | |
module.exports = function(source, sourceMap) { | |
this.cacheable() | |
this.async() | |
var self = this |
View fix-wordpress-permissions.sh
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
# | |
WP_OWNER=www-data # <-- wordpress owner | |
WP_GROUP=www-data # <-- wordpress group | |
WP_ROOT=$1 # <-- wordpress root directory |
View compact_timezone_list.html
<select> | |
<option utc_offset="-11:00" dst="0" value="Etc/GMT+11">UTC-11:00 Pago Pago, Niue</option> | |
<option utc_offset="-10:00" dst="0" value="Etc/GMT+10">UTC-10:00 HST, Rarotonga, Tahiti, Honolulu</option> | |
<option utc_offset="-10:00" dst="1" value="America/Adak">UTC-10:00 Adak</option> | |
<option utc_offset="-09:30" dst="0" value="Pacific/Marquesas">UTC-09:30 Marquesas</option> | |
<option utc_offset="-09:00" dst="1" value="America/Anchorage">UTC-09:00 Anchorage, Juneau, Metlakatla, Nome, Sitka, Yakutat</option> | |
<option utc_offset="-09:00" dst="0" value="Etc/GMT+9">UTC-09:00 Gambier</option> | |
<option utc_offset="-08:00" dst="0" value="Etc/GMT+8">UTC-08:00 Pitcairn</option> | |
<option utc_offset="-08:00" dst="1" value="PST8PDT">UTC-08:00 PST8PDT, Dawson, Vancouver, Whitehorse, Tijuana, Los Angeles</option> | |
<option utc_offset="-07:00" dst="1" value="MST7MDT">UTC-07:00 MST7MDT, Cambridge Bay, Edmonton, Inuvik, Yellowknife, Chihuahua, Mazatlan, Ojinaga, Boise, Denver</option> |
View gist:18c7877bbc4db5f1794b571136946b90
Sometimes after a hard reboot (power cut), if your synology cannot be logged in with DSM and it shows "System is getting ready. Please log in later" , please do these steps : | |
#Admin login via ssh | |
> synobootseq --set-boot-done | |
> synobootseq --is-ready | |
#optional | |
> /usr/syno/etc/rc.d/S97apache-sys.sh start | |
> /usr/syno/etc/rc.d/S95sshd.sh start |
View True Trello Printer
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>True Trello Printer</title> | |
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet"> | |
<style> | |
body{margin:15%;} | |
.panel-body{ |
View search_backends.py
# -*- coding: utf-8 -*- | |
""" | |
Whoosh backend for haystack that implements character folding, as per | |
http://packages.python.org/Whoosh/stemming.html#character-folding . | |
Tested with Haystack 2.4.0 and Whooch 2.7.0 | |
To use, put this file on your path and add it to your haystack settings, eg. |
NewerOlder