Skip to content

Instantly share code, notes, and snippets.

@kraeml
kraeml / rPi3-php7-setup.sh
Created January 29, 2017 20:22 — forked from Lewiscowles1986/rPi3-php7-setup.sh
Raspberry Pi PHP7, Nginx 1.9 Installer
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
echo "deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi" > /etc/apt/sources.list.d/stretch.list
echo "APT::Default-Release \"jessie\";" > /etc/apt/apt.conf.d/99-default-release
@kraeml
kraeml / template.json
Created February 1, 2017 12:47
Template for portainer
[
{
"title": "Registry",
"description": "Docker image registry",
"logo": "https://cloudinovasi.id/assets/img/logos/registry.png",
"image": "registry:latest",
"ports": [
"5000/tcp"
]
},
[
{
"title": "Pi MySQL",
"description": "The most popular open-source database",
"logo": "https://cloudinovasi.id/assets/img/logos/mysql.png",
"image": "hypriot/rpi-mysql:latest",
"env": [
{
"name": "MYSQL_ROOT_PASSWORD",
"label": "Root password"
#!/bin/bash
for i in $(find ~/.vagrant.d/ -iname master_id -exec ls {} \;)
do
VBoxManage unregistervm $(cat ${i}) --delete
rm ${i}
done
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import feedparser
from flask import Flask
from flask import render_template
from flask import request
import json
import urllib2
import urllib
<html>
<head>
<title>Schlagzeilen</title>
</head>
<body>
<h1>Schlagzeilen</h1>
<h2>Current weather</h2>
<p>City: <b>{{weather.city}}, {{weather.country}}</b></p>
<p>{{weather.description}} |{{weather.temperature}}&#8451;</p>
<form>
@kraeml
kraeml / nb_remove_output.py
Created March 26, 2017 07:27 — forked from laurentperrinet/nb_remove_output.py
Remove output from Jupyter notebook from the command line
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Remove output from existing Jupyter Notebooks.
Modified from remove_output by Minrk, damianavila, gabraganca.
References:
[0]: https://github.com/jupyter/nbformat
[1]: http://nbformat.readthedocs.org/en/latest/index.html
[2]: http://blog.jupyter.org/2015/04/15/the-big-split/
@kraeml
kraeml / bind9
Last active March 29, 2017 08:45
Bind9 config snippets
# run resolvconf?
RESOLVCONF=no
# startup options for the server
OPTIONS="-4 -u bind"
from dbhelper import DBHelper
from flask import Flask
from flask import render_template
from flask import request
import json
import datetime
import dateparser
import string
---
# https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lemp-on-ubuntu-16-04
- hosts: wp
become: yes
vars:
WP_DOMAIN: "wordpress.rdf.loc"
WP_PATH: "/var/www/html/wordpress"
tasks:
- name: Install software