Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View rbramwell's full-sized avatar
🚀
Blazing a trail the likes of which has never been seen.

Rory Bramwell rbramwell

🚀
Blazing a trail the likes of which has never been seen.
View GitHub Profile
#!/bin/bash -e
# Argument = -h -v -i groupId:artifactId:version -c classifier -p packaging
#shopt -o -s xtrace
# Define Nexus Configuration
NEXUS_BASE=http://repository.example.com:8081/nexus #this URL shouldn't end in a /
REST_PATH=/service/local
ART_REDIR=/artifact/maven/redirect
@drhuffman12
drhuffman12 / gem-fetch-dependencies.rb
Last active April 12, 2018 12:40 — forked from Milly/gem-fetch-dependencies
Extend 'gem fetch' command. Fetch all dependencies. Handles OS (Windows vs non-Windows) and Ruby Platform (JRuby vs Ruby).
#!/usr/bin/ruby
=begin
## USAGE:
# Ruby:
ruby gem-fetch-dependencies.rb fetch <gem_name> --dependencies
# JRuby:
jruby gem-fetch-dependencies.rb fetch <gem_name> --dependencies
@kesor
kesor / docker_workshop_microservices_cheat_sheet.md
Last active September 27, 2020 17:54
docker workshop cheat sheet #2 - microservices
@beccam
beccam / GettingStarted.js
Last active April 22, 2020 06:06
Getting Started with Apace Cassandra and the Datastax Node.js Driver
var cassandra = require('cassandra-driver');
var async = require('async');
var client = new cassandra.Client({contactPoints: ['127.0.0.1'], keyspace: 'demo'});
// Use async series to run functions in serial (one after another)
async.series([
// Insert Bob
function (callback) {
client.execute("INSERT INTO users (lastname, age, city, email, firstname) VALUES ('Jones', 35, 'Austin', 'bob@example.com', 'Bob')", function (err, result) {
@mblarsen
mblarsen / deploy.yaml
Last active July 24, 2022 13:27
Solution for `git clone` using Ansible for repos with private submodules with github deploy keys
# Problem:
#
# If you use git submodules linking two private github repos, you'll need to create a separate deploy key for each.
# Multiple keys are not supported by Ansible, nor does ansible (when running git module) resort to your `.ssh/config` file.
# This means your ansible playbook will hang in this case.
#
# You can however use the ansible git module to checkout your repo in multiple steps, like this:
#
- hosts: webserver
vars:
@beccam
beccam / GettingStartedTwo.java
Last active July 21, 2017 21:02
Getting Started with Apache Cassandra and Java Part II
import com.datastax.driver.core.*;
public class GettingStartedTwo {
public static void main(String[] args) {
Cluster cluster;
Session session;
ResultSet results;
Row rows;
@learncodeacademy
learncodeacademy / gist:ebba574fc3f438c851ae
Created July 24, 2014 14:47
Nginx Node Frontend / Load Balancer / Static Assets Caching
upstream project {
server 22.22.22.2:3000;
server 22.22.22.3:3000;
server 22.22.22.5:3000;
}
server {
listen 80;
location / {
@beccam
beccam / GettingStarted.java
Created June 27, 2014 19:54
Getting Started with Apache Cassandra and Java
import com.datastax.driver.core.*;
public class GettingStarted {
public static void main(String[] args) {
Cluster cluster;
Session session;
@HarmJ0y
HarmJ0y / gist:fd98c4f16575ba28c091
Last active April 27, 2023 13:56
Powershell ADSI tricks
# Add a domain user to a remote server local group, if your current user has admin over the remote machine
powershell -c ([ADSI]'WinNT://SERVER/Administrators,group').add('WinNT://DOMAIN/USER,user')
# Get all local groups on a remote server
powershell -c "([ADSI]'WinNT://SERVER,computer').psbase.children | where { $_.psbase.schemaClassName -eq 'group' } | foreach { ($_.name)[0]}"
# Find members of the local Administrators group on a remote server
powershell -c "$([ADSI]'WinNT://SERVER/Administrators,group').psbase.Invoke('Members') | foreach { $_.GetType().InvokeMember('ADspath', 'GetProperty', $null, $_, $null).Replace('WinNT://', '') }"
# Enable the local Administrator account on a remote server
@tristanfisher
tristanfisher / Ansible-Vault how-to.md
Last active April 3, 2024 13:55
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.