Skip to content

Instantly share code, notes, and snippets.

@rajatvikramsingh
rajatvikramsingh / watch_command.md
Last active February 17, 2017 02:11
Watch the filesize of a file you're downloading in Terminal

Recently I needed to watch the size of a file I was downloading and see how the size was increasing. I came across the command watch on unix. According to manpage of watch:

watch - execute a program periodically, showing output fullscreen

Sample Usage:

watch -n 5 "du -h <file name>"

Sample Output: (fullscreen)

@rajatvikramsingh
rajatvikramsingh / srt_to_txt.md
Created January 28, 2017 22:03
Convert srt to txt file - regex

I recently wanted to extract the text from a srt file and tried different approaches. It can be easily done using regular expressions and a text editor which can search using regex. A typical srt file:

1
00:00:00,180 --> 00:00:03,180
Spoken Line 1

2
00:00:03,180 --&gt; 00:00:07,290