Skip to content

Instantly share code, notes, and snippets.

View jmathai's full-sized avatar

Jaisen Mathai jmathai

View GitHub Profile
@jmathai
jmathai / SmartTV.txt
Last active July 1, 2023 07:45
NextDNS Smart TV Denylist
# Title: Smart-TV Blocklist for Pi-hole
# Version: 15December2021v1
# Description: This is a blocklist to block smart-TVs sending metadata back home, sometimes with the added benefit of blocking interface ads for apps and movie services.
# Please help with collecting domains!
# It could occur that the TV fails to receive new updates, or that other apps or services no longer work. Please report such an incident.
# Make sure to also use the extra RegEx list at https://perflyst.github.io/PiHoleBlocklist/regex.list, which helps remove regional LG ad domains among other things.
# Panasonic Viera & panny tv
0077777700140002.myhomescreen.tv
cert-test.sandbox.google.com
@jmathai
jmathai / Elodie-On-Synology.md
Last active September 30, 2021 16:38
Getting Elodie running on a Synology
@jmathai
jmathai / app.js
Created February 20, 2019 08:11 — forked from rfletcher/app.js
A simple bridge between iMessage and Home Assistant's conversation component
const HomeAssistant = require( 'homeassistant' );
const Pino = require( 'pino' );
const config = require( 'config' );
const hass = new HomeAssistant( config.get( 'home_assistant' ) );
const imessage = require( 'osa-imessage' );
const logger = Pino();
// TODO package this better
const bridge = {
#!/bin/bash
# Ease staging of files
for i in $(git status | grep -A 10000 "not updated" | grep modified) ; do
if [ -f $i ] ; then
git diff $i;
echo -n "Add this to stage? [y/n]: ";
read ans;
if [ "$ans" == "y" ] ; then
@jmathai
jmathai / function.php
Created February 4, 2011 16:19
function.php
<?php
/*
* This is a sample function that guarantees unique URLs for frontend assets.
* Images for example.
* Include this and your users will never re-download an asset they already
* have just just because you push a new build.
* If including this in your stylesheet then you should set this up in you
* should be using something like Amazon Cloud Front to cache a static
* version of it.
*/
@jmathai
jmathai / joule-node-dynamic-dns.js
Created April 5, 2016 05:28
The source code for joule-node-dynamic-dns; a dynamic DNS Joule for AWS Lambda.
/**
* This Joule is a serverless dynamic DNS system using Lambda and Route53.
*/
// We have to require the aws-sdk and immediately set the credentials.
// If we instantiate the Route53 object first then it assumes the role assigned to the lambda function.
var AWS = require('aws-sdk');
if(process.env.AWS_KEY !== '' && process.env.AWS_SECRET !== '') {
AWS.config.update({accessKeyId: process.env.AWS_KEY, secretAccessKey: process.env.AWS_SECRET});
}
# username = your Joule username
# joule_name = the name of your Joule (probably joule-node-dynamic-dns)
# test.example.com. = the domain you'd like to use for DDNS (with a trailing .)
# a_secret_you_chose = the string you chose as your secret for your Joule
./client.sh username joule_name test.example.com. a_secret_you_chose
# Output if IP address hasn't changed
# {"status": "success", "message": "No change in IP address detected."}
#
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1458757563000",
"Effect": "Allow",
"Action": [
"route53:ChangeResourceRecordSets",
"route53:ListHostedZones"
],
git clone https://github.com/joulehq/joule-node-boilerplate.git
cd joule-node-boilerplate/src
cp events.json-sample events.json
npm i
npm test
> joule-boilerplate@0.0.1 test /Users/jaisenmathai/joule-node-boilerplate/src
> node ./node_modules/joule-node-local/index.js
{ headers: { Status: '200 OK', 'Content-Type': 'application/json' },
var Response = require('joule-node-response');
exports.handler = function(event, context) {
var response = new Response();
response.setContext(context);
var name = event.name || 'World';
var greeting = 'Hello, ' + name + '.';
var result = {
"message": greeting