Skip to content

Instantly share code, notes, and snippets.

palaniraja palaniraja

Block or report user

Report or block palaniraja

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
palaniraja /
Last active Jun 22, 2018
auto-shutdown on higher temprature for raspberrypi - kill kodi & fbi along - copied from raspberrypi forum
# This script reads the Broadcom SoC temperature value and shuts down if it
# exceeds a particular value.
# 80ºC is the maximum allowed for a Raspberry Pi.
# Get the reading from the sensor and strip the non-number parts
SENSOR="`/opt/vc/bin/vcgencmd measure_temp | cut -d "=" -f2 | cut -d "'" -f1`"
# -gt only deals with whole numbers, so round it.
TEMP="`/usr/bin/printf "%.0f\n" ${SENSOR}`"
# How hot will we allow the SoC to get?
palaniraja /
Last active Oct 26, 2019
Bash script to merge all mp4 videos in current directory (recursively 2 levels). It also updates the chapter marks to retain the folder/filename of source dir
## Script to merge all mp4 videos in current directory (recursively 2 levels)
## And update chapter marks to retain the folder/filename
## Script for merging videos
filename=`basename pwd`
palaniraja / camera-lens.xml
Created Jun 14, 2018
My Canon SLR lens - optics info from lensfun
View camera-lens.xml
<model>Canon EF-S 18-55mm f/3.5-5.6 IS II</model>
<mount>Canon EF-S</mount>
<!-- Average crop factor of Canon APS-C cameras -->
<distortion model="ptlens" focal="18" a="0.02504" b="-0.06883" c="0.01502"/>
<distortion model="ptlens" focal="24" a="0.0203" b="-0.06514" c="0.04768"/>
palaniraja /
Last active Jun 11, 2018
Raspberry Pi - Automount - usb drives using usbmount - and share drives via samba

Installation of packages

sudo apt-get install usbmount
sudo apt-get install samba samba-common-bin
sudo apt-get install ntfs-3g

Setup Samba


Did not work for me with raspberry pi


ACTION=="add", KERNEL=="sd[a-z][0-9]", TAG+="systemd", ENV{SYSTEMD_WANTS}="usbstick-handler@%k"


palaniraja / medium-declutter
Created May 14, 2018
Medium blog - Declutter bookmarklet
View medium-declutter
palaniraja /
Created May 2, 2018
image magick - image diff in batches
# 62 is the no. of images (1.png ... 62.png in "v1/v2" directory)
for i in $(seq 62 $END); do magick compare ../v1/$i.png ../v2/$i.png diff-$i.png; done
palaniraja /
Last active Mar 3, 2019
Geek tool scripts I use with my desktop
# to list todo's from todotxt file - refersh every 900 sec
cat /Users/palaniraja/Dropbox/Personal/orgmode/todo.txt | grep -v ^x\ | cut -c 12- | awk '{print "* " $0}'
# calendar events - next 5 days grouped by date - refresh every 1800 sec
/usr/local/bin/icalbuddy -nc -sd eventsToday+5
# previous month - refersh every 3600 sec
cal `date -v -1m "+%m %Y"`
palaniraja / fuelprice.rss.output.txt
Last active Jan 21, 2018
Chennai - Fuel price - 2017-06-30 - 2018-01-21
View fuelprice.rss.output.txt
* Notes:
* - First line price
* - Second line date
* - Price of both Petrol & Diesel for the day. Higher amount is Petrol price.
* Data were taken from:, it offers only limited history.
Chennai Petrol Price today - 74.75 Chennai Petrol Price today - 74.75 -- Delivered by Feed43 service
palaniraja /
Created Dec 16, 2017
Raspberry pi - NAS setup
sudo apt-get update
sudo apt-get install ntfs-3g
sudo apt-get update
sudo mkdir /media/NASDrive
You can’t perform that action at this time.