Skip to content

Instantly share code, notes, and snippets.

@bdargan
bdargan / dotfile-init.zsh
Created December 8, 2021 10:15
dot file init
#setup dotfiles using a git bare repo, as per https://news.ycombinator.com/item?id=11071754
git init --bare $HOME/.dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no
echo "alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'" >> $HOME/.aliases
@bdargan
bdargan / Brewfile
Last active December 5, 2021 11:46
# Brewfile
## Core
tap "homebrew/core"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-fonts"
tap "buo/cask-upgrade" # brew cu to update all mac apps
## Shell / cli
@bdargan
bdargan / aws-assumerole
Last active September 6, 2019 05:08
aws cli - assume role with MFA with cross-account support
#!/usr/bin/env zsh
#echo "This script depends on correctly configured aws credentials file. \n1. profile, \n2. dest_profile, contains role_arn in dest_account and refers creds to the source_profile, \n3. source_profile contains sts temporary credentials"
echo "1. Authenticate with current AWS_PROFILE (${AWS_PROFILE}) - please provide your account Id and iam username and your MFA token"
echo "2. Assume role as configured in ~/aws/.credentials#${DEST_PROFILE=DEST_PFOFILE}"
if [ -z `which jq` ]; then
echo "ERROR: required command:'jq' command line JSON processor - https://github.com/stedolan/jq"
exit 1
fi
@bdargan
bdargan / aws-policy-user-self-manage-mfa.json
Last active November 1, 2018 04:33
AWS policy for user to self manage credentials and mfa
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowIndividualUserToSeeAndManageTheirOwnAccountInformation",
"Effect": "Allow",
"Action": [
"iam:ChangePassword",
"iam:CreateAccessKey",
"iam:CreateLoginProfile",
@bdargan
bdargan / frequently missed considerations in d2d ops or design.md
Last active October 4, 2016 22:08
Start gathering a list of things I know and experience that could be considered frequently missed considerations in design or day to day ops

draft Checklist of frequently missed considerations in design/d2d ops

starting another checklist of this stuff.

uncommon occurrences

  • daylight savings time switch
@bdargan
bdargan / ssh_tips.md
Created November 27, 2015 00:37
ssh reminders

working with intermediate servers

scp

ssh user1@host1 -t 'ssh user2@host2 "cat /var/log/nginx/access.log"' > access.log

@bdargan
bdargan / coding-for-kids.md
Last active November 22, 2015 22:38
List of sites/resources

Keybase proof

I hereby claim:

  • I am bdargan on github.
  • I am bdargan (https://keybase.io/bdargan) on keybase.
  • I have a public key whose fingerprint is 6715 72A9 CF84 77EA 2B08 5CBB 4DBC 6409 D446 1365

To claim this, I am signing this object:

@bdargan
bdargan / rx_references
Last active August 29, 2015 14:07
Rx ReactiveX References
The usual brief intro:
- https://gist.github.com/staltz/868e7e9bc2a7b8c1f754
-
- https://github.com/ReactiveX/RxJava/wiki/Scheduler
slides
- http://www.slideshare.net/tkowalcz/33rd-degree-reactive-java
- http://abdullin.com/post/domain-driven-design-event-sourcing-rx-and-marble-diagrams/

pushline ESC-q: put the current line in a buffer and clear input. after the next command is executed, display the prior input