Skip to content

Instantly share code, notes, and snippets.

View nelsestu's full-sized avatar

Erik Nelsestuen nelsestu

View GitHub Profile
@nelsestu
nelsestu / main.cpp
Created April 2, 2025 16:14 — forked from mongonta0716/main.cpp
M5Stack ModuleLLMで日本語をPC(シリアル通信)から入力し、回答をAquesTalkESP32で読み上げるサンプル。(main.cppのコメントを参照してください。)
/*
* SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD
* SPDX-License-Identifier: MIT
* M5Stack LLM Module で日本語対話。Serial MonitorでBoth BL&CRを設定するとよいです。
* ksasaoさんのバージョンをAquesTalkで喋るようにしたバージョンです。(https://gist.github.com/ksasao/37425d3463013221e7fd0f9ae5ab1c62)
*
* --- セットアップ ---
* 1.プロジェクトにlibフォルダを作成して、そこにAquesTalkESP32のライブラリを解凍してください。(https://www.a-quest.com/download.html#a-etc)
* 2. VSCode+PlatformIOで、srcフォルダにAquesTalkのExampleにある(AquesTalkTTS_M5.cppとAquesTalkTTS.h)をコピーする必要があります。
* 3.SDカード上に"/aq_dic/aqdic_m.bin"が必要です。
@nelsestu
nelsestu / python-with-tcl.rb
Created October 22, 2024 12:40 — forked from iexa/python-with-tcl.rb
MacOS homebrew python 3.8.6 with tcl-tk (properly)
class Python < Formula
desc "Interpreted, interactive, object-oriented programming language"
homepage "https://www.python.org/"
url "https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tar.xz"
sha256 "a9e0b79d27aa056eb9cce8d63a427b5f9bab1465dee3f942dcfdb25a82f4ab8a"
head "https://github.com/python/cpython.git"
license "Python-2.0"
revision 1
bottle do
@nelsestu
nelsestu / create_restore_dmg_macosx.md
Created February 18, 2024 21:56 — forked from disulfidebond/create_restore_dmg_macosx.md
Create or Restore Disk Image in Mac OSX

Overview

This gist details how to create or restore a disk image in Mac OSX. There are three methods that are described: Carbon Copy Cloner, Disk Utility, and CommandLine.

  • Disclaimer:
    • I have no financial incentives to https://bombich.com or Apple.
    • Always make a backup of your data, and make 2 separate backups before trying something new.
    • The following steps have been tested and are a summary of my personal recommendations, but should be used at your own risk.
    • If there is a chance of imminent data loss, contact a professional for assistance, and do not rely on a random person from the Internet for help.

Method 1: Carbon Copy Cloner (CCC)

@nelsestu
nelsestu / submit.md
Created February 15, 2024 06:10 — forked from tanaikech/submit.md
Creating Quizzes in Google Form using Google Forms Service with Google Apps Script

Creating Quizzes in Google Form using Google Forms Service with Google Apps Script

This is a sample script for creating quizzes in Google Form using Google Forms Service with Google Apps Script.

Usage

1. Prepare questions and answers.

@nelsestu
nelsestu / docker-remove-images-by-name.md
Created November 7, 2023 09:02 — forked from zulhfreelancer/docker-remove-images-by-name.md
How to delete Docker images that contains a sub-string inside the name?

docker rmi $(docker images --format '{{.Repository}}:{{.Tag}}' | grep 'imagename')

For example, to delete all images that contains zulh inside the name, run:

docker rmi $(docker images --format '{{.Repository}}:{{.Tag}}' | grep 'zulh')

@nelsestu
nelsestu / JavaTwoWaySSLClient.md
Created November 7, 2023 05:52 — forked from gvisoc/JavaTwoWaySSLClient.md
2-Way SSL: HTTPs Client

What is this

This Gist is about using Client Certificates in Java when making HTTPs calls with plain Java code (java(x).net, no other frameworks) in a 2-way SSL context, that is: the Server trusts and uses a Client Public Key to establish the secure connection. The example is a Java runnable class for a Client that uses a Certificate to establish a Two Way SSL communication with a Server.

Disclaimer: this gist reflects my understanding, and is not necessarily 100% accurate. Feedback is appreciated.

Context

For this to work, the Client certificate has to be issued by a CA (Certification Authority) trusted by the Server, the same way that the Client has to trust the CA of the Server. In Java, "trust a CA" means having that CA stored in an encrypted file called "trust store" accessible from our code by the use of a password and the appropriate security SDK provided by the JDK.

How to store that trust stores' passwords securely in our enviroments is another story.

@nelsestu
nelsestu / quick-actions-finder-macos-big-sur.md
Created October 23, 2023 17:39 — forked from aamnah/quick-actions-finder-macos-big-sur.md
Add Quick Actions to Finde in macOS Big Sur to open a folder in VS Code
  • Open Automator
  • Choose Quick Action as the document type
  • Change Workflow receives current to files or folders in Finder.app
  • For Action, choose Open Finder items from the left hand sidebar
  • Change Open with to Visual Studio Code.app (find it in Other... )
  • For the Icon, change Image to "Choose..." and select the Visual Stuido Code app. It'll automatically pick the icon
  • Save it (Cmd+S) as something like "Open in VS Code"
@nelsestu
nelsestu / win10-starter.ps1
Last active August 21, 2023 07:15
Boxstarter script that installs a bunch of things that are fundamental to the windows machine i am creating
# https://boxstarter.org/creatingpackages
# install boxstarter and then run the following to invoke this package:
# Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/nelsestu/8d70e16f57c555a8fc225f1135442561/raw/b068720e9a3a17776ce513a6ffcb6acbe9a1c425/win10-starter.ps1
Update-ExecutionPolicy Unrestricted
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Set-TaskbarSmall
Enable-RemoteDeskto
choco install 7zip.portable
choco install anki
choco install arduino
@nelsestu
nelsestu / linux startup sounds.md
Created August 18, 2023 04:53 — forked from forksofpower/linux startup sounds.md
startup sounds in linux

How to add startup sound to linux

I use this implementation on my RuneAudio player to play a sound when the raspberry pi is powered on.

  1. Place your audio file in /var/local/

    cp startupsound.mp3 /var/local/
  2. Create /usr/bin/startupsound.sh with these contents:

@nelsestu
nelsestu / nextcloud.conf
Created August 6, 2023 06:04 — forked from xxblx/nextcloud.conf
nextcloud nginx config
upstream php-handler {
server unix:/run/php-fpm/www.sock;
}
server {
#listen 443 ssl;
listen 80;
server_name 192.168.1.8;
#ssl_certificate /etc/ssl/nginx/cloud.example.com.crt;