Skip to content

Instantly share code, notes, and snippets.

View cconstab's full-sized avatar
💻
Coding

Colin Constable cconstab

💻
Coding
  • https://github.com/atsign-foundation
  • Mariposa California
  • X @cconstab
View GitHub Profile
#!/bin/sh
# disable "var is referenced but not assigned" warning for template
# shellcheck disable=SC2154
# Configuration of sshnpd service
# This script is a template for the sshnpd background service.
# You can configure the service by editing the variables below.
# This service file covers the common configuration options for sshnpd.
# To see all available options, run `sshnpd` with no arguments.
@cconstab
cconstab / gist:6257941b5f49dbd42b931733833021f3
Last active February 15, 2024 05:57
Cannot get Microsoft Remote Desktop to talk to localhost ? This is your answer, in PowerShell type
checknetisolation LoopbackExempt -a -n="Microsoft.RemoteDesktop_8wekyb3d8bbwe"
@cconstab
cconstab / gist:11171392833db9a34a6f2da3ebacdc6b
Created July 23, 2023 19:08
Dart FFI libssh with private key auth
import 'dart:ffi';
import 'dart:io';
import 'package:ffi/ffi.dart';
import 'package:libssh_binding/libssh_binding.dart';
import 'dart:ffi' as ffi;
import 'package:path/path.dart' as path;
void main() async {
// Some vars (change to suit)
String remoteFile = "/home/cconstab/testfile";
sequenceDiagram
participant @alicePhone
participant @aliceTablet
participant @aliceSecondary
participant @bobSecondary
participant @bobPhone
@alicePhone ->> @aliceSecondary: lookup:publicKey@bob
@aliceTablet ->> @aliceSecondary: lookup:publicKey@bob
Note left of @alicePhone: AESkey Generated if not available locally<br/> @bobRSApublicKey<br/>used to encrypt<br/>AESkey
Note left of @aliceTablet: AESkey Generated if not available locally<br/> @bobRSApublicKey<br/>used to encrypt<br/>AESkey
@cconstab
cconstab / main.dart
Last active September 15, 2022 00:02
Dart Lang : Extend String to be able to parse "true" | "false" to boolean
void main() {
String trueString = "true";
String falseString = "false";
if (!falseString.parseBool()) { print("falseString is:false");}
if (trueString.parseBool()) { print("trueString is: true");}
}
Get Qemu
https://www.qemu.org/download/
Get ubuntu for risc v5 - I choose ubuntu-20.04.4-preinstalled-server-riscv64+unmatched.img
https://wiki.ubuntu.com/RISC-V
Uncompress with xz and give yourself some more space - I did this using a WSL 2 ubuntu shell as it was easier to use the tools from linux
xz -dk ubuntu-20.04.4-preinstalled-server-riscv64+unmatched.img.xz
qemu-img resize -f raw ubuntu-20.04.4-preinstalled-server-riscv64+unmatched.img + 25G
Now you need some firmware and a kernel for risc V which can be downloaded from here
import 'package:at_lookup/at_lookup.dart';
import 'package:at_onboarding_cli/at_onboarding_cli.dart';
import 'package:at_client/at_client.dart';
import 'package:at_commons/at_commons.dart';
void main() async {
OnboardingService onboardingService = OnboardingService('blackdeath');
await onboardingService.authenticate();
AtLookupImpl atLookup = onboardingService.getAtLookup();
var keys = await atLookup.scan(auth: true);
import 'dart:async';
import 'package:http/http.dart' as http;
import 'dart:convert';
import 'package:flutter/material.dart';
Future<void> main() async {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
@cconstab
cconstab / AI6BH_ic7100.dart
Last active December 10, 2021 19:56
Grab my ic7100 ham radio public information
import 'package:http/http.dart' as http;
import 'dart:convert';
void main() async {
PublicHamRadio hamradio = PublicHamRadio(radioName: 'ic7100');
await lookupRadio('ai6bh','ic7100',hamradio);
print(hamradio.vfoaFrequency);
}
@cconstab
cconstab / Submitting an @platorm app to Play Store and App Store
Last active December 15, 2021 15:06
Store_description_of_getting_an_@sign.md
When submitting to the stores include this description on how to get an @sign so the testers at the store can use your app.
Do not check the box for passwords needed
```
Feel free to get a free @sign for testing.
This can be done from the front screen clicking "SETUP NEW @SIGN" then "GENERATE FREE @SIGN".
Then click "pair", this will ask for an email and then send a code.
Type in the code and save the Key File if you want to reuse the @sign.
```