Skip to content

Instantly share code, notes, and snippets.

View devopsmariocom's full-sized avatar
💭
building Cloud Native Thermostat 🔥 🥶

Mario Vejlupek devopsmariocom

💭
building Cloud Native Thermostat 🔥 🥶
View GitHub Profile
@devopsmariocom
devopsmariocom / openvpn.md
Last active December 26, 2015 18:29 — forked from padde/openvpn.md

OpenVPN

Generate Server Certificates

wget https://github.com/OpenVPN/easy-rsa/archive/master.zip
unzip master.zip
cd easy-rsa-master/easyrsa3
cp vars.example vars
@devopsmariocom
devopsmariocom / Fill_mikrotik_config.bash
Last active September 6, 2023 11:25
L2TP IPSEC VPN Auto config for mikrotik based on following tutorial http://www.nasa-security.net/mikrotik/mikrotik-l2tp-with-ipsec/ !!! Edit user name/user pass and ipsec secret
# Fetch and fill config
mikrotik_vpn_config=$(curl https://gist.github.com/elmariofredo/7232556/raw/VPN-L2TP-IPSEC.mikrotik \
| sed -e '
s/IPSEC_PEER_SECRET/somesecret/g;
s/USER1_NAME/mario/g;
s/USER1_PASS/somepass/g;
s/IP_RANGE/172.16.24.100-172.16.24.200/g;
s/DNS_SERVER/172.16.22.1/g;
s/LOCAL_ADDRESS/172.16.22.1/g;
s/WINS_SERVER/172.16.22.1/g')
@devopsmariocom
devopsmariocom / DeveloperMeditation.md
Last active December 31, 2015 19:59
Few thoughts on sustainable development
  1. Comment your code while you are coding, try to comment every line whit bit more complex logic, use http://yardoc.org/ and http://yui.github.com/yuidoc/

  2. Keep code structured to guide eye when one is looking thru the code

  3. Try to reuse things first, when you are about to do something first try to think if anyone has done that before(search current code base or google)

  4. Keep things modular and reusable, try to think about every method if it can be possibly useful for something else than what is your original purpose, if yes(even in future) then make it that way to allow reuse of such method

  5. Think simple after it’s done, when code is done look if it cannot be simpler, then refactor with primary focus on flow from top to bottom, eye start at top of code and goes thru logic till end(if possible)

openssl genrsa -des3 -out trexglobal.com.key 4096
openssl req -new -key trexglobal.com.key -out trexglobal.com.csr
cp -v trexglobal.com.{key,original}
openssl rsa -in trexglobal.com.original -out trexglobal.com.key
rm -v trexglobal.com.original
openssl x509 -req -days 9999 -in trexglobal.com.csr -signkey trexglobal.com.key -out trexglobal.com.crt
@devopsmariocom
devopsmariocom / tvheadend.conf
Created March 24, 2014 16:19
Raspberry Pi - TvHeadEnd Server start script
# TvHeadEnd Server
description "Tvheadend server"
start on xbmc-started
script
su - pi -c "/usr/local/bin/tvheadend -f"
exit 0
end script
@devopsmariocom
devopsmariocom / test_dns_zone.rb
Created April 25, 2014 17:57
Check DNS zone file using simple ruby script and verify presence of A and CNAME records using csv file
require "csv"
csv = CSV.new(File.read('zone.csv'))
dns_servers = ["ns1.dns.net", "ns1.otherdns.net"]
csv.each do |row|
type = row[0]
name = row[1].lstrip
@devopsmariocom
devopsmariocom / install.sh
Last active August 29, 2015 14:01
Basic OS X Setup
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew doctor
brew install caskroom/cask/brew-cask
brew cask install google-chrome
brew cask install mplayerx
brew cask install vlc
brew cask install java
var gulp = require('gulp'),
spawn = require('child_process').spawn,
node;
var startServer = function() {
if (node) node.kill()
node = spawn('node', ['--harmony', 'index.js'], {
stdio: 'inherit'
})
# Reveal Library
chflags nohidden ~/Library
# Install homebrew
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
# Install homebrew cask
brew install caskroom/cask/brew-cask
# Install all necessary sw
brew cask install google-chrome
brew cask install firefox
brew cask install spectacle