Skip to content

Instantly share code, notes, and snippets.

View sondnm's full-sized avatar
🎯
Focusing

Son Dang sondnm

🎯
Focusing
View GitHub Profile
@ProGM
ProGM / arel_cheatsheet_on_steroids.md
Last active March 21, 2024 17:02
Arel cheatsheet on Steroids

Arel Cheatsheet on Steroids

A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.

Tables

posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord

Table alias

@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@gene1wood
gene1wood / bitwarden-amazon-aws-credential-setup.md
Last active March 22, 2024 22:53
How to get BitWarden to differentiate between amazon.com consumer retail logins, AWS root logins and AWS IAM user logins

Here's how to get BitWarden to treat these three different types of Amazon logins as separate

  • amazon.com consumer retail business login
  • AWS root user login (AWS logins that use an email address)
  • AWS IAM user login (AWS logins that use a username)

amazon.com consumer retail

  • Set URI 1 to Exact with a value of

    https://www.amazon.com/ap/signin?_encoding=UTF8&ignoreAuthState=1&openid.assoc_handle=usflex&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.mode=checkid_setup&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.ns.pape=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Fpape%2F1.0&openid.pape.max_auth_age=0&openid.return_to=https%3A%2F%2Fwww.amazon.com%2F%3Fref_%3Dnav_custrec_signin&switch_account=

@shortjared
shortjared / list.txt
Last active March 27, 2024 11:19
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active March 1, 2024 14:39
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@bradwestfall
bradwestfall / S3-Static-Sites.md
Last active March 13, 2024 15:02
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation
@MWins
MWins / project-ideas01.md
Last active March 28, 2024 04:25
Back end Projects - list

Project Ideas

Ok. I'm going to list off some ideas for projects. You will have to determine if any particular idea is good enough to include in a portfolio. These aren't creative ideas. They likely already exist. Some are way too advanced while others are simplistic.

I will recommend to post any project you make to github and make a github project page for it. Explain in as much detail as possible how you made it, how it can be improved etc. Document it.

If you pick an advanced idea, setup a development roadmap and follow it. This will show some project management skills.

Another piece of advice for those who are design challenged. Use different front end frameworks and use different themes for those frameworks to provide appealing designs without looking like yet another bootstrap site.

@datchley
datchley / react-redux-style-guide.md
Last active February 13, 2024 14:30
React + Redux Style Guide
@itod
itod / split_keyboards.md
Last active March 23, 2024 21:00
Every "split" mechanical keyboard currently being sold that I know of
@CMCDragonkai
CMCDragonkai / memory_layout.md
Last active March 20, 2024 18:12
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore