Commit 28327460 authored by psachin's avatar psachin 🎮

[Update] Handy commands

with some minor change in about pagee and publish file.
Signed-off-by: psachin's avatarSachin Patil <psachin@redhat.com>
parent 06375afb
Pipeline #42898450 passed with stages
in 1 minute and 23 seconds
......@@ -9,12 +9,12 @@
#+ATTR_HTML: :class center no-border
[[file:../../images/about/rx_open_source.png]]
I try not to be biased with any programming language or technology.
I work on GNU/Linux and Free & Open Source Software for living. I
prefer to use Google products at minimum and use [[https://duckduckgo.com/][duckduckgo]] to
search the Web using [[https://www.privateinternetaccess.com/][privateinternetaccess]] VPN service. If you are
passionate about GNU and Free Software like me, I encourage you to
watch this [[https://www.youtube.com/watch?v=Er1pM9suxvE][YouTube video]] by Benjamin Mako Hill.
I try not to be biased with any programming language or technology. I work on
GNU/Linux and Free & Open Source Software for living. I prefer to use Google
products at minimum and use [[https://duckduckgo.com/][duckduckgo]] to search the Web using
[[https://www.privateinternetaccess.com/][privateinternetaccess]] VPN service. If you are passionate about GNU and Free
Software like me, I encourage you to watch this [[https://www.youtube.com/watch?v=Er1pM9suxvE][YouTube video]] by Benjamin Mako
Hill.
** My work-space
......@@ -23,68 +23,65 @@
** @Home
My current system is [[https://plus.google.com/photos/photo/113870692888444102463/6355020254313100738?icm=false&sqid=104043194426129544738&ssid=2c4bb3f4-0eed-4d83-9385-eb6e51a01dc9][Lenovo G505s]] with AMD A8 Quad-core processor
and 8 Gigs of RAM running Slackware 14.1(I always prefer [[https://github.com/psachin/bash_scripts/blob/master/build_my_kernel.sh][latest
kernel]]. I usually work on this system.
My current system is [[https://plus.google.com/photos/photo/113870692888444102463/6355020254313100738?icm=false&sqid=104043194426129544738&ssid=2c4bb3f4-0eed-4d83-9385-eb6e51a01dc9][Lenovo G505s]] with AMD A8 Quad-core processor and 8 Gigs
of RAM running Slackware 14.1(I always prefer [[https://gitlab.com/psachin/bash_scripts/blob/master/build_my_kernel.sh][latest kernel]]. I usually work
on this system.
My other system includes /Acer emachines eM350/ netbook running
[[https://manjaro.org/][Manjaro Linux]] an independently developed [[https://www.archlinux.org/][Arch Linux]]. I've [[http://awesomewm.org][Awesome
window manager]] on it. I use it as a hotspot using [[https://github.com/psachin/hotspotd][hotspotd]]. +I also
have an old desktop with AMD Athlon with 2 Gigs of RAM running+
+Slackware again!. The system's storage is shared via NFS across my
home network, basically this is my NFS server.+
My other system includes /Acer emachines eM350/ netbook running [[https://manjaro.org/][Manjaro Linux]]
an independently developed [[https://www.archlinux.org/][Arch Linux]]. I've [[http://awesomewm.org][Awesome window manager]] on it. I
use it as a hotspot using [[https://github.com/psachin/hotspotd][hotspotd]]. +I also have an old desktop with AMD
Athlon with 2 Gigs of RAM running+ +Slackware again!. The system's storage is
shared via NFS across my home network, basically this is my NFS server.+
Apart from this I had a very old Intel Pentium II Machine with
350MHz processor and 64MB of RAM running Vector Linux. +I wonder
how this machine [[https://plus.google.com/+Sachinp/posts/UMCp3L6NiAn?pid=5864821069617337218&oid=113870692888444102463][still runs?]]+
Apart from this I had a very old Intel Pentium II Machine with 350MHz
processor and 64MB of RAM running Vector Linux. +I wonder how this machine
[[https://plus.google.com/+Sachinp/posts/UMCp3L6NiAn?pid=5864821069617337218&oid=113870692888444102463][still runs?]]+
Most of my home network and Internet connection is managed by
D-LINK DIR-615E wireless router flashed with custom
[[https://openwrt.org/][OpenWRT(barrier-breaker)]]. This is my backup(and tiny) Linux system
with minimal shell and =opkg= package manager.
Most of my home network and Internet connection is managed by D-LINK DIR-615E
wireless router flashed with custom [[https://openwrt.org/][OpenWRT(barrier-breaker)]]. This is my
backup(and tiny) Linux system with minimal shell and =opkg= package manager.
** @Work
For work, I use Lenovo Thinkpad T440p running [[https://getfedora.org/][Fedora]]. I work on [[https://www.redhat.com/en/technologies/management/insights][Red
Hat Insights]]. Watch this introductory [[https://www.youtube.com/watch?v=MfRnKe-xxLM][YouTube video]] to know more
about Red Hat Insights.
For work, I use Lenovo Thinkpad T440p running [[https://getfedora.org/][Fedora]]. I work on [[https://www.redhat.com/en/technologies/management/insights][Red Hat
Insights]]. Watch this introductory [[https://www.youtube.com/watch?v=MfRnKe-xxLM][YouTube video]] to know more about Red Hat
Insights.
** Tools I use
#+ATTR_HTML: :class center no-border
[[file:../../images/about/tools-server-small.png]]
[[https://www.gnu.org/software/emacs/][GNU Emacs]] and a terminal are the essential tools I need. However I
manage most of the shell tasks from Emacs.
[[https://www.gnu.org/software/emacs/][GNU Emacs]] and a terminal are the essential tools I need. However I manage
most of the shell tasks from Emacs.
I prefer to use latest Emacs version. My Emacs is heavily
[[https://gitlab.com/psachin/emacs.d][configured]] for all my needs from programming(Python, Django, C,
elisp, Ruby, shell etc.), blogs & note taking[[https://orgmode.org/][(org-mode)]], agenda,
eshell, tramp, [[https://magit.vc][magit]] etc. Recently I fell in love with =M-x
emacs-timemachine=. Terminal is occasionally needed to keep some
front-end jobs running.
I prefer to use latest Emacs version. My Emacs is heavily [[https://gitlab.com/psachin/emacs.d][configured]] for all
my needs from programming(Python, Django, C, elisp, Ruby, shell etc.), blogs
& note taking[[https://orgmode.org/][(org-mode)]], agenda, eshell, tramp, [[https://opensource.com/article/19/1/how-use-magit][magit]] etc. Recently I fell in
love with =M-x emacs-timemachine=. Terminal is occasionally needed to keep
some front-end jobs running.
[[http://git-scm.com][Git]] is something I can't live without. I use Git to keep track of
my personal notes, blogs, and all the projects. =magit= is a
savior. It helps me a lot to learn insights of Git.
[[http://git-scm.com][Git]] is something I can't live without. I use Git to keep track of my personal
notes, blogs, and all the projects. =magit= is a savior. It helps me a lot to
learn insights of Git.
I prefer [[https://www.emacswiki.org/emacs/GnusTutorial][Gnus]] over [[http://www.mutt.org/][mutt]] to manage mails.
** More..
I find programming in =elisp= relaxing when I'm bored with Python
and friends. Occasionally I do write helper functions and share it
on [[http://sachin.pythonanywhere.com][sachin.pythonanywhere.com]].
I find programming in =elisp= relaxing when I'm bored with Python and
friends. Occasionally I do write helper functions and share it on
[[http://sachin.pythonanywhere.com][sachin.pythonanywhere.com]].
** Blogs
#+ATTR_HTML: :class center no-border
[[file:../../images/about/Anonymous-pen-pencil-small.png]]
For raw/old posts please visit [[https://github.com/psachin/blog-posts][blog-posts]]. Most of them are written
in [[http://orgmode.org/][org-mode]]. +I now use [[https://jekyllrb.com/][jekyll]] to publish my blogs(Source [[https://github.com/psachin/psachin.github.io][here]]).+
+Jekyll uses markdown which I don't like much. I miss org-mode to
post blogs.+ This website is [[https://gitlab.com/psachin/psachin.gitlab.io][entirely published]] using org-mode.
For raw/old posts please visit [[https://gitlab.com/psachin/blog-posts][blog-posts]]. Most of them are written in
[[http://orgmode.org/][org-mode]]. +I now use [[https://jekyllrb.com/][jekyll]] to publish my blogs(Source [[https://github.com/psachin/psachin.github.io][here]]).+ +Jekyll uses
markdown which I don't like much. I miss org-mode to post blogs.+ This
website is [[https://gitlab.com/psachin/psachin.gitlab.io][entirely published]] using org-mode.
** Talks/Presentations/Slides
......@@ -101,14 +98,14 @@
- [[http://psachin.github.io/py-starwars/][py-starwars]]: Introductory talk on Python programming language.
** Articles
- Posts published on [[https://opensource.com/users/psachin][opensource.com]]
- Posts published on other web portals:
- My posts published on [[https://opensource.com/users/psachin][opensource.com]]
- My posts published on other web portals:
* [[http://www.csi-india.org/communications/CSIC%20July%202013.pdf][GNU/Linux on Aakash]]: An article published in CSI
communications(July 2013) on [[http://aakashlabs.org/gnu/][Aakash]] during my work at Indian
Institute of Technology Bombay.
* [[http://www.linuxquestions.org/linux/answers/hardware/configuring_huaweiec152_modem][Configuring Huawei-EC152 modem]]: My very first article appeared
on [[https://www.linuxquestions.org/][linuxquestions.org]]. I just started using GNU/Linux that time
and USB-modeswitch was also quite new.
communications(July 2013) on [[http://aakashlabs.org/gnu/][Aakash]] during my work at Indian Institute of
Technology Bombay.
* [[http://www.linuxquestions.org/linux/answers/hardware/configuring_huaweiec152_modem][Configuring Huawei-EC152 modem]]: My very first article appeared on
[[https://www.linuxquestions.org/][linuxquestions.org]]. I just started using GNU/Linux that time and
USB-modeswitch was also quite new.
** Contact
......
......@@ -5,123 +5,125 @@
List of commands for day-to-day use
(*Last updated on Jan 03, 2019*)
/(Last updated on Jan 08, 2019)/
**** SOCKS proxy using SSH
#+BEGIN_SRC sh
ssh -N -D 1080 user@server
#+END_SRC
/where/
=-N=: Do not execute remote commands.
=-D=: =[bind address:]port= (Port in above example)
**** wget a website
#+BEGIN_SRC sh
wget -rkp -l5 -np -nH -cut-dirs=1 https://example.com
#+END_SRC
/where/
=-rkp=: recursive, make link suitable for local viewing, download all files needed to properly view the page.
=-l5=: recursively download 5 links away form the original page.
=-n=: retrieve files below parent directory.
=-H=: Span across hosts when doing recursive retrieving.
**** Capture screenshot
#+BEGIN_SRC sh
import -window root screenshot.png
#+END_SRC
**** Reduce PDF size
** PDF tricks
- Reduce PDF size
#+BEGIN_SRC sh
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -sOutputFile=new_file.pdf original_file.pdf
#+END_SRC
**** Unlock PDF file
- Unlock PDF file
#+BEGIN_SRC sh
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf
#+END_SRC
**** Rotate video
#+BEGIN_SRC sh -n
# Using mplayer(watch rotated video)
mplayer -vf-add rotate=1 sample.mp4
# Using ffmpeg
ffmpeg -i infile.mp4 -strict -2 -vf "transpose=1" outfile.mp4
#+END_SRC
- Extract pages from PDF file
#+BEGIN_SRC sh
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -dFirstPage=1 -dLastPage=3 -sOutputFile=out_file_page_1_to_3.pdf input_file.pdf
#+END_SRC
** Media tricks
- Rotate video
#+BEGIN_SRC sh -n
# Using mplayer(watch rotated video)
mplayer -vf-add rotate=1 sample.mp4
**** Convert 3GP to MP4
#+BEGIN_SRC sh
ffmpeg -i VID_0050.3gp -strict -2 -q:a 0 -ab 64k -ar 44100 VID_0050.mp4
#+END_SRC
# Using ffmpeg
ffmpeg -i infile.mp4 -strict -2 -vf "transpose=1" outfile.mp4
#+END_SRC
**** FLV to MP4
#+BEGIN_SRC sh
ffmpeg -i input.flv -qscale 1 -ar 22050 output.mp4
#+END_SRC
- Convert 3GP to MP4
#+BEGIN_SRC sh
ffmpeg -i VID_0050.3gp -strict -2 -q:a 0 -ab 64k -ar 44100 VID_0050.mp4
#+END_SRC
- FLV to MP4
#+BEGIN_SRC sh
ffmpeg -i input.flv -qscale 1 -ar 22050 output.mp4
#+END_SRC
**** Extract audio(MP3) from MP4 video
#+BEGIN_SRC sh -n
ffmpeg -i video.mp4 -f mp3 -ab 192000 -vn music.mp3
- Extract audio(MP3) from MP4 video
#+BEGIN_SRC sh -n
ffmpeg -i video.mp4 -f mp3 -ab 192000 -vn music.mp3
# or specify codec to use `libmp3lame` in this case.
ffmpeg -i video.mp4 -f mp3 -codec:a libmp3lame -ab 320000 -vn music.mp3
#+END_SRC
# or specify codec to use `libmp3lame` in this case.
ffmpeg -i video.mp4 -f mp3 -codec:a libmp3lame -ab 320000 -vn music.mp3
#+END_SRC
/where/
/where/
=-i=: input file
=-i=: input file
=-f mp3=: file format should be MP3
=-f mp3=: file format should be MP3
=-ab 192000=: audio should be encoded at 192Kbps. 320000 for 320Kbps
=-ab 192000=: audio should be encoded at 192Kbps. 320000 for 320Kbps
=-vn=: don't want video
=-vn=: don't want video
**** Cut video by time interval
***** Cut video starting from 19 min 49 seconds up to 04 mins 18 seconds.
- Cut video starting from 19 min 49 seconds up to 04 mins 18 seconds.
#+BEGIN_SRC sh
ffmpeg -y -i Video.mp4 -qscale 1 -ss 00:19:49.0 -t 00:04:18.0 -acodec copy -vcodec copy output.mp4
#+END_SRC
/Note/: =-sameq= was removed in recent version of =ffmpeg=
**** Use =mplayer= to extract audio(MP3)
- Use =mplayer= to extract audio(MP3)
#+BEGIN_SRC sh
mplayer -dumpaudio movie.flv -dumpfile movie_audio_track.mp3
#+END_SRC
**** Reduce resolution
- Reduce resolution
#+BEGIN_SRC sh
ffmpeg -i Birdman.mp4 -strict -2 -s 720x480 birdman.mp4
#+END_SRC
**** recordmydesktop
- recordmydesktop
#+BEGIN_SRC sh
recordmydesktop -x 100 -y 100 --width 1280 --height 720 --freq 48000 --fps 30 -o ~/Videos/recordings/test-video.ogv
#+END_SRC
**** Include subtitles(Use =subtitleeditor= to create subtitle)
- Include subtitles(Use =subtitleeditor= to create subtitle)
#+BEGIN_SRC sh
ffmpeg -i video.avi -vf subtitles=subtitle.srt out.avi
#+END_SRC
**** Resize image 50% of its original size
** Image manupulation
- Capture screenshot
#+BEGIN_SRC sh
import -window root screenshot.png
#+END_SRC
- Resize image 50% of its original size
#+BEGIN_SRC sh
convert dragon.gif -resize 50% half_dragon.gif
#+END_SRC
**** Control compression level of an image
- Control compression level of an image
#+BEGIN_SRC sh
convert input.png -quality 75 output.jpg
#+END_SRC
**** Clean up =~/.ccache/= directory
** Git
- Find commits by author between timeline
#+BEGIN_SRC sh -n
# Syntax
git log --since "START" --until "END" --author=AUTHOR --pretty=oneline --diff-filter=A
# Example
git log --since "Oct 1 2018" --until "DEC 28 2018" --author=psachin@redhat.com --pretty=oneline --diff-filter=A
# If you also want to see the file names
git log --since "Oct 1 2018" --until "DEC 28 2018" --author=psachin@redhat.com --name-status --pretty=oneline --diff-filter=A
#+END_SRC
** Misc
- SOCKS proxy using SSH
#+BEGIN_SRC sh
ssh -N -D 1080 user@server
#+END_SRC
/where/
=-N=: Do not execute remote commands.
=-D=: =[bind address:]port= (Port in above example)
- Clean up =~/.ccache/= directory
#+BEGIN_SRC sh -n
# View statistics using
ccache -s
......@@ -129,17 +131,20 @@ List of commands for day-to-day use
# Clear cache using
ccache -C
#+END_SRC
**** Git
***** Find commits by author between timeline
#+BEGIN_SRC sh -n
# Syntax
git log --since "START" --until "END" --author=AUTHOR --pretty=oneline --diff-filter=A
# Example
git log --since "Oct 1 2018" --until "DEC 28 2018" --author=psachin@redhat.com --pretty=oneline --diff-filter=A
- wget a website
#+BEGIN_SRC sh
wget -rkp -l5 -np -nH -cut-dirs=1 https://example.com
#+END_SRC
/where/
# If you also want to see the file names
git log --since "Oct 1 2018" --until "DEC 28 2018" --author=psachin@redhat.com --name-status --pretty=oneline --diff-filter=A
#+END_SRC
=-rkp=: recursive, make link suitable for local viewing, download all files needed to properly view the page.
=-l5=: recursively download 5 links away form the original page.
=-n=: retrieve files below parent directory.
=-H=: Span across hosts when doing recursive retrieving.
#+INCLUDE: "../disquss.inc"
......@@ -81,7 +81,7 @@
(defvar psachin-website-html-postamble
"<div class='footer'>
Copyright © 2012-2018 <a href='mailto:iclcoolster@gmail.com'>Sachin Patil</a>. <br>
Copyright © 2012-2018 <a href='mailto:iclcoolster@gmail.com'>Sachin Patil</a> | <a href='https://gitlab.com/psachin/psachin.gitlab.io'>Source</a><br>
GnuPG fingerprint: 28C5 A1F3 221B 949D B651 FC47 E5F9 CE48 62AA 06E2 <br>
Adapted from <a href='https://nicolas.petton.fr'>https://nicolas.petton.fr</a> <br>
Last updated on %C using %c
......@@ -124,6 +124,8 @@ PROJECT: `posts in this case."
:sitemap-format-entry psachin-org-sitemap-format-entry
:sitemap-style list
:sitemap-sort-files anti-chronologically
:html-link-home "/"
:html-link-up "/"
:html-head-include-scripts t
:html-head-include-default-style nil
:html-head ,psachin-website-html-head
......@@ -137,6 +139,8 @@ PROJECT: `posts in this case."
:recursive nil
:publishing-function org-html-publish-to-html
:publishing-directory "./public/about"
:html-link-home "/"
:html-link-up "/"
:html-head-include-scripts t
:html-head-include-default-style nil
:html-head ,psachin-website-html-head
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment