Skip to content

Instantly share code, notes, and snippets.

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

Mario Vejlupek elmariofredo

💭
building Cloud Native Thermostat 🔥 🥶
View GitHub Profile
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
@elmariofredo
elmariofredo / 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
@elmariofredo
elmariofredo / 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
@elmariofredo
elmariofredo / 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
# Put this in /etc/logrotate.d/mongodb
# http://stackoverflow.com/questions/5004626/mongodb-log-file-growth
/var/log/mongo/*.log {
daily
rotate 30
compress
dateext
missingok
notifempty
# Put this in /etc/logrotate.d/mongodb
# http://stackoverflow.com/questions/5004626/mongodb-log-file-growth
/var/log/mongo/*.log {
daily
rotate 30
compress
dateext
missingok
notifempty
@elmariofredo
elmariofredo / php-deploy.sh
Created July 2, 2014 19:18
Simple PHP deploy script using git, inspired by capistrano magic. Just run ./php-deploy.sh BRANCH-NAME and target apache to /srv/app/public folder.
#!/bin/bash
project_name=app
project_url=git@github.com:some/repo.git
target_branch=$1
if [ ! -d "/srv/$project_name/repo" ]
then
echo "Setting up repo for the firts time"
@elmariofredo
elmariofredo / apiary.apib
Created July 15, 2014 10:58
Example of failing API with static URI parameters
FORMAT: 1A
HOST: http://localhost
# example api
Is example api
# Group Users
Users related resources of the **Users API**
## Users Collection [/users]