#shell
3 discoveries · Hand-picked discoveries from the open web, newest first.
-
How to Automate Docker Image Creation for Postgres Using Shell Commands
If you have certain lines of code that repeat over and over again in a project, there's a pretty standard solution for it: using a function. But what about when you have the same project file setup th
freeCodeCamp · EN
-
Shell Redirection Order
A Brief Intro When i take a look at bash’s documentation about shell redirection , i found out that this two examples are different. This one: ls > dirlist 2>&1 and this one: ls 2>&1 > dirlist So let’s try understanding why it is different. What 2>&1 means? From this hacker news comment , it looks like the expression 2>&1 is like calling system call dup2(2, 1). If we take a look at the man page (man dup2), here is one of the description:
/dev/null · EN
-
Disable Memory Address Randomization for Shell
At the time of writing this blog post, i recently learn about virtual memory. So i am curious, how can we trigger the same memory address on different process? After reading this gcc wiki , it looks like we can use setarch to do that. First thing first, we need to create a simple program to print the memory address. For this example, i am going to use C programming language, like this:
/dev/null · EN