Skip to content

Instantly share code, notes, and snippets.

View overdrive3000's full-sized avatar
🇻🇪
de venezuela pa' españa

Juan Manuel Mesa overdrive3000

🇻🇪
de venezuela pa' españa
View GitHub Profile
@overdrive3000
overdrive3000 / awscli.md
Last active June 10, 2022 15:50
AWS CLI tips and tricks

Get the default VPC Id

aws ec2 describe-vpcs --filters "Name=isDefault,Values=true" --output text --query 'Vpcs[*].{Vpc:VpcId}'

Get all the cloudformation stack names

aws cloudformation describe-stacks --region us-east-1 --output text --query 'Stacks[*].{Stack:StackName}'
write-output "Running User Data Script"
write-host "(host) Running User Data Script"
Set-ExecutionPolicy Unrestricted -Scope LocalMachine -Force -ErrorAction Ignore
# Don't set this before Set-ExecutionPolicy as it throws an error
$ErrorActionPreference = "stop"
# Remove HTTP listener
Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse
@overdrive3000
overdrive3000 / git-tips.md
Last active May 27, 2021 20:24
Useful git commands

Search a string across commits

git log -S <string to find> --source --all

To find all commits that added or removed the fixed string string to find. The --all parameter means to start from every branch and --source means to show which of those branches led to finding that commit.

Find branches the commit is on

git branch --contains <commit>
security_groups.push(element.UserIdGroupPairs.map(function(element){
if (element.GroupId !== sg_id) {
return element.GroupId;
}
}));
@overdrive3000
overdrive3000 / ws.js
Last active June 13, 2016 19:04
websocket-test
let msg = {
name: 'channel add',
data: {
name: 'Hardware Support'
}
};
let ws = new WebSocket('ws://localhost:4000');
ws.onopen = () => {
@overdrive3000
overdrive3000 / concourse-startup.log
Created June 3, 2016 16:33
concourse v1.3.0-rc.83 running in Docker and CoreOS stable (1010.5.0) startup logs
{"timestamp":"1464971434.260286093","source":"worker","message":"worker.garden.unpack-assets.unpacking","log_level":1,"data":{"session":"1.1"}}
{"timestamp":"1464971448.578568697","source":"worker","message":"worker.garden.unpack-assets.done","log_level":1,"data":{"session":"1.1"}}
{"timestamp":"1464971448.579437971","source":"worker","message":"worker.garden.extract-resources.extract.extracting","log_level":1,"data":{"resource-type":"archive","session":"1.2.1"}}
{"timestamp":"1464971449.821817398","source":"worker","message":"worker.garden.extract-resources.extract.extracting","log_level":1,"data":{"resource-type":"bosh-deployment","session":"1.2.2"}}
{"timestamp":"1464971452.130784750","source":"worker","message":"worker.garden.extract-resources.extract.extracting","log_level":1,"data":{"resource-type":"bosh-io-release","session":"1.2.3"}}
{"timestamp":"1464971453.105770588","source":"worker","message":"worker.garden.extract-resources.extract.extracting","log_level":1,"data":{"resource-type":"bosh-io-stemce
@overdrive3000
overdrive3000 / gist:c55086cd735e5ffb2e592bdcc54c48de
Created May 31, 2016 16:08
Steps to add missing file to a past commit
Stash current changes: git stash
Go back to the latest commit for edition: git rebase -i HEAD~1
Set the edit option
Apply the stashed changes to be added in the commit: git stash apply
Add the files: git add missing_files
Change the latest commit: git commit —amend
Finish the rebase: git rebase —continue
---
applications:
- name: simple-gochos-web-app
disk: 256M
memory: 128M
Sun Jun 19 04:04:47 UTC 2016
from __future__ import print_function
import json
import urllib
import boto3
print('Loading function')
s3 = boto3.client('s3')