Skip to content

Instantly share code, notes, and snippets.

View jozko's full-sized avatar
:octocat:
YAML && 🤦‍♂️

Jozko Skrablin jozko

:octocat:
YAML && 🤦‍♂️
View GitHub Profile
#!/bin/sh
# This script installs the Nix package manager on your system by
# downloading a binary distribution and running its installer script
# (which in turn creates and populates /nix).
{ # Prevent execution if this script was only partially downloaded
unpack=nix-binary-tarball-unpack
@jozko
jozko / pam_and_access_conf.md
Last active May 13, 2016 14:17
Prevent local login while allowing ssh login for a user

##Prevent local login while allowing ssh login for a user

  • Assumptions:

    • Running Ubuntu 12.04/14.04
    • Affected user is foouser
  • Edit /etc/pam.d/login and /etc/pam.d/sshd - uncomment/add following line

account required pam_access.so
traceroute 213.133.123.142
traceroute to 213.133.123.142 (213.133.123.142), 64 hops max, 52 byte packets
1 router.zomg.si (192.168.88.1) 2.323 ms 1.206 ms 4.894 ms
2 cpe-31-15-169-1.cable.telemach.net (31.15.169.1) 12.284 ms 2.817 ms 2.243 ms
3 gw-ftth-lj.telemach.net (94.140.64.254) 2.246 ms 1.947 ms 3.643 ms
4 185.66.148.10.ipv4.telemach.net (185.66.148.10) 8.081 ms 8.050 ms 7.902 ms
5 185.66.148.219.ipv4.telemach.net (185.66.148.219) 8.457 ms 7.701 ms 9.056 ms
6 185.66.148.217.ipv4.telemach.net (185.66.148.217) 20.103 ms 21.295 ms 17.331 ms
7 peer-as31042.sbb.rs (82.117.193.217) 8.322 ms 8.805 ms 10.984 ms
8 decix-gw.hetzner.de (80.81.192.164) 23.349 ms 19.841 ms 22.532 ms
@jozko
jozko / u3
Last active October 31, 2016 21:48
############################################################
# Dockerfile to run https://github.com/univizor/u3
# Based on Alpine
############################################################
# Set the base image to Alpine
FROM python:3.5-alpine
# File Author / Maintainer
MAINTAINER Jozko Skrablin
@jozko
jozko / Dockerfile
Created January 2, 2017 18:28
Dockerfile with Oracle Java 8. Scala 2.11.8 and scala-sbt 0.13.13
#
# Dockerfile with Oracle Java 8. Scala 2.11.8 and scala-sbt 0.13.13
# Based on Ubuntu Xenial
# Adapted from https://github.com/dockerfile/java
# Maintained by Jozko Skrablin
#
# Pull base image.
FROM ubuntu:xenial
with import <nixpkgs> {};
let
Scrapy = python35Packages.buildPythonPackage rec {
name = "Scrapy-1.3.0";
src = fetchurl {
url = "https://pypi.python.org/packages/e1/2d/f54cb2bed5d1d4bbc6ae093842282c8a0daad8c0cd9bf7504fbdf01b657f/Scrapy-1.3.0.tar.gz";
md5 = "605e38a6ed446c9bdef8c0d0f09b8f61";
};
#propagatedBuildInputs = [ python35Packages.pyopenssl python35Packages.lxml python35Packages.service-identity python35Packages.parsel PyDispatcher python35Packages.queuelib python35Packages.twisted python35Packages.attrs w3lib];
@jozko
jozko / minimesos_traefik.md
Last active September 14, 2017 16:53
Minimesos with Traefik

Minimesos with Traefik

Setup

  • One Hetzner dedicated box
  • Minimesos info
# minimesos version
0.13.0
@jozko
jozko / Dockerfile
Created October 3, 2017 14:41
gcloud compatible Docker CE image
from docker:17.06.1-ce
ENV CLOUD_SDK_VERSION 171.0.0
ENV PATH /google-cloud-sdk/bin:$PATH
RUN apk --no-cache add \
curl \
python \
py-crcmod \
bash \
@jozko
jozko / inspect_headers.md
Last active February 26, 2018 11:07
Simple Python service to inspect request headers and X-Forwarded-For contents

app.py

from flask import Flask
from flask import request
from flask_json import FlaskJSON, json_response


app = Flask(__name__)
FlaskJSON(app)
@jozko
jozko / razer_setup.sh
Created November 12, 2018 15:17
Simple razer keyboard setup script - manage backlight color and brightness
#!/bin/bash
KBD=$(find -L /sys/bus/hid/drivers/razerkbd/ -maxdepth 2 -type f -name device_type -print 2> /dev/null | grep device_type)
KBD_DIR=$(dirname ${KBD})
echo ${KBD_DIR}
echo "Set keyboard color to E0E0E0"
echo -n -e "\xF0\xE0\xE0" > ${KBD_DIR}/matrix_effect_static