Skip to content

Instantly share code, notes, and snippets.

View mauron85's full-sized avatar

Marián Hello mauron85

View GitHub Profile
@mauron85
mauron85 / renew_cert.sh
Last active October 31, 2016 13:29
Certificate renew script for letsencrypt (acme-tiny)
#!/usr/bin/env bash
# Read https://github.com/diafygi/acme-tiny before using this script
# This scripts expects:
# 1. letsencrypt account.key is present $ACCOUNT_KEY dir (Step 1.)
# 2. CSR to generated (files: domain.key and domain.csr) (Step 2.)
# domain.csr should be present in $DOMAIN_ROOT/$DOMAIN
# (eg. /home/letsencrypt/acme-tiny/mapilary.com/domain.csr)
# Resulting cert chained.pem will be stored in $DOMAIN_ROOT/$DOMAIN/chained.pem
#!/usr/bin/env bash
while true; do ps h -u nodejs -o pid,%cpu,%mem,rss,sz,vsz,cmd | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }'; sleep 30; done
// you will need to run emailjs-tcp-socket server
// https://github.com/emailjs/emailjs-tcp-socket
// NODE_ENV=integration node ws-proxy/server.js
// Also for gmail turn on less secure app option
// https://www.google.com/settings/security/lesssecureapps
// In case cert is revoked/expired generate new cert
// https://support.google.com/a/answer/6180220?hl=en
// fill your gmail credentials and change ws-proxy url at very bottom
package com.marianhello.bgloc.sync;
import android.accounts.Account;
import android.app.NotificationManager;
import android.content.AbstractThreadedSyncAdapter;
import android.content.ContentProviderClient;
import android.content.ContentResolver;
import android.content.Context;
import android.content.SyncResult;
import android.database.Cursor;
@mauron85
mauron85 / packages.cson
Last active September 21, 2016 10:47
List of installed Atom packages for syncing between machines using package-sync.
packages: [
"adventurous-syntax"
"atom-alignment"
"atom-beautify"
"atom-ternjs"
"atom-typescript"
"color-picker"
"emmet"
"file-icons"
"linter"
//Inspired by: https://gist.github.com/joelambert/1002116#file-requestanimframe-js
var TimerMixin = require('react-timer-mixin');
var IntervalMixin = Object.assign({}, TimerMixin, {
/**
* Behaves the same as setInterval except uses requestAnimationFrame() where possible for better performance
* @param {function} fn The callback function
* @param {int} delay The delay in milliseconds
*/
@mauron85
mauron85 / keep-adb-running.sh
Created September 22, 2016 09:55
Workaround adb disconnecting issue on macOS Sierra
#!/bin/bash
cat << EOF
###########################################################
# Workaround adb disconnecting issue on macOS Sierra
#
# More info:
# https://code.google.com/p/android/issues/detail?id=219085
# credits to: hans...@meetme.com, vs...@google.com
###########################################################
@mauron85
mauron85 / opt.google.chrome.chrome
Created October 12, 2016 11:19
Google Chrome AppArmor profile for Ubuntu 16.04
# Last Modified: Wed Oct 12 13:00:00 2016
# All credits to:
# https://github.com/detrout/apparmor-det/
# Helpful links:
# https://bugs.dogfood.paddev.net/ubuntu/+source/libvirt/+bug/1386465
# http://blog.azimuthsecurity.com/2012/09/poking-holes-in-apparmor-profiles.html
#include <tunables/global>
@mauron85
mauron85 / suspend-modules
Last active November 5, 2022 10:28 — forked from anonymous/suspend-modules
Ubuntu 16.04 systemd unload modules on sleep
#!/bin/bash
# Put into /lib/systemd/system-sleep/suspend-modules
# chmod a+x /lib/systemd/system-sleep/suspend-modules
# Create /etc/suspend-modules.conf
# with one module per line
# credits to:
# https://bbs.archlinux.org/viewtopic.php?pid=1540125#p1540125
@mauron85
mauron85 / Dockerfile
Last active October 25, 2016 10:37
Prepare docker container for building openwrt
FROM debian
# Add aditional debian sources (contrib,...) into sources.d
COPY conf_sources.sh /tmp/
RUN /tmp/conf_sources.sh
# Install and set-up the current image - run only when creating the image
RUN apt-get update && apt-get install -y \
build-essential \
libncurses5-dev \