Skip to content

Instantly share code, notes, and snippets.

View vsujeesh's full-sized avatar

Vishnu Sujeesh (@vscodes) vsujeesh

View GitHub Profile
#!/usr/bin/env bash
# Retrieve AWS credentials from AWS CloudShell
# shellcheck disable=SC2001
HOST=$(echo "$AWS_CONTAINER_CREDENTIALS_FULL_URI" | sed 's|/latest.*||')
TOKEN=$(curl -s -X PUT "$HOST"/latest/api/token -H "X-aws-ec2-metadata-token-ttl-seconds: 60")
OUTPUT=$(curl -s "$HOST/latest/meta-data/container/security-credentials" -H "X-aws-ec2-metadata-token: $TOKEN")
echo "export AWS_ACCESS_KEY_ID=$(echo "$OUTPUT" | jq -r '.AccessKeyId')"
echo "export AWS_SECRET_ACCESS_KEY=$(echo "$OUTPUT" | jq -r '.SecretAccessKey')"
@vsujeesh
vsujeesh / grpo_demo.py
Created February 1, 2025 03:19 — forked from willccbb/grpo_demo.py
GRPO Llama-1B
# train_grpo.py
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
# Load and prep dataset
@vsujeesh
vsujeesh / outbound-email-with-cloudflare.md
Created July 23, 2024 05:06 — forked from irazasyed/outbound-email-with-cloudflare.md
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

@vsujeesh
vsujeesh / onenote_export.py
Created June 8, 2023 15:37 — forked from danmou/onenote_export.py
Onenote export to HTML. NOTE: This script is now maintained at https://github.com/Danmou/onenote_export
### README
# This Python scripts exports all the OneNote notebooks linked to your Microsoft account to HTML files.
## Output
# The notebooks will each become a subdirectory of the `output` folder, with further subdirectories
# for the sections within each notebook and the pages within each section. Each page is a directory
# containing the HTML file `main.html` and two directories `images` and `attachments` (if necessary)
# for the images and attachments. Any sub-pages will be subdirectories within this one.
## Setup
@vsujeesh
vsujeesh / rutracker-magnet.user.js
Created June 9, 2021 08:19 — forked from lemenkov/rutracker-magnet.user.js
Rutracker Magnet + trackers addon for GreaseMonkey
// ==UserScript==
// @name Rutracker.org Magnet URLs
// @namespace rutrackerorg-magnet-urls
// @description Transforms torrent hash into a magnet url
// @include https://rutracker.org/*
// @include https://rutracker.cr/*
// @include https://rutracker.net/*
// @include https://rutracker.nl/*
// @include http://rutrackerripnext.onion/*
// @version 9