Wednesday, August 17, 2016

Shit I learned about linux, in the last whatever, 1471359085

The new version of dd has a progress flag, I know whenever I use rsync I always use capital P flag. But since the dd progress thing is a relatively new edition and I was never that big into using the pv command, I tend to use another trick which is to send a signal with kill, not an actual kill signal but the USR1 signal with is a user defined signal, IE defined in the dd code itself. I could do a ps find it's pid and then kill -USR1 pid, but I wrote a couple aliases in my .bashrc:

alias findd="ps aux | grep dd | grep 'if='"
alias dprog='for i in $(findd |awk "{print $2}");do sudo kill -USR1 ;done'
Another thing I do is use command substitution to name files for my blog, so when I want to make one of these kinds of posts for example the command I use to get started is:
dusty@xor:~$ vim $(perl -e 'print(time())')_linux
dusty@xor:~$ ls blog/
1471359085_linux
Or in my .bashrc:
alias vimblog='vim $(perl -e "print(time())")_linux'
As you guys know I prefer using httpie to curl, so when I was messing with the github api in just bash, this is how I got the number of stars for a repo, where bsdpunk is your user and trash is your repo:
dusty@xor:~$ http https://api.github.com/repos/bsdpunk/trash/stargazers | python -m json.tool | grep login | wc -l
6
Also new i3 setup:

No comments: