Skip to content

Instantly share code, notes, and snippets.

Roel Berger ruleb

  • Antwerp, Belgium
Block or report user

Report or block ruleb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ruleb
ruleb / angular.app.store.errors.js
Created Mar 18, 2016
Put all $log errors in a global variable "errors" so you have a log of errors that happen before you have access to the console.
View angular.app.store.errors.js
angular
.module('app', [])
.config(['$provide', function ($provide) {
window.errors = [];
$provide.decorator('$log', ['$delegate', function ($delegate) {
var origError = $delegate.error;
$delegate.error = function () {
window.errors.push(arguments);
origError.apply(null, arguments);
View backup
#!/bin/bash
# Weekly full + daily incrementals of full servers + dbs.
# Cron
# 0 4 * * 6 root bash /scripts/backup full >> /var/log/backup
# 0 4 * * 0,1,2,3,4,5 root bash /scripts/backup >> /var/log/backup
# Configure what folders to backup.
backup_files="/home /etc /root /boot /opt /scripts"
@ruleb
ruleb / diskspace
Last active Aug 29, 2015
A script to warn when disks are getting full
View diskspace
#!/bin/bash
EMAIL="your_email@gmail.com"
WARNING_LEVEL=90
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output;
do
echo $output
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $2 }' )
if [ $usep -ge $WARNING_LEVEL ]; then
echo "Running out of space \"$partition ($usep%)\" on $(hostname) as on $(date)" | mail -s "Alert: Almost out of disk space $usep%" $EMAIL
@ruleb
ruleb / autoupdate
Last active Aug 29, 2015
Auto update ubuntu servers
View autoupdate
#!/bin/bash
# Put this script in your /etc/cron.daily or schedule it through crontab. It should run as root and have x permissions.
# roelb unattended autoupdate
echo "" >> /var/log/autoupdate
echo "*****" >> /var/log/autoupdate
date >> /var/log/autoupdate
echo "Updating aptitude..." >> /var/log/autoupdate
aptitude update >> /var/log/autoupdate
View best_practices.md

Servers

  • Configure NTP
  • Scheduled automatic diskspace alerts
@ruleb
ruleb / edu.md
Last active Dec 24, 2015
Useful study material
View edu.md
@ruleb
ruleb / tools.md
Last active Dec 24, 2015
Useful hammers for some jobs
View tools.md

Databases

  • Neo4j
  • Redis
  • Cassandra
  • MariaDB

Terminal

  • UXterm
@ruleb
ruleb / README.md
Last active Jan 10, 2019
Countdown widget for Dashing
View README.md

Description

Simple Dashing widget to countdown until a certain moment. Flashes the widget when finished.

##Usage

To use this widget, copy countdown.html, countdown.coffee, and countdown.scss into the /widgets/countdown directory.

To include the widget in a dashboard, add the following snippet to the dashboard layout file:

You can’t perform that action at this time.