Skip to content

Instantly share code, notes, and snippets.

@udienz
udienz / backup-sql.sh
Created January 12, 2015 06:20
mysql backup entire database
#!/bin/bash
# 2014, Mahyuddin Susanto <[email protected]>
set -x
SQLPASS=WHATEVER
ARGS="-u root -h 202.154.57.61 -p$SQLPASS"
SAVE="$HOME/mysql-backup/$(hostname -f)/$(date +%Y%m%d%H%M)"
# remove database backup older that 90 days
find $HOME/mysql-backup -mtime +90 | xargs rm -rf
@udienz
udienz / sudoers
Created February 16, 2015 05:42
vagrant sudoers
vagrant ALL=NOPASSWD: ALL
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates
@udienz
udienz / a foreman setting example
Last active April 27, 2016 23:39
foreman+unicorn+nginx ssl offload on debian
echo "deb http://apt.puppetlabs.com wheezy main" >>/etc/apt/sources.list
apt-get update
apt-get install foreman unicorn
/etc/init.d/foreman stop
#disable /etc/init.d/foreman
rcconf
FROM udienz/images:xenial-ruby231
Maintainer Mahyuddin Susanto <[email protected]>
VOLUME /code
WORKDIR /code/
COPY tests/wrapper.sh /
ENTRYPOINT [ "/wrapper.sh" ]
#!/bin/bash
pwd
shopt -s globstar
cd /code
bundle install
bundle exec rake validate
@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
@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 / 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 / Dockerfile
Created August 17, 2016 02:58
Jekyll docker
FROM ruby:2.3
MAINTAINER Mahyuddin Susanto <[email protected]>
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"