Skip to content

Instantly share code, notes, and snippets.

View paugustyn-cbsi's full-sized avatar

Przemek Augustyn paugustyn-cbsi

View GitHub Profile
# configuration for option-stacking
zstyle ':completion:*:*:docker:*' option-stacking yes
zstyle ':completion:*:*:docker-*:*' option-stacking yes
@paugustyn-cbsi
paugustyn-cbsi / env
Created July 10, 2021 06:00
Configure iterm2 to switch profiles for ssh connections (badge and profile)
aws-dev=ssh -i ~/.ssh/aws-dev [email protected]
aws-ent=ssh -i ~/.ssh/aws-ent [email protected]
aws-prod=ssh -i ~/.ssh/aws-prod [email protected]
@paugustyn-cbsi
paugustyn-cbsi / php-syntax-suger.md
Last active July 19, 2021 20:01
php syntax suger

Assigning with list

 list('field' => $field_name,
                'value' => $field_value,
                'reject' => $reject) = $r;

Iterating through array with index

foreach ($audio_list as $key => $audio_item) {

Run instance with non-default EBS size

instance_id=$(aws ec2 run-instances \
  --image-id YOUR_AMI \
  --count 1 \
  --instance-type t2.medium \  
  --block-device-mappings 'DeviceName=/dev/sda1,Ebs={VolumeSize=32}' \
  --iam-instance-profile Arn=$iam_profile \
 --key-name $key_name \
@paugustyn-cbsi
paugustyn-cbsi / bash-tricks.md
Last active June 14, 2021 23:51
bash tricks

Dates

# get UTC date (rfc-2822) for Unix epoch
date -Ru -r 0
# get Local time date for Unix epoch
date -R -r 0
# as above but for gdate and rfc-3339
gdate --rfc-3339=seconds -ud @0

## current UTC in epoch milliseconds