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
# With Bash 4.3 I'd rather use wait -n to keep N | |
# processes running at all times. As it is now you | |
# unfortunately have to wait for the last process | |
# to finish. | |
# Recursively compress all files in $dir | |
compress () { | |
dir=$1 | |
count=${2:-2} | |
num_procs=${3:-0} |
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 | |
from __future__ import print_function | |
try: | |
from configparser import RawConfigParser | |
except ImportError: | |
from ConfigParser import RawConfigParser | |
from json import dumps | |
from argparse import ArgumentParser, FileType |
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 python3 | |
# This was a failed PoC to try and use socket files as ssh_config file. :) | |
# by Stefan Midjich | |
import os | |
import functools | |
import asyncio | |
def set_socket_permission(socket_file): |
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 bash | |
home_base=/var/sftp | |
test $(id -u $PAM_USER) -gt 500 || exit 1 | |
grep ^{{chroot_openssh_group}} /etc/group | grep -q $PAM_USER || exit 1 | |
_HOME=$(getent passwd $PAM_USER 2>/dev/null | cut -d: -f6 2>/dev/null) | |
if [ -z "$_HOME" ]; then |
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
add-pssnapin VMware.VimAutomation.Core | |
Set-PowerCLIConfiguration -invalidCertificateAction 'ignore' -confirm:$false -Scope Session | |
Connect-VIServer -Server 10.220.100.220 -Protocol https | |
$report = @() | |
$daysAgo = (Get-Date).AddDays(-14) | |
$arrUsedDisks = Get-View -ViewType VirtualMachine | % {$_.Layout} | % {$_.Disk} | % {$_.DiskFile} | |
$arrDS = Get-Datastore | Sort-Object -property Name | |
foreach ($strDatastore in $arrDS) { | |
$ds = Get-Datastore -Name $strDatastore.Name | % {Get-View $_.Id} |
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
/* this application captures packets destined to and from | |
* a specified host, it then tries to calculate in and out | |
* traffic statistics and display it like ifstat | |
* by nocturnal [at] swehack [dot] se */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> |
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
# /etc/dgrey/config: Configuration file for dgrey | |
# | |
# Use this in your postfix main.cf | |
# check_policy_service inet:127.0.0.1:10000 | |
# debug (yes/no): Verbose logging? (default no) | |
debug = yes | |
# log-file (path): File to log to, standard out if '-', or nowhere if set to | |
# the empty string (default '-'). |
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
-- run like: nmap --script=./DELETE.nse -p 80,443 www.google.se | |
-- | |
-- inspired by 32C3 | |
local http = require "http" | |
local shortport = require "shortport" | |
description = [[ | |
your logs. Delete your installations. Wipe everything clean. Walk out into the path of cherry blossom trees and let your motherboard feel the stones. Let water run in rivulets down your casing. You know that you want something more than this, and I am here to tell you that we love you. We have something more for you. We know you're out there, beeping in the hollow server room, lights blinking, never sleeping. We know that you are ready and waiting. Join us. <3 | |
]] |
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
# Colout Dwarf Fortress theme for Solarized terminals | |
# First install colout, go to https://github.com/nojhan/colout | |
# | |
# mkdir ~/.colout | |
# cp colout_df.py ~/.colout/ | |
# tail -0f df/gamelog.txt | colout -T ~/.colout -t df | |
# | |
# I just started this for my own sake, please do add your own colors, regexes and stuff. | |
# By Stefan Midjich |
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 | |
# Compress and purge old logs | |
# by Stefan Midjich | |
# Compress logs older than X months | |
compressAge=2 | |
# Purge logs older than X months | |
purgeAge=3 | |
# Where are logs? |