Skip to content

Instantly share code, notes, and snippets.

View rithvikvibhu's full-sized avatar

Rithvik Vibhu rithvikvibhu

View GitHub Profile
@rithvikvibhu
rithvikvibhu / index.js
Created January 15, 2017 10:44
Feathers socket auth
import React, { Component, AsyncStorage } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Router, Scene } from 'react-native-router-flux';
import hooks from 'feathers-hooks';
import feathers from 'feathers/client';
import socketio from 'feathers-socketio/client';
import localstorage from 'feathers-localstorage';
import authentication from 'feathers-authentication-client';
@rithvikvibhu
rithvikvibhu / app.js
Created January 16, 2017 14:41
Feathers socket auth - Server side
const path = require('path');
const serveStatic = require('feathers').static;
const favicon = require('serve-favicon');
const compress = require('compression');
const cors = require('cors');
const feathers = require('feathers');
const configuration = require('feathers-configuration');
const hooks = require('feathers-hooks');
const rest = require('feathers-rest');
const bodyParser = require('body-parser');
@rithvikvibhu
rithvikvibhu / server-log
Created January 16, 2017 14:52
Feathers server debug log
socket.io-parser decoded 22["foods::get","5877783b2aa1cc1c04a0c1e3",{}] as {"type":2,"nsp":"/","id":2,"data":["foods::get","5877783b2aa1cc1c04a0c1e3",{}]} +47ms
socket.io:socket got packet {"type":2,"nsp":"/","id":2,"data":["foods::get","5877783b2aa1cc1c04a0c1e3",{}]} +48ms
socket.io:socket emitting event ["foods::get","5877783b2aa1cc1c04a0c1e3",{}] +0ms
socket.io:socket attaching ack callback to event +0ms
socket.io:socket dispatching an event ["foods::get","5877783b2aa1cc1c04a0c1e3",{},null] +0ms
feathers-socket-commons:methods Got 'foods::get' event with connection +0ms { provider: 'socketio',
user:
{ email: 'a@a.aa',
password: '$2a$10$5zufdjXThNFf38k..s/x8unwuciO/EJP2fet0VAy6erO9ulptBB62',
_id: 'Ws2fg5IzolYDKgJc' },

Keybase proof

I hereby claim:

  • I am rithvikvibhu on github.
  • I am rithvikvibhu (https://keybase.io/rithvikvibhu) on keybase.
  • I have a public key whose fingerprint is 0393 D763 6C08 EFA8 A781 F9CD E851 01DF 1682 E27F

To claim this, I am signing this object:

@rithvikvibhu
rithvikvibhu / entrarcanteen.js
Created January 14, 2018 07:32
Greasemonkey script to inject link into Entrar
// ==UserScript==
// @name DPS Canteen for Entrar
// @version 1
// @include https://entrar.in/*
// @grant none
// ==/UserScript==
// Get admission number
var admid = document.getElementById("welcome-user").innerText.split('\n')[2].replace('/', '')
@rithvikvibhu
rithvikvibhu / README.md
Last active April 12, 2024 15:32
GHLocalApi Update

GHLocalApi Update

The Gist

Until recently, the Google Home app used to communicate with the device over port 8008 (HTTP) and did not require any authentication. Everything in the unofficial documentation worked as expected.

A few days (weeks) ago, Google pushed a new update to all GH devices and all endpoints (except /setup/eureka_info) started returning 403 (forbidden) errors. The app had switched over to port 8443 and HTTPS.

@rithvikvibhu
rithvikvibhu / LICENSE
Last active October 28, 2024 11:09
Get tokens for Google Home Foyer API
MIT License
Copyright (c) 2020 Rithvik Vibhu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@rithvikvibhu
rithvikvibhu / create-open-bid-reveal.js
Created August 27, 2021 18:58
Pre-signed OPEN, BID, REVEAL transactions
/**
* Generate pre-signed OPEN, BID, REVEAL transactions
*
* TX 1 (immediately broadcast):
* 1 (or more) coin (100 HNS) -----> OPEN name/ (0 HNS)
* \----> addr2 (lockup value = 70.1)
* \----> change (29.9 HNS - fee)
*
* TX 2 (broadcast in BIDDING period):
* addr2 (70.1 HNS) -----> BID name/ (70)
These nodes have been online on both 1st June 2022 and 9th June 2022 and are likely to stay online for a longer time:
107.152.32.250
107.152.33.71
129.153.177.220
129.213.167.123
138.197.52.107
139.59.211.187
140.238.196.136
142.132.235.25
// Based on: https://gist.github.com/pinheadmz/b51a6ee3c1b414bd7d053951b83f6162
// USAGE: hsd --log-console=false --plugins=/path/to/this/file/shakedex-scan-plugin.js
'use strict';
const layout = require('hsd/lib/blockchain/layout');
const TXMeta = require('hsd/lib/primitives/txmeta');
const { LOCKTIME_FLAG } = require('hsd/lib/protocol/consensus');