Skip to content

Instantly share code, notes, and snippets.


Kosso kosso

View GitHub Profile
kosso / elasticsearch_7.4.0_on_RPi4
Created August 8, 2021 22:09
Setting up ElasticSearch 7.4.0 on a Raspberry Pi 4
View elasticsearch_7.4.0_on_RPi4
Setting up ElasticSearch 7.4.0 on Raspberry Pi 4
sudo apt-get install default-jre
sudo nano /etc/profile
export JAVA_HOME=/usr/lib/jvm/default-java export PATH=$JAVA_HOME/bin:$PATH
sudo reboot
kosso / INDYZAP
Last active November 19, 2019 11:08
javascript:(function(){function R(w){try{var d=w.document,j,i,t,T,N,b,r=1,C;for(j=0;t=["video","amp-brightcove","figure","object","embed","applet","iframe"][j];++j){T=d.getElementsByTagName(t);for(i=T.length-1;(i+1)&&(N=T[i]);--i)if(j!=3||!R((C=N.contentWindow)?C:N.contentDocument.defaultView)){b=d.createElement("div");;;b.innerHTML="<del>"+(j==3?"third-party "+t:t)+"</del>";N.parentNode.replaceChild(b,N);}}}catch(E){r=0}return r}R(self);var i,x;for(i=0;x=frames[i];++i)R(x)})()
Copy the line of code above and and set it to the URL value of a browser bookmark.
It should remove the annoying video at the top of the articles when you click it (not automatic).
View gist:9dc9df367f68f1d7ebbca07ee6e20683
// see:
function toUTF16(codePoint) {
var TEN_BITS = parseInt('1111111111', 2);
function u(codeUnit) {
return '\\u'+codeUnit.toString(16).toUpperCase();
if (codePoint <= 0xFFFF) {
return u(codePoint);
kosso / index.php
Created October 17, 2019 16:19
Proxy script for Shoutcast audio streams.
View index.php
// Proxy script for Shoutcast audio streams.
// Overcomes the CORS issue when using JavaScript to fetch streams for playback and analysis.
// Also http > https
// .htaccess file
// eg: index.php and .htaccess in /radio on your host.
// Point JS/fetch to https://yourhost/radio/audio.mp3 (or any made-up .mp3 name)
kosso / manifest.plist example
Last active June 15, 2019 13:03
Special file for self-hosting internal .ipa installers
View manifest.plist example
On a web page, you can then use a link like this to start the download/install process:
<a href="itms-services://?action=download-manifest&amp;url=https://[YOUR_SECURE_URL_TO]/manifest.plist"> INSTALL THE APP </a>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
kosso / RollerLEDWand.ino
Created November 25, 2018 17:26
Initial PoC sketch to 'write' words with LEDs while rolling a rotary encoder.
View RollerLEDWand.ino
#include <Encoder.h>
Encoder myEnc(12, 13);
#define ENC_SW 14 // Encoder Switch
long newapos = 0;
long lastapos = 0;
unsigned char words[]={
View ti_identity_example.js
var Identity = require('ti.identity');
var my_identifier = 'my-device-udid';
// use:
getAppUDID(my_identifier, function(data){
console.log('getAppUDID: ', data);
function getAppUDID(identifier, callback){
kosso / websocket-relay-secure.js
Created September 2, 2018 16:04
websocket-relay.js from JSMpeg slightly modified to use HTTPS instead of HTTP
View websocket-relay-secure.js
// Use the websocket-relay to serve a raw MPEG-TS over WebSockets. You can use
// ffmpeg to feed the relay. ffmpeg -> websocket-relay -> browser
// Example:
// node websocket-relay yoursecret 8081 8082
// ffmpeg -i <some input> -f mpegts https://localhost:8081/yoursecret
var fs = require('fs'),
https = require('https'),
WebSocket = require('ws');
View ESP32_multiple_timers_experiment.ino
orginal code via:
* Copyright (c) 2017 pcbreflux. All Rights Reserved.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
* This program is distributed in the hope that it will be useful, but
kosso / ESP32_timers_pulses_experiment.ino
Created March 24, 2018 15:16
Experimental code to use two timers to create and control two fast pulses for eventual use with stepper motor drivers.
View ESP32_timers_pulses_experiment.ino
// Trying and dynamically set, start and stop the timers.
// so we can set the pulse delay at that point, rather than within the timer ISR
#include <Arduino.h>
// ESP32 Registers
// Serial Tests and Timers
// type '1go' or '2go' in Serial monitor to start 10us timer counter.