Skip to content

Instantly share code, notes, and snippets.

View dapepe's full-sized avatar

Peter Haider dapepe

View GitHub Profile
@dapepe
dapepe / mongodb-s3-backup.sh
Created October 11, 2018 07:38 — forked from eladnava/mongodb-s3-backup.sh
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
#!/bin/sh
# Make sure to:
# 1) Name this file `backup.sh` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x backup.sh
# 7) Test it out via ./backup.sh
@dapepe
dapepe / sphp.sh
Created April 29, 2018 11:02 — forked from rhukster/sphp.sh
#!/bin/bash
# Creator: Phil Cook
# Email: phil@phil-cook.com
# Twitter: @p_cook
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
brew_array=("5.6","7.0","7.1","7.2")
php_array=("php@5.6" "php@7.0" "php@7.1" "php@7.2")
valet_support_php_version_array=("php@5.6" "php@7.0" "php@7.1" "php@7.2")
php_installed_array=()
@dapepe
dapepe / clean-up-boot-partition-ubuntu.md
Created December 12, 2017 07:54 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@dapepe
dapepe / zeysdk-api.md
Created December 5, 2017 11:12
ZeySDK API Usage Manual

ZeyOS SDK CLI

Introduction

The SDK API enables SDK toolkits - e.g. the ZeyOS SDK CLI - to synchronize app data with ZeyOS.

General API Workflow

@dapepe
dapepe / zeysdk-readme.md
Last active December 8, 2017 09:23
ZeySDK README

ZeyOS SDK CLI

First: GET /sync Then create the PATCH document

Installation

@dapepe
dapepe / pos.yaml
Created October 13, 2017 16:48
Configuration for SparkPOS
---
request:
url: http://192.168.157.143:50505
log:
error: log/error.log
default: log/default.log
rules:
- name: EAN scannen
input: ".*"
action:
@dapepe
dapepe / sqlitediff.php
Created March 24, 2016 07:16
Use TortiseMerge to display the difference between two SQLite files
#!/usr/bin/env php
<?php
function dumpSqlite($database) {
$path = @tempnam(@sys_get_temp_dir(), 'sqlt');
if ( !$path )
return false;
$dump = @shell_exec('php '.escapeshellarg(dirname(__FILE__).DIRECTORY_SEPARATOR.'sqlitedump.php').' '.escapeshellarg($database));
if ( !empty($dump) and @file_put_contents($path, $dump) )
@dapepe
dapepe / sqlitedump.php
Created March 24, 2016 07:15
Display a dump for an SQLite file
#!/usr/bin/env php
<?php
if ( !isset($argv[1]) ) {
fputs(STDERR, 'Usage: '.basename($argv[0]).' <sqlite-file>'."\n");
exit(1);
}
$dbFile = $argv[1];
@dapepe
dapepe / TextTable.php
Last active December 20, 2023 20:45
Class to generate a Markdown-style table from a PHP array
<?php
/**
* Creates a markdown document based on the parsed documentation
*
* @author Peter-Christoph Haider <peter.haider@zeyon.net>
* @package Apidoc
* @version 1.00 (2014-04-04)
* @license GNU Lesser Public License
*/
@dapepe
dapepe / Gruntfile.js
Last active August 29, 2015 13:56
Simple Gruntfile.js for LESS parsing and development mode
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
distFolder: 'dist',
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: 'dist/<%= pkg.name %>.js',