Skip to content

Instantly share code, notes, and snippets.

@rnz
rnz / run_fio.sh
Created June 19, 2019 22:49 — forked from sennajox/run_fio.sh
A script that runs fio test and genearates a simple result for each jobs
#!/bin/bash
if [ $# -lt 2 ]; then
echo "usage:$0 dev output_dir [iodepth]"
echo "example 1: Testing the whole block device. Attention: That will destory the filesystem on the target block device"
echo "./run_fio.sh /dev/sdb fio_test"
echo ""
echo "example 2: Testing a file, but not destory filesystem. Suppose the target device mount on /data"
echo "fallocate -l 1G /data/test.dat"
echo "./run_fio.sh /data/test.dat fio_test"
@rnz
rnz / sdc_raw_libaio_direct.fio
Created June 13, 2019 18:08 — forked from tcooper/sdc_raw_libaio_direct.fio
FIO test script for raw device, ioengine=libaio, oflag=direct
[global]
ioengine=libaio
invalidate=1
ramp_time=30
iodepth=1
runtime=180
time_based
direct=1
[write-sdc-4k-seq]
#!/usr/bin/perl
use strict;
#use Data::Dumper qw(Dumper);
my $first = 1;
print "{\n";
print "\t\"data\":[\n\n";
@rnz
rnz / gitlab-registry-cleaner.py
Created August 21, 2018 23:53 — forked from pbabics/gitlab-registry-cleaner.py
Python script for removal of old Gitlab Registry tags (per project), usefull when you have many tags and you are too lazy to remove them manualy
#!/usr/bin/env python
import os
import json
import argparse
import math
from datetime import datetime
import dateutil.parser
import time
import sys
@rnz
rnz / killcx
Created February 15, 2018 12:37 — forked from kisel/killcx
killcx
#!/usr/bin/perl
######################################################################
# killcx :
#
# Close a TCP connection under Linux.
#
# (c) Jerome Bruandet - <[email protected]>
#
# version 1.0.3 - 18-May-2011
#
@rnz
rnz / reclaimWindows10.ps1
Created January 8, 2018 13:10 — forked from alirobe/reclaimWindows10.ps1
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults)
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <[email protected]>
# Modified by: alirobe <[email protected]> based on my personal preferences.
# Version: 2.10.1, 2017-11-25
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, 'smart' features, and 3rd party bloat ...
@rnz
rnz / Ansible-Vault how-to.md
Created July 18, 2017 16:44 — forked from tristanfisher/Ansible-Vault how-to.md
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

##Working with ansible-vault

I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

@rnz
rnz / pg_graph
Created June 21, 2017 23:19 — forked from akorotkov/pg_graph
Draw psql output as iTerm2 v3 inline graph using matplotlib
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Draw psql output as iTerm2 v3 inline graph using matplotlib
# Author: Alexander Korotkov <[email protected]>
import sys
import re
import warnings
import matplotlib
matplotlib.use("Agg")
upstream wiki
{
server localhost:8080;
keepalive 32;
}
server {
listen *:80;
return 301 https://$host$request_uri;
@rnz
rnz / wps_openwrt.sh
Created May 7, 2016 19:40 — forked from alghanmi/wps_openwrt.sh
WPS on OpenWRT -- Enabling Wi-Fi Protected Setup on OpenWRT
##
## WPS on OpenWRT
## This script enables Wi-Fi Protected Setup on OpenWRT.
##
## Resources
## http://wiki.openwrt.org/doc/uci/wireless#wps.options
##
#Install the full wpad package
opkg update