Skip to content

Instantly share code, notes, and snippets.

@canabady
canabady / tv
Created August 21, 2024 09:36
Bash script to remote control Android TV from PC terminal
# /bin/bash
# TVC Android TV - control script via adb shell
__ADB_DEVICE="192.168.1.128:5555"
declare -A charcode=(
[A]='29'
[B]='30'
[C]='31'
[D]='32'
[E]='33'
@canabady
canabady / psc-ivaas
Last active August 20, 2024 10:32
my ivaas
AG0DQHJpam5kYWVsLTEyOAAgAGNiYwBtY3J5cHQtc2hhMQAVHbxWBDAtYzBvf7cuSyjCqY3rx3hz
aGExAOr8g/FAvmnpzDYO+3y0l0iXQTZYdXvnnDVLp5EEpdAQhRgqfy8v+5XYRgXQ2FuuI/O+F36L
zjoleQQXuafromtDrKCe3rA+HKxnhhkWKdFw2lINzVp/l+1fPc9xHA0C8RSVeSlJUHsKPJRYYBCp
Q3Fd3FY0KbQBO8Gv7BwcX0HD8bUWziEe3MIS1PEwYb0Di96eQoGTvb2wLoegmdIb684WwiWgJiuD
32RWdd6yLHOkUkkH1OfNNiwUr6Bm18QgP7mLDTjkobIuGQXB3bZpOElsycyiYXI1c/KIGzQts9xM
/anXyg2I28mxb54+7EsV8xDcCQWxE8v6DQ9RqUxxvBMA/JvSz/+LAq3vCi8aBpfUJF7MXEUpbTOw
dghJdhA3m2TzuKe54LgDd6CAKZ5mlvmXAsStGCQr4lTItrwWwQUyjFdDuRlB3ufSAzaqIduBbPdu
V9mdW+oGkZq8hyxDbUlFS3Ofvg/LcRHpuKAkVwvZrSZQPk+XoBeolldOldP5/WLemGHwClQAz7PA
YBUIzF7/53axC6qw304MdyjO10jz5XWO4B2T9bnHwk8D6K2vbzTb0QVkiBF4YFwJev2w4d2iSMr+
hzKnncU3ZVHo7DIp/1sXJWfj5Ef6qmbtKD2ma3/EPqaixiEvojSDS/KPKLCVnxOVmJibZqwWFk5a
@canabady
canabady / tn_pc_ac_listing.md
Last active January 1, 2021 01:40
TN PC AC listing

To get assembly_constituency,parliamentary_constituency as a listing of parliamentary_constituency with its assembly_constituencies below it, we can use VIM macro which does the job in a matter of seconds.

i.e

TO GET

Gummidipoondi (AC-1),Thiruvallur (PC-1)
Ponneri (AC-2),Thiruvallur (PC-1)
Thiruvallur (AC-4),Thiruvallur (PC-1)

Poonamallee (AC-5),Thiruvallur (PC-1)

@canabady
canabady / retrieve all pdf from a webpage
Last active October 8, 2024 17:26
To Retrieve all PDF anchor links from a webpage
# To retrieve All PDF anchors links from a web page
var pdflinks =[];
Array.prototype.map.call(document.querySelectorAll("a[href$=\".pdf\"]"), function(e, i){if((pdflinks||[]).indexOf(e.href)==-1){ pdflinks.push( "wget -O " + e.text.replace(/\s+$/, '').replace(/ /g,"_") + ".pdf " + e.href ); } });
console.log(pdflinks.join("\n"));
@canabady
canabady / gcrypt-remote
Last active January 10, 2020 06:51
Configure remote to perform gcrypt while pushing the commits to it
[remote "origin"]
url = "gcrypt::[email protected]:ACCOUNT_NAME/personal.git#next"
fetch = +refs/heads/*:refs/remotes/gitcrypt/*
gcrypt-participants = 8DIGITKEY
@canabady
canabady / organizing myfiles.md
Last active January 3, 2020 10:11
organizing myfiles
<title>organizing myfiles</title>
@canabady
canabady / BGL-PDY-TJ-BGL-Trip.md
Last active December 27, 2019 12:43
BGL-PDY-TJ-BGL-Trip
<title>BGL-PDY-TJ-BGL-Trip</title>
#!/bin/bash
# DIR SETTINGS
_KURAL_DIR='/home/USERNAME/Music/Thirukkural/Kural-Song-Audio'
_PAADAL_DIR='/home/USERNAME/Music/01-Thevaram/00-thevaram-classified-by-artist'
# Scroll mail message based on isThevaram or isKural is true ( for auto scroll with xdotool )
typeset -g isThevaram=false
typeset -g isKural=false
# Every time an attempt to open an attachment is made, it's copied in a dedicated temp directory and the copy is opened.
# application/*; mkdir -p /tmp/mutt \; cp %s /tmp/mutt \; xdg-open /tmp/mutt/$(basename %s) &
##############################################################################
#
# MIME types and programs that process those types
#
###############################################################################
application/vnd.openxmlformats-officedocument.wordprocessingml.document; /usr/bin/abiword '%s'; test=test -n "$DISPLAY"
application/pdf; /usr/bin/xpdf -fullscreen '%s'; test=test -n "$DISPLAY"
set imap_user = "[email protected]"
set imap_pass = ""
# set smtp_url = "smtp://[email protected]:465/"
set smtp_url = "smtp://[email protected]@smtp.gmail.com:587/"
set smtp_pass = ""
set from = "[email protected]"
set realname = "Mailbox Name"
set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX"
set postponed = "+[Gmail]/Drafts"