Skip to content

Instantly share code, notes, and snippets.

View dotmpe's full-sized avatar

.mpe dotmpe

  • NL
  • 22:36 (UTC +02:00)
View GitHub Profile
@dotmpe
dotmpe / pre-commit
Last active August 29, 2015 14:19
Generic file version GIT hook for Node/semver version tags
#!/bin/bash
# Generic file version GIT hook for Node/semver version tags
# (YAML, JSON, JavaScript, CoffeeScript, reStructuredText)
# Source: https://github.com/neilco/xcode-pre-commit/blob/master/git-init-pre-commit
# Adjusted for Darwin (uses BSD sed)
# Made to work from paths listed in .versioned-files.list
# Case allows easy per-project custom versioned file name/ext and format.
@dotmpe
dotmpe / install.sh
Last active May 16, 2016 22:25 — forked from goodevilgenius/membash.sh
BASH script which may be used to interact with memcache. All main memcache functions are supported.
#!/usr/bin/env bash
set -e
resolve_link() {
$(type -p greadlink readlink | head -1) "$1"
}
abs_dirname() {
local cwd="$(pwd)"
local path="$1"
@dotmpe
dotmpe / progressbar.sh
Created November 5, 2016 02:12 — forked from stevenrombauts/progressbar.sh
Bash Progress Bar
#!/bin/bash
# Slick Progress Bar
# Created by: Ian Brown (ijbrown@hotmail.com)
# Please share with me your modifications
# Note: From http://stackoverflow.com/questions/11592583/bash-progress-bar
# Functions
PUT(){ echo -en "\033[${1};${2}H";}
DRAW(){ echo -en "\033%";echo -en "\033(0";}
WRITE(){ echo -en "\033(B";}
HIDECURSOR(){ echo -en "\033[?25l";}
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
exec: {
echo: {
command: 'echo Hello World!'
}
},
{
"name": "mautic/core",
"license": "GPL-3.0",
"type": "project",
"description": "Mautic Open Source Distribution",
"autoload": {
"psr-4": {
"Mautic\\": "app/bundles/",
"MauticPlugin\\": "plugins/",
"Mautic\\Middleware\\": "app/middlewares/"
@dotmpe
dotmpe / Makefile
Last active September 29, 2017 23:56
default: test
demo:
@./_vc-conflicts.sh diff-file conflict-test.txt
@./_vc-conflicts.sh stat-file conflict-test.txt
@./_vc-conflicts.sh count-file conflict-test.txt
test:
bats vc-conflicts-spec.bats
#!/usr/bin/make
default:
.PHONY: default install
BASH := $(shell which bash)
export BASH_ENV=env.sh
$(info 0 foo=$(foo) $(shell echo foo=$$foo))
#!/bin/sh
set -e
# How to find duplicate files, paths pointing at the same content, using GIT
# To get at the basic information, use ls-tree
git ls-tree -r HEAD
# Annex can be made to do something similar for its backend
@dotmpe
dotmpe / glances.sh
Created August 11, 2018 18:45
How-to run glances webserver and client docker
#1/bin/sh
set -e
test -n "$vol_dir" || vol_dir=/srv/docker-volumes-local
test -n "$conf" || conf=$vol_dir/glances/conf-glances.conf
test -n "$ver" || ver=latest
test -n "$ver" || ver=stable
test -n "$ver" || ver=v2.11.1
test -n "$hostname" || hostname="$(hostname -s)"
test -n "$domainname" || domainname=example.net
import dbus
sysbus = dbus.SystemBus()
systemd = sysbus.get_object(
'org.freedesktop.systemd1',
'/org/freedesktop/systemd1'
)
manager = dbus.Interface(
systemd,