Skip to content

Instantly share code, notes, and snippets.

@justinsoliz
justinsoliz / ssms_install.ps1
Created February 17, 2018 19:45
Powershell - Install Sql Server Management Studio
# Set file and folder path for SSMS installer .exe
$folderpath="c:\windows\temp"
$filepath="$folderpath\SSMS-Setup-ENU.exe"
#If SSMS not present, download
if (!(Test-Path $filepath)){
write-host "Downloading SQL Server 2016 SSMS..."
$URL = "https://download.microsoft.com/download/3/1/D/31D734E0-BFE8-4C33-A9DE-2392808ADEE6/SSMS-Setup-ENU.exe"
$clnt = New-Object System.Net.WebClient
$clnt.DownloadFile($url,$filepath)
@justinsoliz
justinsoliz / readme.md
Last active September 20, 2022 12:56
Setting up new macbook
@justinsoliz
justinsoliz / resources.tf
Created August 30, 2016 15:26
Terraform S3 to Lambda notification
provider "aws" {
access_key = "${var.access_key}"
secret_key = "${var.secret_key}"
region = "${var.region}"
}
resource "aws_iam_role" "iam_for_terraform_lambda" {
name = "app_${var.app_env}_lambda"
assume_role_policy = <<EOF
{
@justinsoliz
justinsoliz / lambda_kinesis_handler.js
Last active December 3, 2021 10:19
Terraform with lambda and kinesis
// applications/kinesis_streamer/lib/handler.js
import AWS from 'aws-sdk';
const kinesis = new AWS.Kinesis();
export function receiveEvent(event, context, callback) {
console.log('demoHandler');
console.log(`Event: ${JSON.stringify(event, null, 2)}`);
console.log(`Context: ${JSON.stringify(context, null, 2)}`);
const base64Data = event.Records[0].kinesis.data;
@justinsoliz
justinsoliz / jenkins-ci-packer.json
Last active November 10, 2020 19:39
Packer definition for jenkins ci executor
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "us-west-2",
# install kde, restart
sudo apt install tasksel
sudo tasksel install kubuntu-desktop
# install chrome
cd ~/Downloads
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb
# base packages
#!/bin/bash
# https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash/29754866
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
# set default values
DEFAULT=NO
@justinsoliz
justinsoliz / cloud-config.yml
Last active January 19, 2020 15:18
Terraform definition for Jenkins with ECS, EFS, CoreOS
#cloud-config
write-files:
- path: /etc/conf.d/nfs
permissions: '0644'
content: |
OPTS_RPC_MOUNTD=""
coreos:
units:
- name: update-engine.service
@justinsoliz
justinsoliz / jwtRS256.sh
Created September 16, 2018 01:20 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@justinsoliz
justinsoliz / remove_git_submodule.sh
Created August 25, 2018 22:04
Remove a git submodule
# bash commands per https://gist.github.com/myusuf3/7f645819ded92bda6677#gistcomment-2650640
git submodule deinit <path_to_submodule>
git rm <path_to_submodule>
git commit-m "Removed submodule "
rm -rf .git/modules/<path_to_submodule>