Skip to content

Instantly share code, notes, and snippets.

@udienz
udienz / entrypoint.sh
Last active March 27, 2023 15:40
SSH Docker entrypoint
#!/bin/bash
set -eo pipefail
/bin/rm -v /etc/ssh/ssh_host_*
ssh-keygen -A
@udienz
udienz / cf-nginx-allow.conf
Last active January 5, 2023 13:12
Nginx+Cloudflare, restore and limit access only from cloudflare
# Cloudflare IP's
allow 173.245.48.0/20;
allow 103.21.244.0/22;
allow 103.22.200.0/22;
allow 103.31.4.0/22;
allow 141.101.64.0/18;
allow 108.162.192.0/18;
allow 190.93.240.0/20;
allow 188.114.96.0/20;
allow 197.234.240.0/22;
@udienz
udienz / k8s-cacti.yaml
Last active January 17, 2020 02:04
Cacti running on kubernetes.
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
cattle.io/creator: norman
workload.user.cattle.io/workloadselector: deployment-cacti-cacti
name: cacti
namespace: cacti
spec:
replicas: 1
@udienz
udienz / tac_plus
Created January 25, 2019 01:30
tacacs services, work in ubuntu/debian based
#!/bin/sh
#
# Start-stop script for tac_plus
#
# (C)2001-2010 by Marc Huber <Marc.Huber@web.de>
# $Id: etc_init.d_tac_plus,v 1.1 2011/07/22 17:04:03 marc Exp $
#
# chkconfig: 2345 99 99
# description: Starts and stops the tac_plus server process.
#
@udienz
udienz / Dockerfile
Created August 17, 2016 02:58
Jekyll docker
FROM ruby:2.3
MAINTAINER Mahyuddin Susanto <udienz@gmail.com>
ADD code/ /code/
WORKDIR /code
RUN bundle install
ENV LANGUAGE="en_US" \
LANG="en_US.UTF-8" \
LC_ALL="en_US" \
LC_CTYPE="UTF-8"
@udienz
udienz / create-master.sh
Last active August 12, 2016 23:22
Docker Swarm
#!/bin/bash
set -ex
NAME=swarm
lxc stop $NAME
lxc delete $NAME
lxc launch ubuntu:16.04 $NAME -p default -p docker
@udienz
udienz / docker-compose.yml
Last active August 5, 2016 01:49
build wordpress with docker (manual way)
version: '2'
services:
web:
container_name: web
image: nginx:latest
ports:
- "9081:80"
volumes:
- ./code:/code
@udienz
udienz / mtrancid
Last active May 31, 2020 14:08
Rancid script for mikrotik and vyatta
#! /usr/bin/perl
##
## $Id$
##
## rancid 2.3.9
## Copyright (C) 1997-2011 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
## without fee for non-commerical purposes provided that this license
#!/bin/bash
pwd
shopt -s globstar
cd /code
bundle install
bundle exec rake validate
FROM udienz/images:xenial-ruby231
Maintainer Mahyuddin Susanto <udienz@gmail.com>
VOLUME /code
WORKDIR /code/
COPY tests/wrapper.sh /
ENTRYPOINT [ "/wrapper.sh" ]