Skip to content

Instantly share code, notes, and snippets.

View senthilnayagam's full-sized avatar

Senthil Nayagam senthilnayagam

  • Muonium
  • Chennai, India
View GitHub Profile
@senthilnayagam
senthilnayagam / md5.js
Created January 10, 2023 08:28
md5 code generated using chatgpt
function md5(string) {
function RotateLeft(lValue, iShiftBits) {
return (lValue<<iShiftBits) | (lValue>>>(32-iShiftBits));
}
function AddUnsigned(lX,lY) {
var lX4,lY4,lX8,lY8,lResult;
lX8 = (lX & 0x80000000);
lY8 = (lY & 0x80000000);
lX4 = (lX & 0x40000000);
@senthilnayagam
senthilnayagam / automate.sh
Created September 9, 2022 17:04
stable diffusion openvino usage via shell script
echo "count: $1";
echo "prompt: $2";
echo "output_file_basename: $3";
echo "prompt: $2" > prompt_$3.txt;
for i in $(seq 1 1 $1)
do
echo "python3.9 demo.py --prompt \"$2\" --output output_$3_$i.png";
python3.9 demo.py --prompt "$2" --output output_$3_$i.png
done
@senthilnayagam
senthilnayagam / Malayalam_film_recommendations.txt
Created March 11, 2021 11:18
Malayalam film recommendations
Film Recommendations
Premam - 2015, Sai Pallavi, nivin
Ayyappanum Koshiyum
Driving License
Salalah Mobiles 2014
ABCD: American-Born Confused Desi -2013
Ustad Hotel - 2012 - Anwar Rasheed, Dulqer
bangalore days -2014 -Anjali Menon
Koode -2018 - Anjali Menon
@senthilnayagam
senthilnayagam / gist:0dccc2e2a0e9d6615145
Created June 1, 2015 14:09
OCR has a long way to go, Ahmedabad recognized with 142 variants
(AH&MIEDABAD)
(AH,.M~
(AH-ABAD
(AH-MEDABAD)
(AH1l4lZlhlBAD)
(AHAMEDABAD)
(AHAfEDABAD)
(AHEME$ABAD)
(AHEMEDmAD)
(AHIMEDABAD)
@senthilnayagam
senthilnayagam / gist:5c80447d12d655eab66c
Created May 13, 2015 06:22
list of commit messages
thinking of analysing commit messages
git log --pretty=format:'"%s"' --shortstat --no-merges | grep -v '^[[:space:]]*$' | grep -v 'changed.*insertion.*deletion\|changed.*insertion\| changed.*deletion'
if you want a cvs with multiple fields use this instead
git log --pretty=format:'"%h","%an","%aD","%s",' --shortstat --no-merges
1899 26[3]
1900 36 76,094,000 0.047 NA
1901 54 77,584,000 0.070 negative increase47.12%
1902 79 79,163,000 0.100 negative increase43.38%
1903 117 80,632,000 0.145 negative increase45.40%
1904 172 82,166,000 0.209 negative increase44.26%
1905 252 83,822,000 0.301 negative increase43.62%
1906 338 85,450,000 0.396 negative increase31.57%
1907 581 87,008,000 0.668 negative increase68.82%
1908 751 88,710,000 0.847 negative increase26.78%
git ls-files | grep '\.rb$' | xargs -I FILE -- sh -c 'echo FILE ; ruby -c FILE '
@senthilnayagam
senthilnayagam / git-modifiedby
Created April 30, 2015 09:40
which user knows which part of the code? this script helps you identify the files modified by a author
#!/bin/bash
set -e
git log --pretty="%H" --author="$1" | while read commit_hash; do git show --oneline --name-only $commit_hash | tail -n+2; done | sort | uniq
#usage
# git modifiedby author
@senthilnayagam
senthilnayagam / gist:46e817296ab30c640ddd
Created April 29, 2015 09:19
from git repository, list files when it was last modified, this can be sorted or further processing can be done
git ls-tree -r --name-only HEAD | while read filename; do
echo "$(git log -1 --format="%ad" --date=short -- $filename) $filename"
done
@senthilnayagam
senthilnayagam / email_extract.sh
Last active August 29, 2015 14:20
extract email from trai dump
ls *.html | xargs -n1 cat | grep -o '[[:alnum:]+\.\_\-]*@[[:alnum:]+\.\_\-]*' | grep -v 'advqos@trai.gov.in' | sort | uniq | wc -l
# 119798