Skip to content

Instantly share code, notes, and snippets.

View dalssaso's full-sized avatar

Henrique Dalssaso dalssaso

View GitHub Profile
@dalssaso
dalssaso / framework_arch.markdown
Created April 18, 2023 01:44 — forked from RobFisher/framework_arch.markdown
Install Arch on Framework laptop with BTRFS, encrypted swap and hibernate

See video: https://www.youtube.com/watch?v=BAQ78pBPjjc

Set up laptop

In BIOS, under security, set "Enforce secure boot" to "disabled".

Get install environment working

Keyboard layout for boot env:

localectl list-keymaps | grep uk

loadkeys uk

@dalssaso
dalssaso / jq-cheetsheet.md
Created March 22, 2022 22:49 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@dalssaso
dalssaso / gist:79e2d97459e3777d4b5edede1a01097d
Created March 22, 2022 22:49 — forked from hummus/gist:8592113
aws cli + jq example
wget http://stedolan.github.io/jq/download/linux64/jq
aws ec2 describe-instances --filters "Name=tag:Name,Values=$NAME" \
"Name=instance-state-name,Values=running" \
| jq -r \
".Reservations[] | .Instances[] | .InstanceId" \
aws ec2 describe-volumes --filters \
"Name=status,Values=available" \
| jq -r ".Volumes[] | .VolumeId" \
@dalssaso
dalssaso / bash_aws_jq_cheatsheet.sh
Created March 22, 2022 02:27 — forked from lukeplausin/bash_aws_jq_cheatsheet.sh
AWS, JQ and bash command cheat sheet. How to query, cut and munge things in JSON generally.
# Count total EBS based storage in AWS
aws ec2 describe-volumes | jq "[.Volumes[].Size] | add"
# Count total EBS storage with a tag filter
aws ec2 describe-volumes --filters "Name=tag:Name,Values=CloudEndure Volume qjenc" | jq "[.Volumes[].Size] | add"
# Describe instances concisely
aws ec2 describe-instances | jq '[.Reservations | .[] | .Instances | .[] | {InstanceId: .InstanceId, State: .State, SubnetId: .SubnetId, VpcId: .VpcId, Name: (.Tags[]|select(.Key=="Name")|.Value)}]'
# Wait until $instance_id is running and then immediately stop it again
aws ec2 wait instance-running --instance-id $instance_id && aws ec2 stop-instances --instance-id $instance_id
# Get 10th instance in the account
@dalssaso
dalssaso / keybase.md
Created April 19, 2018 15:06
keybase.md

Keybase proof

I hereby claim:

  • I am dalssaso on github.
  • I am hdalssaso (https://keybase.io/hdalssaso) on keybase.
  • I have a public key ASAPIgXO2211M8O6r4qLt_M_Y5GUa8OburcpqGozVXiYdgo

To claim this, I am signing this object:

@dalssaso
dalssaso / keybase.md
Last active December 27, 2017 16:03
keybase.md

Keybase proof

I hereby claim:

  • I am dalssaso on github.
  • I am hdalssaso (https://keybase.io/hdalssaso) on keybase.
  • I have a public key ASDKxlDNp6FmI8-nxnivSosZhEaf6GXMD7mHzX-wjzr1Zgo

To claim this, I am signing this object:

@dalssaso
dalssaso / tmux-cheatsheet.markdown
Created June 4, 2016 00:19 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@dalssaso
dalssaso / tmux.md
Created June 4, 2016 00:19 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@dalssaso
dalssaso / zshrc
Created May 17, 2016 21:08
zshrc
source ~/.zplug/init.zsh
autoload colors && colors
setopt prompt_subst
zplug "zsh-users/zsh-history-substring-search"
zplug "junegunn/fzf-bin", \
from:gh-r, \
as:command, \