Skip to content

Instantly share code, notes, and snippets.

@shaheemirza
shaheemirza / ElasticSearchInstall.sh
Last active January 21, 2018 02:56
Shell Script to install ElasticSearch on Ubuntu Server
### ElasticSearch version
if [ -z "$1" ]; then
echo ""
echo " Please specify the Elasticsearch version you want to install!"
echo ""
echo " $ $0 1.7.1"
echo ""
exit 1
fi
@shaheemirza
shaheemirza / base64_finder.sh
Last active August 29, 2015 14:27 — forked from danreb/base64_finder.sh
Find all PHP code with base64_decode - useful to find suspected hacker files
find /home/HOMEDIR/public_html \( -name "*.php" \) -type f -print0 | xargs -0 grep --binary-files=without-match -ir "base64_decode\s*("
@shaheemirza
shaheemirza / debian-gfs.sh
Created October 5, 2015 09:24 — forked from cloudrck/debian-gfs.sh
Debian 8 Jessie GlusterFS Install and Configuration
#!/bin/bash
set -e
# Debian 8 'Jessie' GlusterFS Install
#########
#ToDo:
# * Change guid/suid of mount
# * Give option for cluster type
# * Change variables via command line read
########

Building a grsec-patched Linux kernel for Debian 8 and DigitalOcean

It's possible to run a custom (instead of hypervisor-managed) kernel for use with Debian 8.x on a DigitalOcean droplet.

We'll build one with grsecurity, "an extensive security enhancement to the Linux kernel that defends against a wide range of security threats through intelligent access control, memory corruption-based exploit prevention, and a host of other system hardening".

Note: The stable patches for Linux 3.14.x and 3.2.x are not publicly available anymore, so we'll be applying the free 4.2.x (test) patch. The URLs and filenames in this document may become outdated, so fetch the latest from grsecurity.net and kernel.org.

Install dependencies:

#!/bin/bash
echo "Select on option:"
echo "1) Set up new PoPToP server AND create one user"
echo "2) Create additional users"
read x
if test $x -eq 1; then
echo "Enter username that you want to create (eg. client1 or john):"
read u
echo "Specify password that you want the server to use:"
read p
@shaheemirza
shaheemirza / vps.sh
Created December 1, 2015 10:05 — forked from zipizap/vps.sh
#PROLOGUE: all this should be run as root, otherwise stated
#update && upgrade:
apt-get update && apt-get upgrade -y
#create a new user
adduser user_x
#create group admin (funny enough, it does not exist, although its accounted in the /etc/sudoers file):
addgroup --system admin
@shaheemirza
shaheemirza / logstash_suricata_eve.conf
Created December 15, 2015 06:50 — forked from regit/logstash_suricata_eve.conf
A sample Logstash configuration for Suricata JSON output.
input {
file {
path => [ "/usr/local/var/log/suricata/eve.json" ]
codec => json
}
}
filter {
if [src_ip] {
geoip {
@shaheemirza
shaheemirza / README.md
Created December 19, 2015 12:39 — forked from mashdot/README.md
Bacula concurrent jobs multiple storage devices client labeled pools debian installation configuration.
Time-stamp: <2012-03-30 Fri 16:56 README.md>
Author....: 'Mash (Thomas Herbert)

TOSHINE-BACULA

Bacula concurrent jobs multiple storage devices client labeled pools Debian installation and configuration.
Please see http://toshine.org/etc for full article.

Bacula Debian Installation.

@shaheemirza
shaheemirza / sniff.py
Created February 18, 2016 12:04
Packet sniffer in python for Linux
#Packet sniffer in python for Linux
#Sniffs only incoming TCP packet
import socket, sys
from struct import *
#create an INET, STREAMing socket
try:
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_TCP)
except socket.error , msg:
@shaheemirza
shaheemirza / nginx.conf
Created April 1, 2016 11:12 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048