Skip to content

Instantly share code, notes, and snippets.

View Bonemind's full-sized avatar

Subhi Dweik Bonemind

View GitHub Profile
@Bonemind
Bonemind / config.toml
Created September 30, 2022 10:20
Influxdb 2.4 toml config options
#Override the default InfluxDB user interface (UI) assets by serving assets from the specified directory. Typically, InfluxData internal use only.
# assets-path = "/path/to/custom/assets-dir"
#Path to the BoltDB database. BoltDB is a key value store written in Go. InfluxDB uses BoltDB to store data including organization and user information, UI data, REST resources, and other key value data.
#bolt-path = "~/.influxdbv2/influxd.bolt"
#Add a /debug/flush endpoint to the InfluxDB HTTP API to clear stores. InfluxData uses this endpoint in end-to-end testing.
#e2e-testing = true
@Bonemind
Bonemind / f1signalr.js
Created July 25, 2022 10:47
F1 telemetry signalr websocket connection
// npm i axios signalr
const axios = require('axios');
const ws = require('ws');
async function negotiate() {
const hub = encodeURIComponent(JSON.stringify([{name:"Streaming"}]));
const url = `https://livetiming.formula1.com/signalr/negotiate?connectionData=${hub}&clientProtocol=1.5`
const resp = await axios.get(url);
return resp;
}

Keybase proof

I hereby claim:

  • I am bonemind on github.
  • I am subhidweik (https://keybase.io/subhidweik) on keybase.
  • I have a public key ASDSqc6rzkebFi5wvjpXqxURwqvAoD7bfBL5n9LuMlnxcgo

To claim this, I am signing this object:

address-service > [email protected] start:prod /app │
│ address-service > node -r ./paths.js dist/main │
│ address-service internal/modules/cjs/loader.js:968 │
│ address-service throw err; │
│ address-service ^
@Bonemind
Bonemind / remove_bt_devices.ps
Created April 13, 2020 14:48
Script to delete bluetooth devices in windows 10 that fail to delete using the normal way. Found on: https://www.tenforums.com/drivers-hardware/22049-how-completely-remove-bluetooth-device-win-10-a-3.html
$Source = @"
[DllImport("BluetoothAPIs.dll", SetLastError = true, CallingConvention = CallingConvention.StdCall)]
[return: MarshalAs(UnmanagedType.U4)]
static extern UInt32 BluetoothRemoveDevice(IntPtr pAddress);
public static UInt32 Unpair(UInt64 BTAddress) {
GCHandle pinnedAddr = GCHandle.Alloc(BTAddress, GCHandleType.Pinned);
IntPtr pAddress = pinnedAddr.AddrOfPinnedObject();
UInt32 result = BluetoothRemoveDevice(pAddress);
async function thro(res, rej) {
return await new Promise((a,b) => { b('ajk') });
}
async function callthing2() {
try {
await new Promise(thro);
} catch(e) {
console.log('caught');
}
}
@Bonemind
Bonemind / aws.endpoints.js
Created August 27, 2019 11:10
AWS sdk localstack endpoint overrides for nodejs
const AWS = require('aws-sdk');
debugger; // May need this here so the debugger attaches properly
if (process.env.ENVIRONMENT === 'local') {
console.log('Using localstack endpoints for AWS');
AWS.config.apigateway = { endpoint: 'http://localhost:4567' };
AWS.config.kinesis = { endpoint: 'http://localhost:4568' };
AWS.config.dynamodb = { endpoint: 'http://localhost:4569' };
AWS.config.dynamodbstreams = { endpoint: 'http://localhost:4570' };
AWS.config.s3 = { endpoint: 'http://localhost:4572' };
require "json"
class Test
exclude_names = ["to_json"]
def initialize
@testv = 10
@testvb = 10
end
def testf()
puts "testf"
@Bonemind
Bonemind / docker-compose.yml
Created March 9, 2017 10:56
docker-compose letsencrypt-nginx-proxy-companion with example site
# Proxy docker-compose.yml
version: "2"
services:
nginx:
image: nginx
container_name: nginx
ports:
- "80:80"
- "443:443"
@Bonemind
Bonemind / Generic gruntfile
Last active August 29, 2015 14:01
A generic gruntfile for compiling webapps
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
concat: {
js: {
src: [
"models/**/*.js",
"collections/**/*.js",
"controllers/**/*.js",