Skip to content

Instantly share code, notes, and snippets.

View lvnilesh's full-sized avatar
💭
🏆 Vibranium Status Level

LV Nilesh lvnilesh

💭
🏆 Vibranium Status Level
View GitHub Profile
@lvnilesh
lvnilesh / hls.sh
Created November 8, 2024 20:20 — 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
@lvnilesh
lvnilesh / .config-karabiner-karabiner.json
Created November 2, 2024 21:54
karabiner on the old macbook pro
{
"global": {
"ask_for_confirmation_before_quitting": true,
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
@lvnilesh
lvnilesh / docker-compose.yaml
Created October 21, 2024 17:20
mount an NFS export directly inside a docker container
services:
web:
image: nginx:latest
ports:
- "80:80"
volumes:
- web_data:/usr/share/nginx/html
# volumes:
# web_data:
@lvnilesh
lvnilesh / create-aks-k8s.sh
Created September 20, 2024 04:52
create-aks-k8s.sh
```
export RANDOM_ID="$(openssl rand -hex 3)"
export MY_RESOURCE_GROUP_NAME="CGRG$RANDOM_ID"
export REGION="westus"
export MY_AKS_CLUSTER_NAME="andromeda$RANDOM_ID"
export MY_DNS_LABEL="cgdns$RANDOM_ID"
az group create --name $MY_RESOURCE_GROUP_NAME --location $REGION
az aks create --resource-group $MY_RESOURCE_GROUP_NAME --name $MY_AKS_CLUSTER_NAME --node-count 1 --generate-ssh-keys
@lvnilesh
lvnilesh / Llama_with_llama3_1
Last active July 28, 2024 19:17
llama llama red pajama
# a machine with a GPU would be nice. makes it faster.
# install Ollama - a runner for the models
sudo curl -L https://ollama.com/download/ollama-linux-amd64 -o /usr/bin/ollama
sudo chmod +x /usr/bin/ollama
sudo useradd -r -s /bin/false -m -d /usr/share/ollama ollama
# create service unit file
tee /usr/lib/systemd/system/ollama.service > /dev/null <<EOF
```dataviewjs
this.container.style.minHeight = "1000px";
const { renderCalendar } = app.plugins.plugins["obsidian-full-calendar"];
let today = moment().format("GGGG-[W]WW");
let rawData = await dv.io.csv("DataStores/csv/" + moment().format("GGGG-[W]WW") + ".csv");
let entries = rawData.map((p) => ({
backgroundColor: p.calendar == 'family' ? '#452538' : '#4d95f7',
borderColor: this.app.vault.getAbstractFileByPath(p.id + ".md") ? '#406f0b' : '#4d95f7',
allDay: p.allDay,
@lvnilesh
lvnilesh / autoscaling.json
Created June 20, 2024 03:38
autoscaling cloudformation JSON
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Create a multi-az, load balanced and Auto Scaled sample web site running on\nan Apache Web Server. The application is configured to span all\nAvailability Zones in the region and is Auto-Scaled based on the CPU\nutilization of the web servers. Notifications will be sent to the operator\nemail address on scaling events. The instances are load balanced with a\nsimple health check against the default web page. **WARNING** This template\ncreates one or more Amazon EC2 instances and an Elastic Load Balancer. You\nwill be billed for the AWS resources used if you create a stack from this\ntemplate.\n",
"Parameters": {
"InstanceType": {
"Description": "WebServer EC2 instance type",
"Type": "String",
"Default": "t4g.micro"
},
"OperatorEMail": {
@lvnilesh
lvnilesh / autoscaling.yaml
Created June 20, 2024 03:37
autoscaling cloudformation YAML
AWSTemplateFormatVersion: "2010-09-09"
Description: |
Create a multi-az, load balanced and Auto Scaled sample web site running on
an Apache Web Server. The application is configured to span all
Availability Zones in the region and is Auto-Scaled based on the CPU
utilization of the web servers. Notifications will be sent to the operator
email address on scaling events. The instances are load balanced with a
simple health check against the default web page. **WARNING** This template
creates one or more Amazon EC2 instances and an Elastic Load Balancer. You
@lvnilesh
lvnilesh / docker-compose.yaml
Created April 28, 2024 02:20
self-hosted network-isolated vaultwarden
---
services:
bitwarden:
container_name: vault
hostname: vault
image: vaultwarden/server:1.30.5-alpine
restart: always
volumes:
- /etc/localtime:/etc/localtime:ro
- $PWD/log:/var/log/vaultwarden