This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* | |
* Get your Facebook-statuses and Twitter-tweets on your website with ease. | |
* Go to http://feedburner.com and burn your feed. | |
* Use your feedburner-url with this class to set feed. | |
* | |
* Author: Anders Aarvik | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# vars # | |
disk="/dev/disk0s2" # disk to monitor | |
current_usage=$(df -h | grep ${disk} | awk {'print $5'}) # get disk usage from monitored disk | |
max_usage="20%" # max 90% disk usage | |
mail="[email protected]" # mail to sent alert to | |
# functions # | |
function max_exceeded() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class apache { | |
notify {'Apache2': | |
before => Service['apache2'] | |
} | |
exec {'apt-get update': | |
command => '/usr/bin/apt-get update' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
FileCli | |
""" | |
import sys, os | |
class FileOperation(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# eth0 | |
$ vim /etc/sysconfig/network-scripts/ifcfg-eth0 | |
DEVICE="eth0" | |
NM_CONTROLLED="yes" | |
ONBOOT=yes | |
TYPE=Ethernet | |
BOOTPROTO=static | |
NAME="eth0" | |
IPADDR=ipaddress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
stdin { | |
type => "stdin-type" | |
} | |
file { | |
type => "apache" | |
path => ["/var/log/apache2/access.log", "/var/log/apache2/ error.log"] | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import csv | |
import random | |
import time | |
import smtplib | |
import dns.resolver | |
class DNS(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
OlderNewer