Skip to content

Instantly share code, notes, and snippets.

View agustik's full-sized avatar

Ágúst Ingi Kjartansson agustik

  • Landspítali, Freelance
  • Iceland
View GitHub Profile
@agustik
agustik / nxctl
Last active August 29, 2015 14:08
Nginx handy control script
#!/bin/bash
# variable in [] is optional
# cache
# flush [name]
# all
# size
# status [name]
# cert
@agustik
agustik / pm2.json
Created April 10, 2015 18:00
pm2 Kibana4
[{
"name" : "Kibana4",
"script" : "./src/bin/kibana.js",
"env": {
"NODE_ENV": "production",
"CONFIG_PATH": "./config/kibana.yml"
}
}]
@agustik
agustik / vrrp
Last active March 12, 2018 23:22
simple keepalived status script for 2 interfaces
#!/bin/bash
configfile=/etc/keepalived/keepalived.conf
content=$(egrep '(vrrp_instance|interface|virtual_ipaddress)' -A1 $configfile | egrep -v "(\-\-|track_|virtual_)" | grep -A6 vrrp_);
#echo "$content";
instance_1=$(echo "$content" | grep "VI_1" -A4);
instance_2=$(echo "$content" | grep "VI_2" -A4);
@agustik
agustik / iptables
Last active September 24, 2015 08:55
ICELAND iptables config
-N ICELAND
-A INPUT -s 5.23.64.0/19 -j ICELAND
-A INPUT -s 31.15.112.0/21 -j ICELAND
-A INPUT -s 31.209.136.0/21 -j ICELAND
-A INPUT -s 31.209.144.0/20 -j ICELAND
-A INPUT -s 31.209.192.0/18 -j ICELAND
-A INPUT -s 37.152.64.0/21 -j ICELAND
-A INPUT -s 37.205.32.0/21 -j ICELAND
-A INPUT -s 37.235.49.0/24 -j ICELAND
-A INPUT -s 46.22.96.0/20 -j ICELAND
@agustik
agustik / ghost-memsql.sql
Created September 25, 2015 13:49
Ghost schema for MemSQL
-- phpMyAdmin SQL Dump
-- version 4.0.10.10
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 25, 2015 at 01:00 PM
-- Server version: 5.1.73
-- PHP Version: 5.3.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
@agustik
agustik / angular-lazyimage.js
Created October 13, 2015 17:01
Angularjs Lazyload images
/**
<div lazyimg lowres="small_landscape.jpg" highres="large_landscape.jpg" class="lazy-loader">
</div>
**/
angular.module('lazy', [])
.directive('lazyimg', function (){
@agustik
agustik / nodesource.repo
Created March 28, 2016 19:27
Nodesource repo snippet
[nodesource]
name=Nodesoruce RPM repo
baseurl=https://rpm.nodesource.com/pub_4.x/el/$releasever/$basearch/
enabled=1
gpgcheck=0
@agustik
agustik / netdata.conf
Created April 1, 2016 12:09
Netdata default conf
# NetData Configuration
# You can uncomment and change any of the options below.
# The value shown in the commented settings, is the default value.
# global netdata configuration
[global]
config directory = /etc/netdata
plugins directory = /usr/libexec/netdata/plugins.d
web files directory = /usr/share/netdata/web
@agustik
agustik / netdata.init
Created April 1, 2016 13:11
Netdata Init script
#!/bin/sh
#
# Netdata - this script starts and stops the netdata daemon
#
# chkconfig: - 85 15
# description: Netdata
# processname: netdata
# config: /etc/netdata/netdata.conf
# config: /etc/sysconfig/netdata
# pidfile: /var/run/netdata.pid
@agustik
agustik / netdata.spec
Last active July 11, 2016 11:04
Netdata Spec file
%define netdata_user netdata
%define netdata_group %{netdata_user}
%define netdata_logdir %{_localstatedir}/log/netdata
%define netdata_confdir %{_sysconfdir}/netdata
%define netdata_datadir %{_datadir}/netdata
%define netdata_web %{_datadir}/netdata/web
%define netdata_cache %{_localstatedir}/cache/netdata
%define netdata_plugins %{_libexecdir}/netdata
%define netdata_bin %{_sbindir}/netdata