Skip to content

Instantly share code, notes, and snippets.

View kyxap1's full-sized avatar

Oleksandr Kukhar kyxap1

View GitHub Profile
@kyxap1
kyxap1 / putty-monokai.reg
Created August 11, 2016 00:05 — forked from gdvalle/putty-monokai.reg
Monokai style theme for PuTTY; colors copied from ST2's theme
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\monokai]
"Colour21"="255,255,255"
"Colour20"="245,222,179"
"Colour19"="200,240,240"
"Colour18"="0,217,217"
"Colour17"="179,146,239"
"Colour16"="174,129,255"
"Colour15"="122,204,218"
@kyxap1
kyxap1 / s3-curl-backups.md
Created August 11, 2016 13:18 — forked from jareware/s3-curl-backups.md
Simple, semi-anonymous backups with S3 and curl

⇐ back to the gist-blog at jrw.fi

Simple, semi-anonymous backups with S3 and curl

Backing stuff up is a bit of a hassle, to set up and to maintain. While full-blown backup suites such as duplicity or CrashPlan will do all kinds of clever things for you (and I'd recommend either for more complex setups), sometimes you just want to put that daily database dump somewhere off-site and be done with it. This is what I've done, with an Amazon S3 bucket and curl. Hold onto your hats, there's some Bucket Policy acrobatics ahead.

There's also a tl;dr at the very end if you just want the delicious copy-pasta.

Bucket setup

@kyxap1
kyxap1 / cassandra.sh
Created August 11, 2016 21:25 — forked from ixaxaar/cassandra.sh
Simple bash script to install cassandra cluster
#!/usr/bin/env bash
# A script to install cassandra
# Add the seed nodes here
SEEDS[0]='10.1.1.1'
SEEDS[1]='10.1.1.2'
SEEDS[2]='10.1.1.3'
@kyxap1
kyxap1 / README.md
Created November 27, 2016 12:32 — forked from lusis/README.md
terraform template to generate serverspec properties

This uses terraform's template_file resource to generate a yaml properties file for serverspec to use.

  • create the Rakefile in your terraform project root
  • create a spec directory and put spec_helper.rb in it
  • create the templates/properties.tmpl.yml file
  • create the serverspec.tf
  • terraform apply

tests

Tests will be matched based on roles defined for a given node.

@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
@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
@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 / 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 <suter@zwitterion.org>
#
# 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.
#