About named pipes

named pipes Named pipes allow transfer of data between processes in a FIFO manner and synchronization of process execution. Named pipes differ from standard unnamed pipes, created using the pipe() function, in that they involve the creation of a real file that is available for I/O operations to properly authorized processes. You give the FIFO a name and an access mode when you create it. An unnamed pipe is accessible only by the process that created the pipe and its child processes. ...

February 21, 2022 · 1 min

Common curl flags in the wild

Common curl flags encounter in the wild -X/--request <command> # -X => communicates with the server with custom request method such as PUT, DELETE,PROPFIND,COPY,MOVE # If this option is used several times, the last one will be used. curl -X GET "https://api.spotify.com/v1/users/tuggareutangranser" -H "Authorization: Bearer {your access token}" -H/--header <header> # For (HTTP) => adds an extra header. # Note if the header already exists it will be replace by the new one. # Replacement should not be done unless you know the sideeffects of said action. # to remove internal header do the following: -H "Host:" # do not add newlines or carriage returns curl adds proper end-of-line marker # See also the -A/--user-agent and -e/--referer options. # -H may be used mutiple times for mutiple header operations. curl -X GET "https://api.spotify.com/v1/users/tuggareutangranser" -H "Authorization: Bearer {your access token}"

February 13, 2022 · 1 min

Git Pro Book info

Git Pro Book You can view all your settings and where they are coming from using: git config --list --show-origin set your username + email address git config --global user.name "John Doe" git config --global user.email johndoe@example.com If you want to override this with a different name or email address for specific projects, you can run the command without the –global option when you’re in that project. If you want to use a different text editor, such as Emacs, you can do the following: ...

February 13, 2022 · 6 min

Methods for acessing the index in for loop for python

accessing the index in for loops? for idx, val in enumerate(ints): print(idx, val) # or for index, item in enumerate(items): print(index, item) # or to start at 1 for count, item in enumerate(items, start=1): print(count, item)

February 13, 2022 · 1 min

Pushing git repo to Github

Pushing git repo to Github If you want to have your repository backed up somewhere outside of your machine, such as GitHub. See github.com/new to create a new repository, and add the repository URL to your project (where https:// needs to be replaced with the repository URL— something like https://github.com//animal-farm.git): git remote add origin <url> Now, you just need to push the changes from your local repository: git push -u origin master Your local and remote repositories will now operate independently. If you want to update your local repository with changes from the remote repository (the one you cloned), you’ll have to run git pull –rebase. ...

February 13, 2022 · 1 min

Replace -- with --- in vim

Replace – with — in vim :%s,-\@<!---\@!,---

February 13, 2022 · 1 min

Using virutal environments with venv module in python

How to Use Virtual Environments with the Built-In venv Module mkdir my_project # or git clone URL python3 -m venv my_project/venv cd my_project source my_project/venv/bin/activate python3 -m venv .venv source .venv/bin/activate python3 -m venv . source bin/activate To find current location which python To install packages with pip pip install -r requirements.tx

February 13, 2022 · 1 min

verify the sha256 checksum of a downloaded file on macos

HOW TO VERIFY THE SHA256 CHECKSUM OF A DOWNLOADED FILE for mac shasum -a 256 /path/to/file -a, –algorithm 1 (default), 224, 256, 384, 512, 512224, 512256a

February 13, 2022 · 1 min

vim plug installation for new computer

vim plug installation sh -c ‘curl -fLo “$XDG_DATA_HOME:-$HOME/.local/share”/nvim/site/autoload/plug.vim –create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'

February 13, 2022 · 1 min

chmod

chmod To set a file, so it is public for reading, writing, and executing, the command is: chmod u=rwx,g=rwx,o=rwx test.txt

February 5, 2022 · 1 min