Collection of cool things I learnt today.
shell test and [
Today I learned that [ is actually a binary and a shell built-in. whereis [ # output => [: /usr/bin/[ which [ # output => [: shell built-in command
Collection of cool things I learnt today.
Today I learned that [ is actually a binary and a shell built-in. whereis [ # output => [: /usr/bin/[ which [ # output => [: shell built-in command
Today I learned about TTYs and PTYs and the command tty and stty. tty outputs the tty/pty the shell is running on. while stty sets tty/sty options and params. Those include AURT related configs, line discipline configs, and TTY driver’s configs. # display all configs stty -a The output will be something like the following: # tty general settings speed 38400 baud; rows 59; columns 224; line = 0; # special characters intr = ^C; quit = ^\; erase = ^?...
Today I learned about postmortem debugging in Python. 3 ways to add postmortem debugging into python worflow are: Running the python script using pdb directly. PDB will create a breakpoint when the problem will fail. python -m pdb script.py Using pdb postmortem inside an except statement. PDB will drop us a breakpoint in the line which raised the exception. try: something() except Exception: import pdb(); pdf.post_mortem() handle_exception() Using pdb postmortem with a test runner (Pytest)....
Today I learned about cloud management platforms. They complete IAC tools, and inventory tools. Incorporating monitoring and metering, orchestration and automation all in one tool. They are used to manage public and private clouds too. In contrast with solutions like apache cloudstack and openstack which manage hypervisors and cloud resources building a private cloud. CMPs come at a higher level and are used to manage clouds (openstack’s included). One of OSS options are Mist....
Today I learned about chapters in mpv, how to use them and how useful they are especially with youtube and youtube-dl. The current chapter’s name is displayed among the video information (i shortcut). ! and @ moves to the previous and next chapter respectively.
Today I learned how to copy aws EC2 amis between regions usin aws CLI. aws ec2 copy-image --name "{}" --source-image-id "{}" --source-region "{}" --region "{}" --name is for the name of the ami in the new region, and --region is for the destination region. I used it to migrate a bunch of amis from a region to another from subprocess import Popen, PIPE import json import mysql.connector def kebab(name): return name....
Today I learned about DNS and how it works, and learned some terminology as well. First I followed this awesome playlist. Here is what I learned from it: Video 1: DNS Tree structure: DNS domains and hostnames are stored in a tree structure, with the root domain (.) at the top. Video 2: The hierarchy is composed of the root domain at the top, then top level domain (.com, .info, ....