Skip to content

Instantly share code, notes, and snippets.

View deepanprabhu's full-sized avatar
🎯
Focusing

Deepan deepanprabhu

🎯
Focusing
View GitHub Profile
@deepanprabhu
deepanprabhu / txt
Created April 17, 2022 20:15
libvips quick clis
$ i=0
$ while vips copy x.tif[page=$i] y$i.tif; do ((i++)); done
tiff2vips: TIFF does not contain page 5
$ ls
x.tif y0.tif y1.tif y2.tif y3.tif y4.tif
Make a single jpeg with all pages
vips copy "a.pdf[n=-1]" a.jpg
@deepanprabhu
deepanprabhu / gist:fbb406c3432c19eafe78a4b44e6a4b23
Created October 30, 2017 23:23
Concise Recursive DynamoDB Scan - Large Table - Using ExclusiveStartKey and LastEvaluatedKey - NodeJS
let params = {
TableName: 'xxx',
Limit: 50 // Configure based on needs
};
let aItems = [];
const recursiveScan = (params) => {
return client.scan(params).promise().then((data) => {
// Simple Changes to input, optional
let newItems = data.Items.map((item) => {
return item;
@deepanprabhu
deepanprabhu / default
Created June 5, 2017 17:54
Nginx - Serving two sites, simultaneously - One is Codeigniter, another is bare php - don't forget to edit /etc/hosts
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.