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 / 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.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-systemd
Last active April 4, 2016 19:52
Netdata Systemd
[Unit]
Description=netdata
After=network.target httpd.service squid.service nfs-server.service mysqld.service named.service postfix.service
[Service]
Type=forking
WorkingDirectory=/tmp
User=root
Group=root
PIDFile=/var/run/netdata/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
@agustik
agustik / scandisk.sh
Last active August 12, 2016 13:31
Scan for disk oneliner
## Scan for new disks
for host in $(ls /sys/class/scsi_host/); do echo "- - -" > /sys/class/scsi_host/$host/scan; done
## scan for disk changes
for scsi in $(ls /sys/class/scsi_disk/); do echo "1" > /sys/class/scsi_disk/$scsi/device/rescan; done