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 / rendertemplate.js
Created March 23, 2017 19:55
Render template, great for old jquery apps
/*
<div class="foobar" id="torender">
<div class="adf">
<h4>{{name}} the {{job.title}} like {{hobby}}</h4>
</div>
</div>
*/
@agustik
agustik / ciphers.sh
Created March 14, 2017 10:38
Get all supported ciphers for tls/ssl connection
#!/usr/bin/bash
# OpenSSL requires the port number.
HOST=$1
PORT=$2
if [ -z "$PORT" ]; then
PORT="443"
fi
@agustik
agustik / config-load.js
Created February 20, 2017 17:00
Load config, and reload on SIGHUP
'use strict'
const fs = require('fs');
const yaml = require('js-yaml');
const EventEmitter = require('events');
const ev = new EventEmitter();
var configLoader = function (configfile, callback){
@agustik
agustik / zonetransfer.sh
Created February 1, 2017 10:29
zonetransfer script
#!/bin/bash
domain=$1
dns=$(dig $domain ns +noall +additional | grep "IN" -A 100 | awk '{print $1}')
stop=
@agustik
agustik / stessload.sh
Created January 31, 2017 21:45
Stress test hardware
#!/bin/bash
# Sækja stress
#
# yum localinstall ftp://fr2.rpmfind.net/linux/dag/redhat/el7/en/x86_64/dag/RPMS/stress-1.0.2-1.el7.rf.x86_64.rpm
#
# eða
# wget ftp://fr2.rpmfind.net/linux/dag/redhat/el7/en/x86_64/dag/RPMS/stress-1.0.2-1.el7.rf.x86_64.rpm
# yum localinstall stress-1.0.2-1.el7.rf.x86_64.rpm
@agustik
agustik / chrome.cmd
Last active January 11, 2017 23:01
Delete Chrome Extensions
@echo off
echo "Press enter to start, THIS WILL REMOVE ALL EXTENSIONS FROM CHROME"
pause
echo "Killing all Chrome processes"
taskkill -F -T -im "chrome.exe"
echo "Going into %LOCALAPPDATA%/Google/chrome/User Data/Default/Extensions"
cd "%LOCALAPPDATA%/Google/chrome/User Data/Default/Extensions"
@agustik
agustik / certexp.sh
Last active September 28, 2016 08:36
Finds nginx certs and checks enddate
#!/bin/bash
base=$1;
if [ -z "$base" ]; then
echo "Need input dir"
exit
fi
@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
@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