Skip to content

Instantly share code, notes, and snippets.

View arunjayakumar01's full-sized avatar
😎

Arun J arunjayakumar01

😎
  • Accubits Technologies
  • India
View GitHub Profile
@arunjayakumar01
arunjayakumar01 / k3s.md
Created March 4, 2024 15:14 — forked from rosswf/k3s.md
Deploy HA k3s with kube-vip and MetalLB using k3sup

Prerequisites

kubectl

Install the required tools for deploying and controlling k3s.

Installation Docs:

# Download
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"

OpeanAI Whisper Demo

If you have docker, try this:

cat <<EOF > /tmp/docker-init.sh
apt update && apt install python3-pip ffmpeg git -y
git clone https://gist.github.com/kpe/6a70395ce171ffee43d927eaf90b81b6 /tmp/whisper
cd /tmp/whisper
pip3 install -r requirements.txt
python3 -m whisper_demo
@arunjayakumar01
arunjayakumar01 / create_superset_users.py
Created January 11, 2023 07:01 — forked from pajachiet/create_superset_users.py
Scripting on Superset backend to fix bugs or automate tasks
#!/usr/bin/env python
# coding: utf8
# Script to create superset users
import pandas as pd
from sqlalchemy import create_engine
import datetime
import pexpect
import os
const chai = require("chai");
const chaiHttp = require("chai-http");
const expect = chai.expect
const baseUrl = "https://store-ordering-api.herokuapp.com"
// const baseUrl = "localhost:3200/"
chai.use(chaiHttp);
describe("Food Ordering API Unit Test", function(){
var token;
@arunjayakumar01
arunjayakumar01 / axiosInterceptor.js
Created January 3, 2023 20:05 — forked from CITGuru/axiosInterceptor.js
Axios create/recreate cookie session in node.js enviroment
/* Basic example of save cookie using axios in node.js and recreate session if it expired.
* Get/save cookie manually cause WithCredential axios param use XHR and not work in node.js
* Supports parallel request and send only one create session request.
* */
const BASE_URL = "https://google.com";
// Init instance of axios which works with BASE_URL
const axiosInstance = axios.create({ baseURL: BASE_URL });
@arunjayakumar01
arunjayakumar01 / resize-partition-ubuntu.md
Last active March 10, 2022 10:20
resize-partition-ubuntu
  • lsblk to list partitions
  • sudo pvs to list the free space in disk
  • sudo pvresize /dev/sda1
  • df -h to get root logical volume name
    • eg /dev/mapper/ubuntu--vg-root
  • Expand volume
  • sudo lvextend -r -l +100%FREE /dev/mapper/ubuntu--vg-root
rm -rf lambda.zip
zip -r lambda.zip node_modules/ index.js package.json
aws s3 cp lambda.zip s3://<s3-bucket-name> --profile <aws-profile>
#aws lambda update-function-code --function-name contact-form-api --zip-file fileb://lambda.zip --profile cossist
#aws lambda create-function --function-name <function name or arn> --runtime <runtime> --role <role arn> --handler <handle> --code S3Bucket=your-bucket-name,S3Key=Lambda-Deployment.zip
aws lambda update-function-code \
--function-name <lambda-api-name> \
--s3-bucket <s3-bucket-name> \
@arunjayakumar01
arunjayakumar01 / ecosystem.json
Created February 20, 2022 11:19 — forked from wirwolf/ecosystem.json
pm2 ecosystem.json config example
{
"apps": [
{
/* General */
"name": "my-api", /* (string) application name (default to script filename without extension) */
"script": "index.js", /* (string) script path relative to pm2 start */
"cwd": "/var/www/", /* (string) the directory from which your app will be launched */
"args": "-a 13 -b 12", /* (string) string containing all arguments passed via CLI to script */
"interpreter": "/usr/bin/python", /* (string) interpreter absolute path (default to node) */
"interpreter_args": "--harmony", /* (string) option to pass to the interpreter */
@arunjayakumar01
arunjayakumar01 / install_nginx_macos_source.md
Created January 10, 2022 17:37 — forked from beatfactor/install_nginx_macos_source.md
Install Nginx on Mac OS from source (without brew)

Install Nginx on Mac OS from source

no Homebrew required

1. Download Nginx

$ cd /usr/local/src
$ curl -OL http://nginx.org/download/nginx-1.12.2.tar.gz
$ tar -xvzf nginx-1.12.2.tar.gz && rm nginx-1.12.2.tar.gz
@arunjayakumar01
arunjayakumar01 / split_file_into_blob.js
Last active December 26, 2021 10:43
Spit file into blobs
const file = document.getElementById('upload').files[0];
const CHUNK_SIZE = 10000000; // 10MB
const fileSize = file.size;
const CHUNKS_COUNT = Math.floor(fileSize / CHUNK_SIZE) + 1;
let start, end, blob;
for (let index = 1; index < CHUNKS_COUNT + 1; index++)
{
start = (index - 1) * CHUNK_SIZE;
end = (index) * CHUNK_SIZE;