Skip to content

Instantly share code, notes, and snippets.

View garronej's full-sized avatar
🧢
Bluehat

Joseph Garrone garronej

🧢
Bluehat
View GitHub Profile
import { Evt } from "evt";
import { DongleController as Dc } from "chan-dongle-extended-client";
import { Ami, agi } from "ts-ami";
//import * as dcMisc from "chan-dongle-extended-client/dist/lib/misc";
import { phoneNumber } from "phone-number";
import * as types from "./types";
import * as dbSemasim from "./dbSemasim";
import * as messageDispatcher from "./messagesDispatcher";
import * as sip from "ts-sip";
import { logger } from "../tools/logger";
@garronej
garronej / bootstrap.css
Last active April 10, 2023 22:25
Static web assets semasim
/*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
@garronej
garronej / resilio.txt
Last active August 4, 2022 19:43
Install resilio-sync on raspberry pi
mkdir /var/lib/resilio-sync/ && chown pi:pi -R /var/lib/resilio-sync
mkdir /etc/resilio-sync
nano /etc/resilio-sync/config.json
{
"storage_path" : "/var/lib/resilio-sync/",
"pid_file" : "/var/run/resilio-sync/sync.pid",
"webui" :
@garronej
garronej / dummy_display_patch.app
Last active September 1, 2021 00:27
Fix intel hd graphics, image become messy half way during the boot screen with apple logo.
#!/bin/bash
cscreen -d 32 -x 1600 -y 900 -r 60
sleep 1
cscreen -d 32 -x 1920 -y 1080
@garronej
garronej / install_speex.txt
Last active May 30, 2021 10:45
Install speex and speexdsp
aptitude remove libspeex-dev libspeexdsp-dev libspeex1
rm /usr/lib/arm-linux-gnueabihf/libspeex*
use prefix: /usr
Install:
https://github.com/xiph/speexdsp
Install:
@garronej
garronej / .env.local
Last active March 18, 2021 21:29
onyxia-ui environnement variables
REACT_APP_WARNING_MESSAGE="**Vendredi 29 janvier**, session kubernetes pour le statisticien sur zoom. Plus d info sur [le canal tchap](https://www.tchap.gouv.fr/#/room/#SSPCloudXDpAw6v:agent.finances.tchap.gouv.fr)"
REACT_APP_INFO_MESSAGE="**NOUVEAU** Interface de gestion des variables d'environnement. Découvrez la page [Mes Secrets](/mes-secrets) 🚀"
REACT_APP_BASE_API_URL=https://onyxia-preview.lab.sspcloud.fr/api
REACT_APP_SERVICES_URL=https://innovation.pages.lab.sspcloud.fr/plateforme-onyxia/services-ressources/services.json
REACT_APP_TRAININGS_URL=https://innovation.pages.lab.sspcloud.fr/plateforme-onyxia/services-ressources/formations.json
REACT_APP_MONITORING_BASE_URI="https://grafana.lab.sspcloud.fr/d/mZUaipcmk/app-generique?orgId=1&var-id="
# MINIO
REACT_APP_MINIO_BASE_URI=https://minio.lab.sspcloud.fr
@garronej
garronej / safe_typescript_type_casting.ts
Last active June 27, 2020 16:05
How to do safe type casting with TypeScript
type Shape = Shape.Circle | Shape.Square;
namespace Shape {
export type Circle = {
type: "CIRCLE";
radius: number;
};
export type Square = {
@garronej
garronej / visa_booking_watcher.ts
Last active June 5, 2020 18:08
A script that watches when visa registration are open. Set up for www.herault.gouv.fr/booking but can be adapted.
/*
* Prerequisite:
* You will need a supported Huawei 3G dongle:
* https://github.com/bg111/asterisk-chan-dongle/wiki/Requirements-and-Limitations
*
* You also have to install chan-dongle-extended.
* https://garronej.github.io/chan-dongle-extended-pages/
* This tool of mine enable to send SMS via a CLI.
*
* You then need to run this script on something like a raspberry pi

Setup Orange PI PC with debian + linux headers

  • Download armbian https://dl.armbian.com/orangepipc/archive/Armbian_5.69_Orangepipc_Debian_stretch_next_4.19.13.7z
    we need to download a version for wich we know we have the linux headers in the depos. 4.19.13 is such a version.
    If the link is dead a copy can be found in garronej/releases.

  • Use BalenaEtcher to flash the image on a micro SD card.

  • The default login is root 1234. When overwriting the root user password and dont forget that the key maping is is not yet configured.

            const typeGuard_= <U extends T, T>(o: T): o is U => true;

            const o: number =33;

            assert(typeGuard_<33, typeof o>(o));

            o; //<= o is 33

            //It would be nice to be able to do: