Skip to content

Instantly share code, notes, and snippets.

View naveenadi's full-sized avatar
🎯
Focusing

Aditya Agarwal naveenadi

🎯
Focusing
View GitHub Profile

Writing a Dice Roller MCP Server in Dart

Let's write a MCP server in Dart. I'd like to make a tool that knows how to roll dice. This way, an LLM can get access to a real source of randomnes.

There's no ready-to-use Dart package, but there's a specification that details how to create such a server.

In its easiest form, the server reads JSON RPC requests from stdin and writes responses to stdout. It is allowed to use stderr for logging. All streams are UTF-8 encoded and adhere to the JSONL format, that is, each request must be a single line.

RPC

GitHub Search Syntax for Finding API Keys/Secrets/Tokens

As a security professional, it is important to conduct a thorough reconnaissance. With the increasing use of APIs nowadays, it has become paramount to keep access tokens and other API-related secrets secure in order to prevent leaks. However, despite technological advances, human error remains a factor, and many developers still unknowingly hardcode their API secrets into source code and commit them to public repositories. GitHub, being a widely popular platform for public code repositories, may inadvertently host such leaked secrets. To help identify these vulnerabilities, I have created a comprehensive search list using powerful search syntax that enables the search of thousands of leaked keys and secrets in a single search.

Search Syntax:

(path:*.{File_extension1} OR path:*.{File_extension-N}) AND ({Keyname1} OR {Keyname-N}) AND (({Signature/pattern1} OR {Signature/pattern-N}) AND ({PlatformTag1} OR {PlatformTag-N}))

Examples:

**1.

#!/usr/bin/swift
// DISCLAIMER
// This script modifies an unencrypted file associated with the trial version of Final Cut Pro.
// Under the DMCA (17 U.S.C. § 1201), this modification does not qualify as circumvention of a technological
// protection measure (TPM), as it does not involve bypassing encryption, authentication, or similar protections.
// Distributing this code is therefore legal under the DMCA.
// This script is intended for educational and research purposes, such as exploring trial-related file structures,
@naveenadi
naveenadi / SSH2FA.markdown
Created March 29, 2025 18:12 — forked from emmakat/SSH2FA.markdown
Hardening SSH access to Github with TouchID

This is a fork of @lizthegrey excellent gist on securing SSH with 2FA but modified to focus on the first steps one can take toward securing ssh access to Github (or other version control systems) with Apple touch ID button. Designed to prevent key theft from the systems we connect to with 2FA, while maintaining ease of use. From the project "If your Mac has a Secure Enclave, it also has support for strong access controls like Touch ID, or authentication with Apple Watch. You can configure your key so that they require Touch ID (or Watch) authentication before they're accessed. If you store your keys in the Secure Enclave, it's impossible to export them, by design."

Mac client setup

Use TouchID to authenticate logins to GitHub! Since sekey is no longer maintained, let's use secretive instead.

Install the binary:

@naveenadi
naveenadi / lldb_cheat_sheet.md
Created March 15, 2025 06:33 — forked from ryanchang/lldb_cheat_sheet.md
LLDB Cheat Sheet

LLDB Cheat Sheet

A complete gdb to lldb command map.

Print out

  • Print object
(lldb) po responseObject
(lldb) po [responseObject objectForKey@"state"]
  • p - Print primitive type
@naveenadi
naveenadi / expandable_widget.dart
Created March 3, 2025 08:12 — forked from xSaCh/expandable_widget.dart
Flutter Widget allow child to grow / shrink based on userdrag. DragWidget's gesture will be prioritize that it's parents even if parent is scrollable like SingleChildScrollView.
import 'package:flutter/material.dart';
class ExpandableWidget extends StatefulWidget {
const ExpandableWidget({
super.key,
required this.child,
required this.dragWidget,
this.initHeight,
this.maxHeight,
this.minHeight,
@naveenadi
naveenadi / update-android-project.sh
Created November 21, 2024 02:58 — forked from bizz84/update-android-project.sh
Script to update Gradle, Java and other Android project settings in a Flutter project
#!/bin/bash
# Update Gradle, Java and other Android project settings in a Flutter project
# See: https://gradle.org/releases/
DESIRED_GRADLE_VERSION="8.9"
# Build errors often show the required Java version
DESIRED_JAVA_VERSION="17"
# See: https://developer.android.com/ndk/downloads
DESIRED_NDK_VERSION="27.0.12077973"
# The minimum Android SDK version
@naveenadi
naveenadi / vagrant-kvm.md
Created November 16, 2024 15:29 — forked from yuanying/vagrant-kvm.md
How to use vagrant-kvm

Install Vagrant

sudo su
apt-get update && apt-get install -y libvirt-dev ruby-all-dev apparmor-utils
curl -O -L https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.5_x86_64.deb
dpkg -i vagrant_1.6.5_x86_64.deb 
aa-complain /usr/lib/libvirt/virt-aa-helper # workaround
exit

Install vagrant-kvm as user

@naveenadi
naveenadi / hls.sh
Created November 16, 2024 15:17 — forked from stenuto/hls.sh
HLS ffmpeg script
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]"
exit 1
}
# Check if at least one argument (input file) is provided
if [ $# -lt 1 ]; then
@naveenadi
naveenadi / windows_activation.md
Created November 16, 2024 15:15
Activate Windows for free

For Windows 10

Step 1 - Open PowerShell or Command Prompt as administrator

Step 2 - Install KMS client key

slmgr /ipk your_license_key

Replace your_license_key with following volumn license keys according to Windows Edition: