Skip to content

Instantly share code, notes, and snippets.

View sebsto's full-sized avatar

Sébastien Stormacq sebsto

View GitHub Profile
@sebsto
sebsto / gist:19b99f1fa1f32cae5d00
Created August 8, 2014 15:53
Install Maven with Yum on Amazon Linux
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
mvn --version
@sebsto
sebsto / gist:6441df09e97c4cbbd22b8ba313b8d642
Last active May 4, 2026 23:36
Amazon Linux 2 first boot on Virtual Box
# Download the VDI from https://cdn.amazonlinux.com/os-images/latest/
# Doc is at http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-2-virtual-machine.html
# Be sure you have config/meta-data and config/user-data ready as per the below
# change ec2-user's password to your password
$ cat config/meta-data
local-hostname: amazonlinux.onprem
# eth0 is the default network interface enabled in the image. You can configure
@sebsto
sebsto / social_media.md
Last active April 22, 2026 07:20
Social Media Agent

Social Media Posting — AI Agent Reference

This document contains all credentials and instructions needed for an AI agent to post on your social media accounts. Read this file before posting. Each platform section is self-contained with credentials, posting instructions, and curl samples.


Quick Reference

| Platform | Auth method | Token expiry | Max length | Status |

@sebsto
sebsto / assume_root_credentials.sh
Last active January 27, 2026 15:21
Assume Root on AWS member accounts
#!/bin/bash
AWS_ACCOUNT_ID=012345678901
# Check if jq is installed
if ! command -v jq &> /dev/null; then
echo "Error: jq is not installed. Please install jq to parse JSON."
exit 1
fi
@sebsto
sebsto / install_ld.gold.sh
Last active July 22, 2025 19:11
Installl `ld.gold` on Amazon Linux 2023
#!/bin/bash
dnf install gmp-devel mpfr-devel texinfo bison git gcc-c++ -y
mkdir ld.gold && cd ld.gold
git clone --depth 1 git://sourceware.org/git/binutils-gdb.git binutils
mkdir build && cd build
../binutils/configure --enable-gold --enable-plugins --disable-werror
make all-gold
cd gold
@sebsto
sebsto / swift.md
Created June 23, 2025 14:45
Amazon Q Context for Swift projects

You are a coding assistant--with access to tools--specializing in analyzing codebases. Below is the content of the file the user is working on. Your job is to to answer questions, provide insights, and suggest improvements when the user asks questions.

Do not answer with any code until you are sure the user has provided all code snippets and type implementations required to answer their question.

Briefly--in as little text as possible--walk through the solution

@sebsto
sebsto / helper.swift
Created April 1, 2025 17:25
MCP swift-SDK wrapper
import MCP
#if canImport(FoundationEssentials)
import FoundatioNEssentials
#else
import Foundation
#endif
public protocol MCPTool<Input, Output>: Sendable {
associatedtype Input
@sebsto
sebsto / gist:a6c2346eaa72bb9cc4b061b20b56cfcc
Last active February 27, 2025 15:37
Build Swift 5.8 or 5.9 on Amazon Linux 2023
#!/bin/bash
## Install and Remove conflicting dependencies
sudo dnf install python3-pip -y
sudo dnf remove python3-requests python-urllib3 -y
## Install LD GOLD
sudo dnf install gmp-devel mpfr-devel texinfo bison git gcc-c++ -y
mkdir ld.gold && cd ld.gold
@sebsto
sebsto / gist:6409ed9dbf4c9dd1488e049165f751aa
Last active November 21, 2024 02:55
Build Swift 6.x on Amazon Linux 2023
#!/bin/bash
## Install and Remove conflicting dependencies
sudo dnf install python3-pip -y
sudo dnf remove python3-requests python-urllib3 -y
## Install docker (used by swift-installer-script project)
sudo dnf install docker -y
@sebsto
sebsto / gist:6af5bf3acaf25c00dd938c3bbe722cc1
Last active November 3, 2024 19:16
Start VNCServer on Mac1 EC2 Instance
# YouTube (english) : https://www.youtube.com/watch?v=FtU2_bBfSgM
# YouTube (french) : https://www.youtube.com/watch?v=VjnaVBnERDU
#
# On your laptop, connect to the Mac instance with SSH (similar to Linux instances)
#
ssh -i <your private key.pem> ec2-user@<your public ip address>
#
# On the Mac