Skip to content

Instantly share code, notes, and snippets.

View styk-tv's full-sized avatar

Peter Styk styk-tv

View GitHub Profile
#!/usr/bin/env/ruby
require 'socket'
# AWS API Credentials
AWS_ACCESS_KEY_ID = "your-aws-access-key-id"
AWS_SECRET_ACCESS_KEY = "your-aws-secret-access-key"
# Node details
NODE_NAME = "webserver-01.example.com"
@styk-tv
styk-tv / chef-workstation.sh
Last active August 29, 2015 14:01
chef-workstation
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev libxslt-dev libxml2-dev git
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p429.tar.gz
tar -xvzf ruby-1.9.3-p429.tar.gz
cd ruby-1.9.3-p429/
./configure --prefix=/usr/local
make
make install
gem install bundler berkshelf
@styk-tv
styk-tv / gist:693d13e2e3c293b31628
Last active August 29, 2015 14:03
couchbase debian wheezy python client
# to Couchbase: please release Debian binaries
# to end users: save yourself an afternoon. below works on fresh Debian Wheezy 7.0.0-2 amd64
# author https://www.linkedin.com/in/peterstyk
# license bsd
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y build-essential python-dev python-pip libevent-dev openjdk-7-jre curl unzip
wget http://packages.couchbase.com/clients/c/libcouchbase-2.3.2.tar.gz
tar -xzf libcouchbase-2.3.2.tar.gz
@styk-tv
styk-tv / habitat-jenkins.sh
Last active July 9, 2016 01:10
On Ubuntu Xenial - Habitat, Docker, Docker-Compose, OpenJdk8, Rust, Jenkins, DSL
#!/bin/bash -v
# Ubuntu Xenial Initialization from Cloud-Init or Vagrant
# From Ubuntu user
# Maintained by Peter Styk (devopsfactory@styk.tv)
# PREREQUESITES
pushd /tmp
sudo wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
@styk-tv
styk-tv / htaccess
Created June 13, 2017 22:38
htaccess directory index
Options +Indexes
<Files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
</Files>
<IfModule mod_autoindex.c>
IndexOptions IgnoreCase FancyIndexing FoldersFirst NameWidth=* DescriptionWidth=* SuppressHTMLPreamble
IndexIgnore cgi-bin header.html footer.html .ftpquota
@styk-tv
styk-tv / git-repo-demo.yaml
Created September 3, 2018 14:27 — forked from tallclair/git-repo-demo.yaml
More secure GitRepo volumes
# Example of using an InitContainer in place of a GitRepo volume.
# Unilke GitRepo volumes, this approach runs the git command in a container,
# with the associated hardening.
apiVersion: v1
kind: Pod
metadata:
name: git-repo-demo
annotations:
seccomp.security.alpha.kubernetes.io/pod: 'docker/default'
spec:
@styk-tv
styk-tv / git-status-recursive
Created September 7, 2018 19:41 — forked from dbu/git-status-recursive
recursive git status
#!/usr/bin/php
<?php
$repos = array();
exec('find -type d -name .git | sed -e "s/\.git//"', $repos);
foreach ($repos as $repo) {
$status = shell_exec("cd $repo && git status");
if (false == strpos($status, 'nothing to commit (working directory clean)')) {
echo "$repo\n" . str_repeat('-', strlen($repo)) . "\n$status\n\n";
}
}
@styk-tv
styk-tv / ADExport.ps1
Created June 28, 2019 11:05
Export AD Groups with Members as CSV
#// Start of script
#// Get year and month for csv export file
$DateTime = Get-Date -f "yyyy-MM"
#// Set CSV file name
$CSVFile = "C:\AD_Groups"+$DateTime+".csv"
#// Create emy array for CSV data
$CSVOutput = @()
@styk-tv
styk-tv / tf_os_allowed-address_pairs.txt
Created September 1, 2019 19:13
Terraform Openstack Allowed Address Pairs
locals {
some_list_of_ips = [
"127.0.0.1",
"127.0.0.2",
"127.0.0.3"
]
}
resource "openstack_networking_port_v2" "test-adp" {
@styk-tv
styk-tv / openstack-instance-port.tf
Created September 7, 2019 00:45
openstack create port for instance
resource "openstack_networking_network_v2" "network_1" {
name = "network_1"
}
resource "openstack_networking_subnet_v2" "subnet_1" {
name = "subnet_1"
network_id = "${openstack_networking_network_v2.network_1.id}"
cidr = "192.168.1.0/24"
ip_version = 4
enable_dhcp = true