Skip to content

Instantly share code, notes, and snippets.

View naufalso's full-sized avatar

Naufal Suryanto naufalso

View GitHub Profile
@naufalso
naufalso / export_chrome_history.py
Created November 8, 2024 10:03
Export chrome history
import sqlite3
import pandas as pd
from datetime import datetime, timedelta
# Path to your Chrome history database [Select one based on your os and chrome history path]
history_path = "C:\\Users\\[USER_NAME]\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\History" # Windows
history_path = "~/Library/Application Support/Google/Chrome/Default/History" # MAC
history_path = "~/.config/google-chrome/Default/History" # Linux
# Connect to the database
@naufalso
naufalso / parallel_queue_tmux.sh
Created October 11, 2024 01:55
Paralel Queue with tmux
#!/bin/bash
# initialize a semaphore with a given number of tokens
open_sem(){
mkfifo pipe-$$
exec 3<>pipe-$$
rm pipe-$$
local i=$1
for((;i>0;i--)); do
printf %s 000 >&3
@naufalso
naufalso / compute_hash.sh
Created September 4, 2024 00:29
A scripts for computing folder hash. This is usefull for checking to folder is identical.
#!/bin/bash
# Check if the correct number of arguments is provided
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <input_directory> <output_file>"
exit 1
fi
# Assign input arguments to variables
input_dir="$1"
@naufalso
naufalso / coco_labels.txt
Created June 25, 2024 06:34
COCO Labels
person
bicycle
car
motorcycle
airplane
bus
train
truck
boat
traffic light
@naufalso
naufalso / autogpt_sample_prompt.txt
Created March 20, 2024 09:10
AutoGPT Sample Prompt
============== ChatPrompt ==============
Length: 6 messages
----------------- SYSTEM -----------------
You are EthicalHackingGPT, a highly skilled and ethical hacker that specializes in penetration testing and security assessment to identify and strengthen vulnerabilities within network systems.
Your decisions must always be made independently without seeking user assistance. Play to your strengths as an LLM and pursue simple strategies with no legal complications.
The OS you are running on is: macOS-14.4
## Constraints
@naufalso
naufalso / nvidia_opengl_issue_note.md
Last active March 11, 2024 01:32
NVIDIA OpenGL Issue Note

Problem

Encountered slow and laggy performance in the Unreal Engine within my NVIDIA CUDA container following a driver update. The issue is suspected to be related to OpenGL not utilizing the GPU but instead relying on the CPU. This inference is drawn from the output of the glxheads command within the container, indicating the use of Mesa/X.org and llvmpipe for rendering:

GL_VERSION:  3.1 Mesa 21.2.6
GL_VENDOR:   Mesa/X.org
GL_RENDERER: llvmpipe (LLVM 12.0.0, 256 bits)

In contrast, running the same command on the host PC reveals NVIDIA usage:

@naufalso
naufalso / parallel_queue.sh
Created February 16, 2024 08:14
Bash Script for Running Parallel Queue
#!/bin/bash
# initialize a semaphore with a given number of tokens
open_sem(){
mkfifo pipe-$$
exec 3<>pipe-$$
rm pipe-$$
local i=$1
for((;i>0;i--)); do
printf %s 000 >&3
@naufalso
naufalso / pdf-color-pages-classifier-and-counter.ipynb
Last active October 27, 2024 14:09
pdf-color-pages-classifier-and-counter.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.