Skip to content

Instantly share code, notes, and snippets.

View dahse89's full-sized avatar

Philipp Dahse dahse89

View GitHub Profile
@dahse89
dahse89 / install.sh
Last active July 4, 2022 07:44
Install Arch (German)
#!/bin/zsh
# keyboard
loadkeys de-latin1
# list network cards
ip link
# connect to LAN
dhcpcd <name like 'enp4s0'>
@dahse89
dahse89 / pre-install.sh
Created July 4, 2022 08:15
Arch Linux | Things to do after install
#!/bin/bash
# system update
pacman -Syyu
# install sudo
pacman -S sudo
nano /etc/sudoers # change what you need
@dahse89
dahse89 / auto_rename_pdf_using_ocr_and_gpt.gs
Last active April 13, 2023 18:39
This script is a Google Action that renames PDF files in a designated folder based on their content. It leverages Google Drive OCR and OpenAI Complete API. To use this script, you will need an OpenAI token and to add the Drive API Service. Additionally, it's recommended to update the GPT prompt to make it more adaptable to different use cases.
const openAiApiKey = '***'
const openAiCompletionApiUrl = 'https://api.openai.com/v1/completions';
const additionalPromptCharsLimit = 1600;
function myFunction() {
const idOfFolderContainingPdfs = '{ADD ID HERE}'
const idOfDestinationFolder = '{ADD ID HERE}'
const SourceFolder = DriveApp.getFolderById(idOfFolderContainingPdfs)
const DestinationFolder = DriveApp.getFolderById(idOfDestinationFolder)