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 | |
import threading, paramiko, random, socket, time, sys | |
paramiko.util.log_to_file("/dev/null") | |
blacklist = [ | |
'127' | |
] | |
passwords = [ |
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
git clone https://github.com/gcoop-libre/ansible-role-pure-ftpd.git && cd ansible-role-pure-ftpd/ && echo '[ftpserver]' >> /etc/ansible/hosts && echo 'ftp ansible_ssh_host=127.0.0.1' >> /etc/ansible/hosts && ansible-playbook -i 127.0.0.1 playbook.yml |
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
*filter | |
-A INPUT -i lo -j ACCEPT | |
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT | |
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
-A OUTPUT -j ACCEPT | |
-A INPUT -p tcp --dport 80 -j ACCEPT |
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
global | |
log /dev/log local0 | |
log /dev/log local1 notice | |
chroot /var/lib/haproxy | |
stats socket /run/haproxy/admin.sock mode 660 level admin | |
stats timeout 30s | |
user haproxy | |
group haproxy | |
daemon | |
maxconn 2048 |
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
--- | |
- name: Install something | |
hosts: localhost | |
user: root | |
# remote_user: user | |
# sudo: yes | |
roles: | |
- somerole1 | |
- somerole2 |
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
apt-get install -y ansible | |
ansible-galaxy install gcoop-libre.pure-ftpd | |
echo '- hosts: localhost | |
roles: | |
- gcoop-libre.pure-ftpd' > playbook.yml | |
ansible-playbook -i 127.0.0.1 playbook.yaml |
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
DECLARE @name VARCHAR(50) -- database name | |
DECLARE @path VARCHAR(256) -- path for backup files | |
DECLARE @fileName VARCHAR(256) -- filename for backup | |
DECLARE @fileDate VARCHAR(20) -- used for file name | |
-- specify database backup directory | |
SET @path = 'D:\Backup\' | |
-- specify filename format | |
SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112) |
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
# Sort access by Response Codes | |
awk -F\" '{print $2}' access.log | awk '{print $2}' | sort | uniq -c | sort -r | |
# Combined | |
awk '{print $9}' access.log | sort | uniq -c | sort | |
Example: | |
4 405 | |
19 503 | |
564 500 |
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
#!/bin/bash | |
if [ "$1" = "-w" ] && [ "$2" -gt "0" ] && [ "$3" = "-c" ] && [ "$4" -gt "0" ]; then | |
memTotal_b=`free -b |grep Mem |awk '{print $2}'` |
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
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 | xargs -L1 -I {} curl -XPUT -H 'Content-Type: application/json' 'http://localhost:9201/twitter/tweet/{}' -d '{ | |
"user" : "{}", | |
"post_date" : "2009-11-15T14:12:12", | |
"message" : "trying out Elastic {}" | |
}' |