Artificial ?
 
  
 
  Sometimes just one line of code can make all the difference. I will show you with example.
Here is script with 2 functions. Both are writing some lines of text to a file. First function, “a” I have used the redirection to write to file. Function “b”, I have opened a file descriptor with “>” before going into the loop and use that reference for writing to the file. (This concept remains same for any scripting or programming language).
Continue readingSomething that you may want to know sometimes and docker cli does not show by default is all the tags for the image on docker hub. Here is example to list all tags fro the centos image
curl https://registry.hub.docker.com/v2/repositories/library/centos/tags |jq '."results"[]["name"]'
The example is for a v2 registry. The output for v1 is different than v2 registry. For a v1 registry, you can use command like below
curl https://registry.hub.docker.com/v1/repositories/centos/tags |jq '.[]["name"]'
Kitty is a very nice and fast terminal that uses GPU, you can find more information here. For this terminal there are lot of themes available that you can checkout on the kitty themes github page here.
You can checkout the themes with
git clone https://github.com/dexpota/kitty-themes ~/.config/kitty/kitty-themes
Once you have done that, you can use the theme with adding a line in kitty.conf as :
include
If you quickly want to type the unicode character in urxvt terminal, then try doing this:
Press Shift+Ctrl and then type the number for the unicode. 🙂
Lot of times, I just want to copy the git url to clipboard. This is so common in my flow of work that I created an alias for it. Here it is:
alias git-url="cat .git/config|awk '/url/ {print $3}'|xclip -i -selection clipboard"