Skip to content

Instantly share code, notes, and snippets.

View Dan1jel's full-sized avatar

Danijel Wallenborg Dan1jel

View GitHub Profile
import os
import sys
from dotenv import load_dotenv
import openai # pip install openai
import re
# Load the API key from the .env file
load_dotenv()
# Get the API key from the environment variable
@nasseef20
nasseef20 / termux-url-opener
Last active January 4, 2023 14:47 — forked from LordH3lmchen/termux-url-opener
termux-url-opener
#!/data/data/com.termux/files/usr/bin/zsh
#
# This is a termux-url-opener script to do diffrent tasks on my Android phone
#
#
#
# How to use this script
#############################
# Create the bin directory
# ➜ ~ mkdir bin
@brainfucksec
brainfucksec / bash.bashrc
Last active May 1, 2024 09:24
Termux bash.bashrc
######################################
#
# Termux bash.bashrc
# by brainf+ck
#
# Last modified: 2022/06/30
#
######################################
#### Global ##########################
@tweakimp
tweakimp / pip_updater.sh
Created September 24, 2019 05:36
pip updater
#!/usr/bin/env bash
echo "PIP PACKAGE UPDATER"
going=true
while $going
do
read -n 1 -p "`echo $'\n[1] Force update all packages'``echo $'\n[2] Check for updates'``echo $'\n[5] Update packages considering dependencies'``echo $'\n[9] Force reinstall all packages'``echo $'\n[Q] Quit'``echo $'\n> '`" ans;
echo $'\n'
case $ans in
1)
echo $'Force updating all packages...\n'
@DavidGoodwin
DavidGoodwin / tplink.sh
Created January 18, 2018 16:11
control a tplink HS100/HS110 smart plug from bash/the cli
@CannonballSkippy
CannonballSkippy / Video-and-Subtitle-merger-batch-for-mkvmerge.bat
Created May 15, 2017 13:27
This is a batch script that will merge subtitles with a video file, resulting in an *.mkv file with internal subtitles.
@echo off
echo ----------------------------------------------------------------------
echo VIDEO AND SUBTITLE MERGER
echo version 1.0.0 by Seyoum
echo ----------------------------------------------------------------------
:: Set file video extention
:VIDEOFILEEXTENTION
echo.
set /p videofileformat=Enter the video file type extension (e.g mp4):
if /I "%videofileformat%" EQU "webm" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
@jamesmacwhite
jamesmacwhite / ffmpeg_mkv_mp4_conversion.md
Last active July 9, 2024 09:52
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

@meinside
meinside / smartctl_test.md
Last active June 9, 2024 16:12
For checking health of usb hdd on raspberry pi with smartctl.

for testing external hdd with smartctl,

install smartmontools

$ sudo apt-get install smartmontools

start test,

@joseluisq
joseluisq / terminal-git-branch-name.md
Last active July 4, 2024 15:00
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {