Skip to content

Instantly share code, notes, and snippets.

@amercier
amercier / synology-scheduled-tasks.md
Last active January 10, 2024 08:31
Turn leds on/off on Synology DiskStation

Synology scheduled tasks

Usage

Go to Control Panel / Task Scheduler and add the content of these scripts as root scripts.

Leds

@amercier
amercier / gist:f8e0c7cb201097f86b16
Last active August 29, 2015 14:18
git-prompt-config.sh
# export PS1_HOST_COLOR=$COLOR_WHITE
# export PS1_HOST_COLOR=$COLOR_BLUE
# export PS1_HOST_COLOR=$COLOR_LIGHT_BLUE
# export PS1_HOST_COLOR=$COLOR_GREEN
# export PS1_HOST_COLOR=$COLOR_LIGHT_GREEN
# export PS1_HOST_COLOR=$COLOR_CYAN
# export PS1_HOST_COLOR=$COLOR_LIGHT_CYAN
# export PS1_HOST_COLOR=$COLOR_RED
# export PS1_HOST_COLOR=$COLOR_LIGHT_RED
# export PS1_HOST_COLOR=$COLOR_PURPLE
#!/usr/bin/env sh
if [ "$(which git) 2>/dev/null" = "" ]; then
echo "git is not installed. Please install git" >&2 \
&& exit 1
fi
if [ ! -e .ssh/id_rsa.pub ]; then
echo "SSH public key not found in .ssh/, creating..." \
&& ssh-keygen -t rsa -C "pro.alexandre.mercier@gmail.com" \
@amercier
amercier / terminal.sh
Last active August 29, 2015 14:15
terminal.sh
#!/usr/bin/env bash
# Colors: http://mediadoneright.com/content/ultimate-git-ps1-bash-prompt
export TERM=xterm-color
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export COLOR_NC='\e[0m' # No Color
[ -f "$HOME/.bashrc" ] && . "$HOME/.bashrc"
[ -f "$HOME/.bash_aliases" ] && . "$HOME/.bash_aliases"
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.emq=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
"use strict";
var testResolver = _dereq_("./test-resolver")["default"] || _dereq_("./test-resolver");
var Ember = window.Ember["default"] || window.Ember;
exports["default"] = function isolatedContainer(fullNames) {
var resolver = testResolver.get();
var container = new Ember.Conta
#!/usr/bin/env bash
# Brew
which brew >/dev/null \
&& echo "Brew is already installed" \
|| ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap homebrew/dupes
brew tap homebrew/homebrew-php
brew tap homebrew/versions
#!/usr/bin/env python
import sys
terse = "-t" in sys.argv[1:] or "--terse" in sys.argv[1:]
for i in range(2 if terse else 10):
for j in range(30, 38):
for k in range(40, 48):
if terse:
print "\33[%d;%d;%dm%d;%d;%d\33[m " % (i, j, k, i, j, k),
#!/usr/bin/env bash
if [ "`whoami`" != "root" ]; then
echo "You must execute this script as root" >&2
exit 1
fi
VERSION=1.5.1
echo ".-----------------------------."
#!/usr/bin/env bash
if [ "`whoami`" != "root" ]; then
echo "You must execute this script as root" >&2
exit 1
fi
echo ".----------------------------."
echo "| Google Chrome installation |"
echo "'----------------------------'"
#!/usr/bin/env bash
if [ "$1" == "" ]; then
echo "Syntax: $0 HOST" >&2
exit 1
fi
if [ ! -e ~/.ssh/id_rsa.pub ]; then
echo "Generating private/public keys..."
ssh-keygen -t rsa || exit 1