Skip to content

Instantly share code, notes, and snippets.

View birkof's full-sized avatar
👋

Daniel Stancu birkof

👋
View GitHub Profile
Sudo su
Install Node Exporter:
docker run -d --net="host" --pid="host" -v "/:/host:ro,rslave" quay.io/prometheus/node-exporter:latest --path.rootfs=/host
Create Prometheus Config:
nano prometheus.yml
#!/usr/bin/env bash
OS=`uname -s`
if [ $OS != "Darwin" ]; then
echo "This script is OSX-only. Please do not run it on any other Unix."
exit 1
fi
if [[ $EUID -eq 0 ]]; then
#!/usr/bin/env bash
: ' Script that enables TLS for Docker service in Ubuntu 16.x
This script is intended to be run as root for current user
It;
- Generates the keys
- Creates the daemon.json Docker config file
#!/usr/bin/env bash -euo pipefail
curl -X PUT "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE/dns_records/$CLOUDFLARE_DNS_ID" \
-H "Authorization: Bearer $CLOUDFLARE_TOKEN" \
-H "Content-Type: application/json" \
--data '{"type":"A","name":"'$CLOUDFLARE_DNS_NAME'","content":"'$CLOUDFLARE_DNS_CONTENT'","ttl":1,"proxied":true}'

Enable Docker Remote API with TLS client verification

Docker's Remote API can be secured via TLS and client certificate verification.
First of all you need a few certificates and keys:

  • CA certificate
  • Server certificate
  • Server key
  • Client certificate
  • Client key

Create certificate files

Keybase proof

I hereby claim:

  • I am birkof on github.
  • I am birkof (https://keybase.io/birkof) on keybase.
  • I have a public key ASB9zzVhq2RVyuWDCGudpuKS6zE-dTSoAk79yIAuhJYFSQo

To claim this, I am signing this object:

Verifying my Blockstack ID is secured with the address 138s2TV7uAz8MPtFs8MWucMa4rmJ7zRaRt https://explorer.blockstack.org/address/138s2TV7uAz8MPtFs8MWucMa4rmJ7zRaRt
@birkof
birkof / index.html
Created March 15, 2016 08:21 — forked from mandulaj/index.html
Webssh
<!doctype html>
<html>
<head>
<title>SSH Client</title>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.5/socket.io.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<style>
body {
margin: 0;
padding: 0;
@birkof
birkof / 1_Result.php
Created February 27, 2016 01:36 — forked from cystbear/1_Result.php
Custom annotations in Symfony2 (http://habrahabr.ru/blogs/symfony/133270/)
<?php
class DefaultController extends Controller
{
/**
* Dashboard page.
* @Permissions(perm="dashboard_view")
* @Route("/", name="ITEDashboardBundle_index")
* @Template()
* @return array
@birkof
birkof / LvJqd.markdown
Created September 20, 2015 14:30
LvJqd