Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Darko Mesaros darko-mesaros

🎯
Focusing
View GitHub Profile
@darko-mesaros
darko-mesaros / tmux.conf
Created Apr 4, 2021
My tmux configuration file
View tmux.conf
# B A S I C S
## Replace c-B with c-A
unbind C-b
set -g prefix C-a
bind-key -r C-a send-prefix
# O P T I O N S
## Set 256 color mode
@darko-mesaros
darko-mesaros / tmux.conf
Created Sep 3, 2020
My tmux configuration
View tmux.conf
# B A S I C S
## Replace c-B with c-A
unbind C-b
set -g prefix C-a
bind-key -r C-a send-prefix
# O P T I O N S
## Set 256 color mode
@darko-mesaros
darko-mesaros / secrets_manager_commands.sh
Created Sep 3, 2020
Commands used on the AWS Secrets Manager Stream
View secrets_manager_commands.sh
# Get all Latest Windows AMIs
aws ssm get-parameters-by-path \
--path /aws/service/ami-windows-latest
# Get all regions where Cloud9 is available inj
aws ssm get-parameters-by-path \
--path /aws/service/global-infrastructure/services/cloud9/regions --output json \
| jq .Parameters[].Value | sort
# Get all services available in the af-south-1 region
@darko-mesaros
darko-mesaros / codeshots-cdk-testpipeline.ts
Last active Jul 28, 2020
CDK - Testing bit of CodePipeline where we setup a testing stage to test CloudFormation templates with Lambda
View codeshots-cdk-testpipeline.ts
// --- test stage and actions ---
const prepTestChanges = new codepipeline_actions.CloudFormationCreateReplaceChangeSetAction({
actionName: 'PrepTestChanges',
stackName: stageStackName,
changeSetName: stageChangeSetName,
adminPermissions: true,
parameterOverrides: {
"Environment":
@darko-mesaros
darko-mesaros / cfn-single-ec2-instance.yml
Created Jul 28, 2020
A CloudFormation template that creates a simple EC2 instance
View cfn-single-ec2-instance.yml
AWSTemplateFormatVersion: "2010-09-09"
Description: >
This is my template that creates a simple EC2 instance
# Parameters
Parameters:
InstanceName:
Type: String
Description: Name your EC2 instance - dont
KeyPair:
View lolbanner.sh
figlet -c -f ~/.local/share/fonts/figlet-fonts/3d.flf $argv | lolcat
@darko-mesaros
darko-mesaros / appconfig.yml
Created Jun 15, 2020
Create AppConfig configuration in Parameter Store
View appconfig.yml
AWSTemplateFormatVersion: "2010-09-09"
Description: >
https://twitch.tv/ruptwelve
Parameters:
NumOfRows:
Type: String
Description: Number of Rows for your config
Default: please-change-me
Resources:
### PARAMETER STORE ###
@darko-mesaros
darko-mesaros / cdk-asg-userdata.ts
Created Jun 8, 2020
AWS CDK - Launch an EC2 Autoscaling Group with userdata read of disk
View cdk-asg-userdata.ts
// VPC
const vpc = new ec2.Vpc(this, 'VPC');
// Security group
const webSg = new ec2.SecurityGroup(this, 'WebSG',{
vpc: vpc,
allowAllOutbound: true,
description: "Web Server Security Group"
});
webSg.addIngressRule(ec2.Peer.anyIpv4(), ec2.Port.tcp(8080), 'Web from anywhere')
View aws-cli-region-services.sh
aws ssm get-parameters-by-path \
--path /aws/service/global-infrastructure/regions/af-south-1/services --output json | \
jq .Parameters[].Name | sort | head -10
@darko-mesaros
darko-mesaros / lolbanner-function.fish
Created May 28, 2020
Lolbanner alias / function that shows some colorfull text
View lolbanner-function.fish
function lolbanner
echo
figlet -c -f ~/.local/share/fonts/figlet-fonts/3d.flf $argv | lolcat
echo
end