Skip to content

Instantly share code, notes, and snippets.

@Raffo
Raffo / docker.md
Created December 7, 2018 13:43
docker

Install ASWSCLI on ubuntu

apt update && apt install -y vim curl python-pip && pip install awscli
@Raffo
Raffo / aws.md
Last active December 7, 2018 13:42
AWS gist

Get all the certificate names and date starting with 20XX

aws iam list-server-certificates --query 'ServerCertificateMetadataList[?starts_with(Expiration, `20XX-`)]' | jq .[].ServerCertificateName,.[].Expiration

Check when a CloudFront distribution finished updating:

while true; do a=`aws cloudfront get-distribution --id $DISTRIBUTION_ID | jq .Distribution.Status`; if [ "$a" != \"InProgress\" ]; then echo $a; say "agg fatt"; fi; done;
@Raffo
Raffo / macOS.md
Created January 5, 2018 08:41
macOS

Check which software updates are installed on macos:

sudo cat /Library/Receipts/InstallHistory.plist
@Raffo
Raffo / go-tips.md
Last active January 17, 2019 14:35
Go tips

When your autocompletion is broken, it's probably because of gocode. Try:

gocode set autobuild true
(Close Atom and Sublime)
gocode drop-cache
gocode close
atom .
@Raffo
Raffo / openssl.md
Created September 7, 2016 10:41
ssl - openssl

openssl s_client -connect google.com:443

@Raffo
Raffo / vs-code.md
Last active August 17, 2016 07:45
visual studio code key bindings

// Place your key bindings in this file to overwrite the defaults [ { "key": "cmd+1", "command": "workbench.action.openEditorAtIndex1" }, { "key": "cmd+2", "command": "workbench.action.openEditorAtIndex2" }, { "key": "cmd+3", "command": "workbench.action.openEditorAtIndex3" }, { "key": "cmd+4", "command": "workbench.action.openEditorAtIndex4" }, { "key": "cmd+5", "command": "workbench.action.openEditorAtIndex5" }, { "key": "cmd+6", "command": "workbench.action.openEditorAtIndex6" }, { "key": "cmd+7", "command": "workbench.action.openEditorAtIndex7" }, { "key": "cmd+8", "command": "workbench.action.openEditorAtIndex8" },

@Raffo
Raffo / resources.go
Created July 31, 2016 10:58
go-swagger gist
func (p *ProjectResponse) projectsOKResponse(projects []*models.Project, ginCtx *gin.Context) {
ginCtx.JSON(http.StatusOK, projects)
}
func (p *ProjectResponse) projectOKResponse(project *models.Project, ginCtx *gin.Context) {
ginCtx.JSON(http.StatusOK, project)
}
func (p *ProjectResponse) projectCreateOKResponse(ginCtx *gin.Context) {
@Raffo
Raffo / aws_tips.md
Created February 16, 2016 20:57
Aws tips and tricls

For AWS generated keys

C:\> openssl pkcs8 -in path_to_private_key -inform PEM -outform DER -topk8 -nocrypt | openssl sha1 -c

For manually generated and imported keys

C:\> openssl rsa -in path_to_private_key -pubout -outform DER | openssl md5 -c
@Raffo
Raffo / tcpdump.md
Last active February 12, 2019 17:57
tcpdump
sudo tcpdump -i any -X -s 0 dst HOST_IP
sudo tcpdump -i any -X -s 0 src host localhost -w /tmp/outfile1
@Raffo
Raffo / clam.md
Last active October 5, 2015 18:55
Clamav