Skip to content

Instantly share code, notes, and snippets.

@passcod
passcod / create-hotspot.md
Created November 25, 2024 01:55 — forked from narate/create-hotspot.md
Create Wi-Fi Hotspot on Linux using nmcli

Create a Wi-Fi hotspot on Linux using nmcli

Original post : https://unix.stackexchange.com/a/310699

nmcli con add type wifi ifname wlan0 con-name Hostspot autoconnect yes ssid Hostspot
nmcli con modify Hostspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli con modify Hostspot wifi-sec.key-mgmt wpa-psk
nmcli con modify Hostspot wifi-sec.psk "veryveryhardpassword1234"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
//! Parse ini with deku
//!
//! You need this https://github.com/sharksforarms/deku/pull/387 branch of deku for it to work.
//!
//! See https://twitter.com/passcod/status/1743186223940935754
use deku::prelude::*;
use std::fs::read_to_string;
fn main() {
/* ==UserStyle==
@name tweetdeck.twitter.com - 20/08/2023, 1:05:42 am
@namespace github.com/openstyles/stylus
@version 1.0.0
@description A new userstyle
@author Me
==/UserStyle== */
@-moz-document domain("tweetdeck.twitter.com") {
/* new tweet sidebar, minimised unless hovered */
/* ==UserStyle==
@name Twitter.com reorder stats
@namespace github.com/openstyles/stylus
@version 1.0.0
@description Moves the new stats button after the regular stuff.
@author passcod
==/UserStyle== */
@-moz-document url-prefix("twitter.com/home") {
article [role="group"] > :nth-child(1) {
@passcod
passcod / ble.rs
Last active November 6, 2022 11:12
Xiaomi Mi Scale 2 BLE Advertisement decode (service 0x181D) and ESPHome config
fn main() {
vec![
// real data
[0xa2, 0x0c, 0x49, 0xe6, 0x07, 0x0b, 0x06, 0x01, 0x16, 0x00], // start
[0x02, 0x0c, 0x49, 0xe6, 0x07, 0x0b, 0x06, 0x01, 0x20, 0x26], // load
[0x22, 0x0c, 0x49, 0xe6, 0x07, 0x0b, 0x06, 0x01, 0x20, 0x26], // stable
[0xa2, 0x0c, 0x49, 0xe6, 0x07, 0x0b, 0x06, 0x01, 0x20, 0x2a], // idle
]
.into_iter()
.map(decode)
@passcod
passcod / data.json
Created December 21, 2021 12:46
Rustc error categories
{"E0004":"mir_build","E0005":"mir_build","E0010":"const_eval","E0013":"const_eval","E0015":"const_eval","E0023":"typeck","E0025":"typeck","E0026":"typeck","E0027":"typeck","E0029":"typeck","E0030":"mir_build","E0033":"typeck","E0034":"typeck","E0038":"trait_selection","E0040":"typeck","E0044":"typeck","E0045":"typeck","E0046":"typeck","E0049":"typeck","E0050":"typeck","E0053":"typeck","E0054":"typeck","E0055":"trait_selection","E0057":"typeck","E0059":"typeck","E0060":"typeck","E0061":"typeck","E0062":"typeck","E0063":"typeck","E0067":"typeck","E0069":"typeck","E0070":"typeck","E0071":"typeck","E0072":"trait_selection","E0075":"typeck","E0076":"typeck","E0077":"typeck","E0080":"middle","E0081":"typeck","E0084":"typeck","E0091":"typeck","E0092":"typeck","E0093":"typeck","E0094":"typeck","E0106":"typeck","E0107":"typeck","E0109":"typeck","E0116":"typeck","E0117":"typeck","E0118":"typeck","E0119":"trait_selection","E0120":"typeck","E0121":"typeck","E0124":"typeck","E0128":"resolve","E0130":"ast_passes","E0131":"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@passcod
passcod / hug.md
Last active October 6, 2021 17:11
HUG language

HUG

A function call syntax for KDL.

HUG is several things:

  • A strict KDL superset: all KDL is valid HUG.
@passcod
passcod / Corefile
Created June 23, 2021 14:12
Coredns with one local-only zone
your.zone.tld {
ready
cancel
loop
log
loadbalance round_robin
auto {
directory /local/zones (.*) {1}
}