Skip to content

Instantly share code, notes, and snippets.

View danigunawan's full-sized avatar
🏸
sehat+i

Dani Gunawan danigunawan

🏸
sehat+i
View GitHub Profile
@ninely
ninely / main.py
Last active September 15, 2025 10:10
Langchain with fastapi stream example
"""This is an example of how to use async langchain with fastapi and return a streaming response.
The latest version of Langchain has improved its compatibility with asynchronous FastAPI,
making it easier to implement streaming functionality in your applications.
"""
import asyncio
import os
from typing import AsyncIterable, Awaitable
import uvicorn
from dotenv import load_dotenv
@DenisJunio
DenisJunio / install_php_8_1.sh
Last active September 26, 2025 20:27
Laravel - PHP 8.1 Extensions - Ubuntu
#!/bin/bash
sudo apt install software-properties-common && sudo add-apt-repository ppa:ondrej/php -y
sudo apt update
sudo apt upgrade -y
sudo apt install php8.1 -y
sudo apt install php8.1-bcmath -y
sudo apt install php8.1-bz2 -y
sudo apt install php8.1-cli -y
sudo apt install php8.1-common -y
sudo apt install php8.1-curl -y
@UbuntuEvangelist
UbuntuEvangelist / How To Install Python Ubuntu 24.04 LTS
Last active November 29, 2024 18:13
This Commands Will Install Multiple Python-3.11.x Into Ubuntu 24.04 LTS
# !/bin/sh
# Install Python 3 on Ubuntu From Source
sudo -i
apt update && apt upgrade -y
apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev
apt install build-essential checkinstall
apt autoremove
apt install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
cd /opt
@p3jitnath
p3jitnath / install-docker.sh
Last active June 26, 2025 20:17
Docker and Nvidia Docker installation in Ubuntu 20.04 LTS
# WARNING : This gist in the current form is a collection of command examples. Please exercise caution where mentioned.
# Docker
sudo apt-get update
sudo apt-get remove docker docker-engine docker.io
sudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable docker
docker --version
@bluetoothfx
bluetoothfx / redis.learn
Last active May 29, 2023 07:04
Start a Redis database using Docker
# To get & run redis on docker (6379 is default port)
> docker run -d -p 6379:6379 --name redis1 redis
# Run redis on docker & guaranteed backup (-create /home/redisDB directory 1st in your host machine)
> docker run -v /home/redisDB:/data -d -p 6379:6379 --name redis1 redis redis-server --appendonly yes
# to check if redis is functioning in docker (status checking)
> docker ps
# to view redis logs
> docker logs redis1
# start a new interactive session (-it) inside the running container
> docker exec -it redis1 sh
@ahmedsadman
ahmedsadman / create-service.sh
Last active March 18, 2025 08:19
Bash script to create systemd service
#!/usr/bin/bash
##
## Creates Service file based on JSON data
##
# Sample JSON file:
# {
# "service_name": "test_service",
# "description": "Netcore dev server",
@earvinpiamonte
earvinpiamonte / .htaccess
Created September 1, 2019 04:55
Codeigniter .htaccess - force HTTPS
RewriteEngine On
# start force http www (optional)
RewriteCond %{HTTP_HOST} !=localhost
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# end force http www (optional)
# start force https
RewriteCond %{HTTP_HOST} !=localhost
@pjobson
pjobson / headless_virtualbox.md
Last active March 14, 2024 21:12
VirtualBox Headless Ubuntu/Mint

VirtualBox Headless Ubuntu/Mint with phpVirtualBox

I had a lot of trouble setting this up, the guides out there don't seem complete. I used various guides and troubleshooting sites to get all of this figured out.

NOTE: My server's internal IP address is 10.10.10.100, you will need to substitute yours where appropriate.

Software Versions Used

  • Server Side