Skip to content

Instantly share code, notes, and snippets.

View dky's full-sized avatar
馃崪

dky

馃崪
View GitHub Profile
@dky
dky / gist:4ba105a5c93f6283eb0b
Created February 4, 2015 16:15
Sending proper envelope and header php
<?php
mail('[email protected]','subject!','body!','From: [email protected]','-f [email protected]');
?>
SetEnvIf REMOTE_ADDR "(.+)" CLIENTIP=$1
SetEnvIf X-Forwarded-For "^([0-9.]+)" CLIENTIP=$1
LogFormat "%{CLIENTIP}e %D %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" trueip_combined
CustomLog /var/log/httpd/<%= name %>_access_log trueip_combined
@dky
dky / splunk_rename_forwarder
Created December 16, 2014 22:10
Splunk rename forwarder
/opt/splunkforwarder/bin/splunk stop
rm /opt/splunkforwarder/etc/system/local/server.conf
rm /opt/splunkforwarder/etc/system/local/inputs.conf
rm /opt/splunkforwarder/etc/myinstall/splunkd.xml
touch /opt/splunkforwarder/ftr
/opt/splunkforwarder/bin/splunk start --accept-license
@dky
dky / subscription_disable
Created December 2, 2014 21:27
Disable Subscription manager on RHEL7
sed -i 's/enabled=1/enabled=0/g' /etc/yum/pluginconf.d/subscription-manager.conf
@dky
dky / gist:9982457
Created April 4, 2014 20:23
Splunk private index sum
cd /opt/splunk/var/lib/splunk && for i in `ls -1 -d */| less |egrep -iv "summary|audit|authDb|blockSignature|defaultdb|hashDb|fishbucket|_internaldb|notable|notabledb|persistentstorage|session_*|appserver|historydb"`; do du -sk $i; done | awk '{ SUM += $1} END { print SUM/1024/1024 }'
@dky
dky / gist:9982144
Created April 4, 2014 20:04
List all non Splunk indexes
cd /opt/splunk/var/lib/splunk && for i in `ls -1 -d */| less |egrep -iv "summary|audit|authDb|blockSignature|defaultdb|hashDb|fishbucket|_internaldb|notable|notabledb|persistentstorage|session_*|appserver|historydb"`; do du -sh $i; done
@dky
dky / gist:6059745
Created July 23, 2013 03:56
Openssl create hashed password
openssl passwd -1 yourpassword
@dky
dky / gist:6059611
Created July 23, 2013 03:19
Vagrant test ssh no check known_hosts
ssh -i ~/.vagrant.d/insecure_private_key [email protected] -o StrictHostKeyChecking=no
@dky
dky / gist:6059605
Created July 23, 2013 03:18
Vagrant SSH
ssh -i ~/.vagrant.d/insecure_private_key [email protected]
@dky
dky / gist:6055764
Created July 22, 2013 17:24
Basic kickstart template
text
install
url --url=http://mirror.centos.org/centos/6/os/i386/
lang en_US.UTF-8
keyboard us
network --device eth0 --bootproto dhcp
rootpw --iscrypted $6$VFjT1z9ta1HqsMbF$QUxiFloguJcgvvLvkT8l4eSM8YPs.qSHwpAQfFa/2tp8FY/HtiSP/Lr.8bGhjCMqUQzM4wUm3wpBhQmmGN02W0
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512 --enablefingerprint
selinux --disabled