Skip to content

Instantly share code, notes, and snippets.

View adionditsak's full-sized avatar

Anders Aarvik adionditsak

  • urteknik
  • Copenhagen, Denmark.
View GitHub Profile
@adionditsak
adionditsak / RELK.sh
Last active February 21, 2021 04:25
Install the ELK stack (with Redis) with one script for the central log server (CentOS 6.5).
#/bin/bash
##########################################################
### INTRODUCTION
##########################################################
: '
Install and configure R (Redis) + ELK server from scratch on CentOS 6.5.
* Logstash version 1.4.2
* Elasticsearch version 1.3.2
@adionditsak
adionditsak / memcached_errors.txt
Last active August 29, 2015 14:05
make memcached errors
[root@... memcached-2.2.0]# make
/bin/sh /usr/local/php5515/bin/memcached-2.2.0/libtool --mode=compile cc -I/usr/include/php -I. -I/usr/local/php5515/bin/memcached-2.2.0 -DPHP_ATOM_INC -I/usr/local/php5515/bin/memcached-2.2.0/include -I/usr/local/php5515/bin/memcached-2.2.0/main -I/usr/local/php5515/bin/memcached-2.2.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/php5515/bin/memcached-2.2.0/php_memcached.c -o php_memcached.lo
libtool: compile: cc -I/usr/include/php -I. -I/usr/local/php5515/bin/memcached-2.2.0 -DPHP_ATOM_INC -I/usr/local/php5515/bin/memcached-2.2.0/include -I/usr/local/php5515/bin/memcached-2.2.0/main -I/usr/local/php5515/bin/memcached-2.2.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/php5515/bin/memcached-2.2.0/p
@adionditsak
adionditsak / add_server_to_ad.ps1
Created August 4, 2014 12:51
Adds/signs server to AD/Active Directory
# Set DNS to Primary AD
$eth = Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled ='true'";
$dns_servers = "1.2.3.4"
$eth.SetDNSServerSearchOrder($dns_servers);
# Add domain
$domain = "domain.local"
$password = "password" | ConvertTo-SecureString -asPlainText -Force
$username = "$domain\Administrator"
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
@adionditsak
adionditsak / dns_smtp_test.py
Last active August 29, 2015 14:04
Simple DNS + SMTP test script - writes to CSV
#!/usr/bin/env python3
import sys
import csv
import random
import time
import smtplib
import dns.resolver
class DNS():
input {
stdin {
type => "stdin-type"
}
file {
type => "apache"
path => ["/var/log/apache2/access.log", "/var/log/apache2/ error.log"]
}
@adionditsak
adionditsak / debian-nw-conf
Last active August 29, 2015 13:56
A bit of eth0 and nw configuration for Debian snippets - static ip
# eth0
$ vim /etc/network/interfaces
# Auto generated lo interface
auto lo
iface lo inet loopback
# Static ip
iface eth0 inet static
address 10.0.0.50
@adionditsak
adionditsak / centos-nw-conf
Last active August 29, 2015 13:56
A bit of eth0 and nw configuration for CentOS snippets - static ip
# eth0
$ vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
NAME="eth0"
IPADDR=ipaddress
@adionditsak
adionditsak / backup_dir.sh
Last active August 29, 2015 13:56
Backup valuable content swiftly without much struggle
#!/usr/bin/env bash
#### DEPENDENCIES: mutt
#### VARS
[email protected]
DATE=$(date +%Y-%m-%d)
LOCAL_BACKUP=/path/to/backup
LOCAL_ARCHIVE=$HOME/backup-${DATE}.tar.gz
#!/usr/bin/env python
"""
FileCli
"""
import sys, os
class FileOperation():
@adionditsak
adionditsak / apache.pp
Created December 25, 2013 00:04
Maintain Apache2
class apache {
notify {'Apache2':
before => Service['apache2']
}
exec {'apt-get update':
command => '/usr/bin/apt-get update'
}