Skip to content

Instantly share code, notes, and snippets.

View kyxap1's full-sized avatar

Oleksandr Kukhar kyxap1

View GitHub Profile
@kyxap1
kyxap1 / aggregate-cidr-addresses.pl
Created May 25, 2020 22:42 — forked from denji/README.md
Take a list of CIDR address blocks and combine them, for example, 192.168.0.0/24 and 192.168.1.0/24 gives 192.168.0.0/23. I usually use "list-iana-reserved-ranges | aggregate-cidr-addresses" to get a list of blocks to not report with firewall log processing. [ https://github.com/job/aggregate6 | https://github.com/flowchartsman/cidr-convert ]
#!/usr/bin/perl
#
# aggregate-cidr-addresses - combine a list of CIDR address blocks
# Copyright (C) 2001,2007 Mark Suter <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: st1
annotations:
storageclass.kubernetes.io/is-default-class: "false"
provisioner: kubernetes.io/aws-ebs
parameters:
type: st1
fsType: ext4
@kyxap1
kyxap1 / net.pro-manage.hatch.ssh-tunnel.plist
Created June 12, 2018 05:56
autossh autostart in OSX: launchctl load ~/Library/LaunchAgents/net.pro-manage.hatch.ssh-tunnel.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<true/>
</dict>
@kyxap1
kyxap1 / skills.resume.json
Last active May 29, 2018 14:24
My skills set, built with json-resume.
{
skills: [
{
name: "DevOps Patterns",
level: "Master",
keywords: [
"Immutable Infrastructure",
"Infrastructure as a Code",
"Infrastructure as a Service",
"Continuous Integration",
@kyxap1
kyxap1 / filter.txt
Created April 4, 2018 12:49
uBlock Origin filters
youtube.com##.ytp–ce–element
youtube.com##.ytp–ce–covering–overlay
youtube.com##.ytp–ce–element–shadow
youtube.com##.ytp–ce–covering–image
youtube.com##.ytp–ce–expanding–image
youtube.com##.ytp–ce–element.ytp–ce–channel.ytp–ce–channel–this.ytp–ce–element–show.ytp–ce–bottom–right–quad.ytp–ce–size–640
youtube.com##.ytp–ce–element.ytp–ce–video.ytp–ce–element–show
youtube.com##.ytp–expand
youtube.com##.ytp–pause–overlay
youtube.com###watch7-sidebar-contents
@kyxap1
kyxap1 / disable.sh
Created January 24, 2018 09:18
Disable bunch of #$!@ in Sierra (Version 2.1)
#!/bin/bash
# IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after.
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
# Agents to disable
TODISABLE=('com.apple.security.keychainsyncingoveridsproxy' 'com.apple.personad' 'com.apple.passd' 'com.apple.screensharing.MessagesAgent' 'com.apple.CommCenter-osx' 'com.apple.Maps.mapspushd' 'com.apple.Maps.pushdaemon' 'com.apple.photoanalysisd' 'com.apple.telephonyutilities.callservicesd' 'com.apple.AirPlayUIAgent' 'com.apple.AirPortBaseStationAgent' 'com.apple.CalendarAgent' 'com.apple.DictationIM' 'com.apple.iCloudUserNotifications' 'com.apple.familycircled' 'com.apple.familycontrols.useragent' 'com.apple.familynotificationd' 'com.apple.gamed' 'com.apple.icloud.findmydeviced.findmydevi
@kyxap1
kyxap1 / vpnc_server_script.sh
Created December 3, 2017 07:02
VPN routing script for Asus RT-N56U
#!/bin/sh
### Custom user script
### Called after internal VPN client connected/disconnected to remote VPN server
### $1 - action (up/down)
### $IFNAME - tunnel interface name (e.g. ppp5 or tun0)
### $IPLOCAL - tunnel local IP address
### $IPREMOTE - tunnel remote IP address
### $DNS1 - peer DNS1
### $DNS2 - peer DNS2
@kyxap1
kyxap1 / test-cloud-init-run.sh
Created November 1, 2017 00:47 — forked from maoueh/test-cloud-init-run.sh
Small script to test changes made to cloud init config without rebooting
rm -rf /var/lib/cloud/instance && rm -rf /var/lib/cloud/instances/* && rm -rf /var/lib/cloud/sem/*
cloud-init init && cloud-init modules --mode config && cloud-init modules --mode final
#!/usr/bin/env bash
# terraform pretty printer via alias
# usage: source $0
alias pp="ftf terraform.tfvars"
alias ppa="ftfa qwe"
alias ppl="ftfl qwe"
alias ppll="ftfll qwe"
@kyxap1
kyxap1 / terraform.sh
Created March 9, 2017 14:53 — forked from cornfeedhobo/terraform.sh
terraform bash completion
#!/usr/bin/env bash
_terraform() {
local cur prev words cword opts
_get_comp_words_by_ref -n : cur prev words cword
COMPREPLY=()
opts=""
if [[ ${cur} == -* ]] ; then
compopt -o nospace