Skip to content

Instantly share code, notes, and snippets.

View frectonz's full-sized avatar
❄️

Fraol Lemecha frectonz

❄️
View GitHub Profile
@frectonz
frectonz / safaricom-mx0268-router-api.md
Created May 12, 2026 14:59
Use this skill to talk to the Safaricom MX0268 mobile router (marketed as "Safaricom Kimem MIFI", hardware is a ZTE M30S Pro). Covers login, reading state, listing connected devices, sending SMS, navigating USSD menus, the protocol's quirks, and a security model overview. Trigger when the user mentions a router admin panel at 192.168.0.1 / Serve…
name safaricom-mx0268-router-api
description Use this skill to talk to the Safaricom MX0268 mobile router (marketed as "Safaricom Kimem MIFI", hardware is a ZTE M30S Pro). Covers login, reading state, listing connected devices, sending SMS, navigating USSD menus, the protocol's quirks, and a security model overview. Trigger when the user mentions a router admin panel at 192.168.0.1 / Server header "Demo-Webs", or asks about endpoints `/reqproc/proc_get` / `/reqproc/proc_post`, or goformId values like LOGIN / SEND_SMS / USSD_PROCESS, or device names "Kimem" or "M30S Pro".

Safaricom MX0268 Router API

A field-tested guide to the HTTP API behind the Vue admin panel of the Safaricom MX0268 (marketed as the "Safaricom Kimem MIFI", hardware is a ZTE M30S Pro) running the "Demo-Webs" embedded HTTP server. The firmware identifies itself via cmd=cr_version as CPE_M30SPRO_... and via tz_customer_code as MX0268. Everything below was reverse-engineered from the unpacked SPA bundle and verified agains

import System.Random
import Data.String
record Game where
constructor MkGame
answer : Nat
tries : Nat
Show Game where
show (MkGame answer tries) = "Game (answer = \{show answer}, tries = \{show tries})"
@nthnd
nthnd / Cargo.toml
Last active February 11, 2024 17:18
Using Axum, HTMX, and DisplayDoc
[package]
name = "billion-dollar-idea"
version = "0.1.0"
edition = "2021"
[dependencies]
axum = { version = "0.7.4", features = ["macros", "form"] }
displaydoc = "0.2.4"
serde = { version = "1.0.196", features = ["derive"] }
tokio = { version = "1.36.0", features = ["full"] }
@cgsdev0
cgsdev0 / house_builder.sh
Created February 3, 2024 16:07
house builder pattern in bash
#!/usr/bin/env bash
function house_builder() {
# floors,rooms,has_garage
echo "0,0,0"
}
function set_field() {
local f r g
IFS=, read f r g
@charbelrami
charbelrami / elm-grammar.ebnf
Created January 26, 2024 13:41
Elm EBNF grammar
program = [ comment ], [ "port" ], "module", module_name, "exposing", "(", exposed_list, ")", { import_statement }, { declaration }, { comment };
module_name = identifier, { ".", identifier }, [ comment ];
exposed_list = identifier | "(", identifier, { ",", identifier }, ")", [ comment ] | "..";
import_statement = "import", module_name, [ import_alias ], [ "exposing", "(", exposed_list, ")" ], [ comment ];
import_alias = "as", identifier, [ comment ];
declaration = type_declaration
| type_alias_declaration
@omer-biz
omer-biz / Main.elm
Last active January 9, 2024 18:43
I implemented this after wathing this talk (https://www.youtube.com/watch?v=IcgmSRJHu_8), It's about making an impossible states impossible. Don't forget to do `elm install elm/time`
module Main exposing (main)
import Browser
import Html exposing (Html, button, div, input, text)
import Html.Attributes exposing (value)
import Html.Events exposing (onClick, onInput)
import Time
type alias Question =

Mara's statement on the retraction of ThePhd's RustConf keynote

I was one of the people who didn't vote for ThePhd's keynote; originally because I simply preferred another promising candidate. Later, after hearing technical concerns from an expert that I mostly agreed with, also because of the topic, although I must admit I am no expert on the topic.

The candidate I voted for originally got a few approving comments at first, but ended up being mostly ignored later, mostly because of our lack of process and proper voting.

When it was brought up in the leadership chat that 'there are concerns', I focused on the talk itself rather than focusing on the process failure. That was a mistake, for which I apologize. I am not an expert on this topic, and should not have rushed myself into talking about things outside my expertise, even under pressure.

In another situation this could have been a minor mistake with no consequences, just one of several opinions in a discussion, but in this situation it became part

@frectonz
frectonz / scramble.ts
Last active March 6, 2023 14:23
From cassido's March 6, 2023 Newsletter
function scramble(sentences: string[]): string {
return sentences
.map((sentence) =>
sentence
.split(" ")
.map((word) => {
if (word.length <= 3) {
return word;
}
@frectonz
frectonz / repeated_groups.rs
Last active February 27, 2023 21:10
From cassido's February 27, 2023 Newsletter
pub fn repeated_groups(numbers: &[u32]) -> Vec<Vec<u32>> {
numbers
.iter()
.fold::<Vec<Vec<u32>>, _>(vec![], |mut acc, &n| {
if let Some(last) = acc.last_mut() {
if last[0] == n {
last.push(n);
} else {
acc.push(vec![n]);
}
@frectonz
frectonz / missingBits.go
Last active January 23, 2023 16:13
From cassido's January 23, 2023 Newsletter
package main
import (
"fmt"
"strconv"
)
func main() {
val1 := missingBits([]int{1, 2, 3, 4, 20, 21, 22, 23})
fmt.Println(val1)