Skip to content

Instantly share code, notes, and snippets.

View JudahSan's full-sized avatar
🎯
Focusing

Judah JudahSan

🎯
Focusing
  • Ba sing se
View GitHub Profile
@JudahSan
JudahSan / ubuntu.md
Created September 10, 2024 13:45 — forked from hmasila/ubuntu.md

Create deploy user

$ sudo adduser deploy

Privileges

Sudoer

add "deploy" user to sudo group if you want deploy to be a sudoer

$ sudo usermod -aG sudo deploy

Install nginx

$ sudo apt-get install nginx

$ sudo apt-get install -y dirmngr gnupg apt-transport-https ca-certificates curl

$ curl https://oss-binaries.phusionpassenger.com/auto-software-signing-gpg-key.txt | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/phusion.gpg >/dev/null

Add APT repository

$ sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger jammy main > /etc/apt/sources.list.d/passenger.list'

Add puma to you Gemfile:

gem "puma"

Install Puma Gem

change to project directory
bundle install
@JudahSan
JudahSan / README.md
Created August 26, 2024 06:38
Chrome not starting after changing hostname

Chrome version: Version 127.0.6533.119 (Official Build) (64-bit)

OS: Ubuntu 22.04

Steps to reproduce the problem

  1. Change the hostname of the machine
  2. Reboot
  3. Start chrome
@JudahSan
JudahSan / README.md
Created June 28, 2024 15:47
Unix Threads in C notes

Processes and threads

  • A process represents an instance of a running program
  • Threads are individual units of execution within a process.

Process

  • A process is an active program, ie, a program that is under execution. It includes the program code, program counter, process stack, registers, etc
@JudahSan
JudahSan / Makefile
Created May 21, 2024 20:16
Error running golang backend
DATABASE_URL:=postgres://postgres:foobarbaz@localhost:5432/postgres
.PHONY: run-postgres
run-postgres:
@echo Starting postgres container
-docker run \
-e POSTGRES_PASSWORD=foobarbaz \
-v pgdata:/var/lib/postgresql/data \
-p 5432:5432 \
postgres:15.1-alpine
@JudahSan
JudahSan / README.md
Created May 16, 2024 11:23
Configure Soundcore life q30 in Ubuntu
# bluetoothctl
# scan on

then, find and copy address for your headphone

@JudahSan
JudahSan / README.md
Created May 9, 2024 12:51
LangChain

Memory Types

ConversationBufferMemory

  • This memory allows for storing of messages and then extracts the messages in a variable.

CoversationBufferWindowMemory

@JudahSan
JudahSan / README.md
Created April 2, 2024 15:41
ActiveStorage::Variant on RoR 7: vips

Problem:

  • The application crashed when attempting to resize the image to a size of 50px x 50px.
  • ActiveStorage was properly configured with the required dependencies.
def image_as_thumbnail
    image.variant(resize_to_limit: [50, 50]).processed
end
@JudahSan
JudahSan / README.md
Last active February 29, 2024 18:58
What is DynamoDB� Is it a typo? This is an into to NoSQL- DynamoDB lab

3 - Create Tables

You will create 4 tables based on JSON format. For that, you will use the DynamoDBManager.create_table method.

To make it easy to access the properties of each of the tables, create the dictionaries that have the following attributes:

  • table_name: Name of the table, composed of a course prefix and the table name.
  • kwargs: Dictionary with additional arguments used in the DynamoDBManager.create_table method.