- regex: Regular expressions are text patterns that define the form a text string should have.
- useful for email checking patern
- matching word "color" and "colour"
- extra specific info like postal code LOL: "Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems."
#!/bin/bash | |
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it! | |
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS. | |
# This script needs to be run from the volume you wish to use. | |
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh | |
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars. | |
# Get active services: launchctl list | grep -v "\-\t0" | |
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents |
Get users with uid > 1000
awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534) print $1}' /etc/passwd
Links:
find . -printf '%s %p\n'| sort -nr | head -10
policies=$(oci --profile BOAT-OC1 iam policy list --all -c $C --query 'data[?length("freeform-tags")==`0`].name'| jq -r "@sh" )
oci --profile BOAT-OC1 iam policy list --all -c $C --query 'data.length(@)'
################################# | |
# Running Jenkins In Kubernetes # | |
# Tutorial And Review # | |
# https://youtu.be/2Kc3fUJANAc # | |
################################# | |
# Referenced videos: | |
# - GitHub CLI - How to manage repositories more efficiently: https://youtu.be/BII6ZY2Rnlc | |
# - Kaniko - Building Container Images In Kubernetes Without Docker: https://youtu.be/EgwVQN6GNJg | |
# - Kustomize - How to Simplify Kubernetes Configuration Management: https://youtu.be/Twtbg6LFnAg |
• 45-minute systems interview, focus on responding to real world problems with an unhealthy service, such as a web server or database. The interview will start off at a high level troubleshooting a likely scenario, dig deeper to find the cause and some possible solutions for it. The goal is to probe your knowledge of systems at scale and under load, so keep in mind the challenges of the Facebook environment.
• Focus on things such as tooling, memory management and unix process lifecycle.
More specifically, linux troubleshooting and debugging. Understanding things like memory, io, cpu, shell, memory etc. would be pretty helpful. Knowing how to actually write a unix shell would also be a good idea. What tools might you use to debug something? On another note, this interview will likely push your boundaries of what you know (and how to implement it).
Interview is all about taking an ambiguous question of how you might build a system and letting
#!/bin/bash -xe | |
## SET BASIC VARIABLES | |
EKS_CLUSTER="dev-cluster" | |
IAM_ROLE_NAME=eksctl-$EKS_CLUSTER-iamserviceaccount-role | |
EXTERNAL_SECRETS_POLICY="kube-external-secrets" | |
#### CREATE POLICY TO ACCESS SSM/Secrets Manager | |
cat << EOF > policy.json | |
{ |
To use aws cli, its common to invoke built-in features like --filters
and --query
however they aren't avaiable for all the commands.
for my use case i wanted to get a role matching a name, i.e. regex pattern . that was very easy using jq
if i want to get a role matching name eksctl-dev-cluster-addon-iamserviceaccount
then to get ARN
of that role is simply doing