Skip to content

Instantly share code, notes, and snippets.

View baurzhan-konurbayev's full-sized avatar

Baurzhan Konurbayev baurzhan-konurbayev

View GitHub Profile
I'll be omitting syscalls with ellipsis.
The first thing that happens after you press enter is that bash resolves
curl to /usr/bin/curl and then forks(). The strace output is from the
forked process.
Fist execve() the /usr/bin/curl binary and pass an array of arguments to it.
execve("/usr/bin/curl", ["curl", "http://github.com"], [/* 8 vars */]) = 0
...
# Configure Ruby and Gems paths on Mac
export RUBY_PATH=/usr/local/opt/ruby/bin
export PATH="$RUBY_PATH:$PATH"
export RUBY_VERSION=$($RUBY_PATH/ruby -e "puts RUBY_VERSION")
export PATH="/usr/local/lib/ruby/gems/$RUBY_VERSION/bin:$PATH"
export GEM_HOME="$HOME/.gem"
export GEM_PATH="$GEM_HOME/ruby/$RUBY_VERSION"
@baurzhan-konurbayev
baurzhan-konurbayev / merge_lists.py
Last active November 11, 2022 16:46
Merge lists with identical IDs
input = [[1,2,3],
[3],
[4],
[5,6],
[1,7],
[2,8],
[4,9]]
"""
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCz7oMPKkaM3s4Q1t1lZ9V4HPxeh9OtMIVEfzl7vmcEDRORAu7ne5NKww7KbFHPJdl1USF59ZY1W1ANu8hqRHIdKbUptASWBTGSkDWrDEF467YEwio/ONRHgStjvy6Z1xI2yltaouyz6+p21GfPY7/miXOSBmPy5ObuUcBgz+hLullq50hi0uLCkoYPH4p9uTtW0gMR9h7N06AZPb8sh1+vQOAA9QMc00XaahVlwwdZDKvYL4mOh7yCIHUSJojaTugwEngCJNDegwRBn8OAML0awY5daKaAON5PQx4qAqAsGrl10yyZmtaK4Ec3LSD6IYAT950x0gimKN0P4rBSFJ0XSGfQH5hcCpQCshncS6ivmvKR0V8Zr5TEUKymYvgCjA0q5n4Mkx4vl3M3WpOt5hv7nLfWlzNlnK17Kdn2c3fJiHu/eR/mO6R1e2L/Bn6s3uTimoNDmajpgfsYPqPragYPoI3TP5OTp+m5QL2YFVl6IySuGHZIvxp8HTrr4KwgYvnOEvUfjWofP1YstwvWNPSDhs9zQqO6Ka0VNXiQNWBVDSonG9JUU7mh9LQl7ieHKqojj1gbj6tUXY+yxboVCPwc/lBdl+fQdNTCOFFB8K0SJBcO/sEZaepCC4ZPp1ExKbgjAOnBFLYj70zC1vwMsOLycH+nQ18nIyIGHG07TOdnQ== baurzhan@MacBook-Pro.home
@baurzhan-konurbayev
baurzhan-konurbayev / understanding_ls_l_linux.md
Created September 25, 2023 05:58
Understanding the Execution of `ls -l` in Linux

Understanding the Execution of ls -l in Linux

  1. Command Input:

    • The user types ls -l in the terminal, and the shell reads this input.
  2. Command Parsing & PATH Variable:

    • The shell parses the command and its arguments.
    • The shell searches for the ls binary in the directories listed in the PATH environment variable.
  3. Permission & Access Check: