Ask HN: Best things in your bash_profile/aliases?
I have the below for cases when I have to make a quick screencast. It needs ffmpeg and I am not sure how well the yt flag works as I don&#x27;t really use Youtube any longer. Anyway.. first I do &#x27;ffsc sc&#x27; and if I want that video to be smaller I do &#x27;ffsc yt &lt;path_to_file&gt;&#x27;.<p>## Make screencast or convert to yt<p>ffsc () {<p>vid_name=&quot;$HOME&#x2F;Videos&#x2F;Screencasts&#x2F;screencast_$(date +&#x27;%y%m%d-%H%M%S&#x27;)&quot;<p><pre><code>        case $1 in
                sc) ffmpeg -f x11grab -s 1920x1080 -i $DISPLAY -r 30 -f alsa -i default -preset ultrafast \
                    -c:v ffvhuff -c:a flac ${vid_name}.mkv
                    printf &quot;${vid_name}.mkv&quot; | xsel -i

                    echo
                    echo &quot;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&quot;
                    echo &quot;Output file name: ${vid_name}.mkv&quot;
                    echo &quot;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&quot;
                    echo

                    [ -e &#x2F;tmp&#x2F;ffsc.tmp ] &amp;&amp; { rm &#x2F;tmp&#x2F;ffsc.tmp }
                    printf &quot;${vid_name}.mkv&quot; &gt; &#x2F;tmp&#x2F;ffsc.tmp
                ;;
                yt) ffmpeg -i $2 -c:v libx264 -crf 18 -preset slow -pix_fmt rgb24 -c:a copy ${2&#x2F;scr&#x2F;yt_scr}
                    yt_name=$(cat &#x2F;tmp&#x2F;ffsc.tmp)
                    printf &quot;${yt_name&#x2F;scr&#x2F;yt_scr}&quot; | xsel -i

                    echo
                    echo &quot;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&quot;
                    echo &quot;Output file name: ${yt_name&#x2F;scr&#x2F;yt_scr}&quot;
                    echo &quot;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&quot;
                    echo
                ;;

                mini) ffmpeg -i $2 -strict -2 -s 1680x1050  -r 60 -c:v libx264 -b:v 164 -crf 22 -preset slow \
                      -pix_fmt yuv420p -c:a copy -an ${2&#x2F;scr&#x2F;mini_scr}
                      mini_name=${2&#x2F;scr&#x2F;mini_scr}
                      ffmpeg -i ${mini_name} -filter:v &quot;setpts=0.5*PTS&quot; -an ${mini_name&#x2F;.mkv&#x2F;.mp4}
                      rm ${mini_name}
                    printf &quot;${mini_name&#x2F;.mkv&#x2F;.mp4}&quot; | xsel -i

                    echo
                    echo &quot;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&quot;
                    echo &quot;Output file name: ${mini_name&#x2F;.mkv&#x2F;.mp4}&quot;
                    echo &quot;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&quot;
                    echo
                ;;
        esac</code></pre>
}<p>And another nice one I didn&#x27;t see here..<p># Python as a calculator<p>pc() { python -c &quot;print($*)&quot;; }