Skip to content

Instantly share code, notes, and snippets.

View aswinpajayan's full-sized avatar

Aswin P Ajayan aswinpajayan

  • Bengaluru, India
View GitHub Profile
@aswinpajayan
aswinpajayan / conv_thresh.sh
Last active October 17, 2020 15:50
Commands to convert pdf to image and adjust threshold
# change policy modules in image magick
#<!-- <policy domain="coder" rights="none" pattern="MVG" /> -->
#<policy domain="coder" rights="read|write" pattern="PDF" />
# add line <policy domain="coder" rights="read|write" pattern="LABEL" />
#copy file to to any folder (one file per folder)
convert -density 72 Kashyapa\ samhitha\ Full.pdf -quality 90 output.jpg
mkdir out
for file in *.jpg;do convert $file -channel RGB -threshold 42% out/$file.jpg; done
@aswinpajayan
aswinpajayan / changeFrameRate.sh
Last active November 11, 2019 09:06
to resize video from commandline
ffmpeg -i <input> -filter:v fps=fps=30 <output>
@aswinpajayan
aswinpajayan / gsc.js
Created May 15, 2019 10:21 — forked from TummanapallyAnuraag/gsc.js
GSC Usernames
/*
Author: Anuraag Tummanapally
URL: https://www.google.com/search?q=google+scholar+iitb+ee&oq=google+scholar+iitb+ee
Search for:
google scholar iitb ee
in Google, then copy this code and paste in CONSOLE
*/
var length_var=document.getElementsByClassName('LC20lb').length;
var names = ["names"];
@aswinpajayan
aswinpajayan / awk_hack_easy_lookup_table.sh
Last active April 30, 2019 19:08
hack to implement lookup table in vhdl
:%!nl
the above line adds line numbers to a file in vim
awk '{printf ("when x%x => sreg <= %s\n", $1,$4)}' file_input | xclip
bcdedit /set {bootmgr} path \EFI\ubuntu\shimx64.efi
@aswinpajayan
aswinpajayan / .vimrc
Last active April 23, 2020 05:42
initial configs of my ubuntu
syntax on
filetype plugin on
execute pathogen#infect()
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
"these lines are needed for syntastic plugin
let g:syntastic_always_populate_loc_list = 1
@aswinpajayan
aswinpajayan / combiner.sh
Created December 4, 2018 19:40
insert blank pages in a pdf
i=0
pdftk A=mailmerged.pdf cat A1-3 output combined.pdf
while [ $i -le 116 ]
do
p1=$(($i*3+1));
p2=$(($i*3+3));
echo "$p1 to $p2"
#pdftk A=combined.pdf B=blank.pdf C=mailmerged.pdf cat A B1-1 C$p1-$p2 output combined.pdf
echo "A$p1-$p2 B1-1" >> com.txt