Skip to content

Instantly share code, notes, and snippets.

@abhi-io
abhi-io / nginx conf - ip server
Created June 20, 2024 05:50
nginx conf - ip server
# Define an upstream block for backend services
upstream api_backend {
server localhost:6565;
}
# HTTP server block to handle requests
server {
listen 80;
server_name ;
@abhi-io
abhi-io / WordPress-Dokerfile
Created June 14, 2024 08:17
multiple WordPress instances with separate databases using Docker
To set up multiple WordPress instances with separate databases using Docker, you'll need to modify the Docker commands to create additional containers for WordPress and MariaDB. Here's how you can set it up for three websites:
1. Create Docker networks:
```bash
docker network create wordpress-network1
docker network create wordpress-network2
docker network create wordpress-network3
```
2. Create volumes for each WordPress instance and database:
import os
from openai import OpenAI
client = OpenAI(
api_key = os.getenv("OPENAI_API_KEY"),
)
completion = client.chat.completions.create( # Change the method
model = "gpt-3.5-turbo",
messages = [ # Change the prompt parameter to messages parameter
@abhi-io
abhi-io / threeJs - Basic3d
Created February 27, 2024 15:38
threeJs - Basic3d
import React, { useEffect } from 'react';
import * as THREE from 'three';
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
function Basic3d() {
useEffect(() => {
// Scene
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xaaaaaa); // Optional: Change scene background
@abhi-io
abhi-io / README.md
Last active October 27, 2023 05:59 — forked from revant/README.md
Frappe Docker development bench in production

Install frappe-bench using docker

Clone frappe_docker

git clone https://github.com/frappe/frappe_docker.git
cd frappe_docker

Install bench using docker

# The script returns a kubeconfig for the service account given
# reff: https://gist.github.com/innovia/fbba8259042f71db98ea8d4ad19bd708
# you need to have kubectl on PATH with the context set to the cluster you want to create the config for
# Cosmetics for the created config
clusterName=some-cluster
# your server address goes here get it via kubectl cluster-info
server=https://157.90.17.72:6443
# the Namespace and ServiceAccount name that is used for the config
namespace=kube-system
@abhi-io
abhi-io / get cephadm tool
Created August 7, 2021 07:11
install ceph
curl --silent --remote-name --location https://github.com/ceph/ceph/raw/octopus/src/cephadm/cephadm
sudo mv cephadm /usr/local/bin
sudo chmod +x /usr/local/bin/cephadm
sudo mkdir -p /etc/ceph
@abhi-io
abhi-io / Amazon S3 Command Line
Created August 5, 2021 21:16
s3cmd API calls
Make bucket
s3cmd mb s3://BUCKET
Remove bucket
s3cmd rb s3://BUCKET
List objects or buckets
s3cmd ls [s3://BUCKET[/PREFIX]]
List all object in all buckets
s3cmd la
Put file into bucket
s3cmd put FILE [FILE...] s3://BUCKET[/PREFIX]
@abhi-io
abhi-io / docker-compose.yml
Last active August 5, 2021 20:31
CEPH docker-compose.yml
version: "3.5"
services:
ceph:
image: ceph/daemon:v5.0.8-stable-5.0-octopus-centos-8
container_name: demo-ceph
command: demo
hostname: ceph-demo
ports:
- 5000:5000
- 8000:8000
##this is in for loop for testing purpose
for i in {1..100000}; do ffmpeg -re -i VIDEO-FILE.mp4 -vcodec libx264 -vprofile baseline -g 30 -acodec aac -strict -2 -f flv rtmp://IP:1935/stone1/age2; done