forked from phc/dm-scripts
Compare commits
7
Commits
main
..
removeproofs
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8f480b83d | ||
|
|
cf473ff4a4 | ||
|
|
118a6903c9 | ||
|
|
b4d68ded01 | ||
|
|
a88174ff4f | ||
|
|
3215c277f3 | ||
|
|
0c3fbf1665 |
@@ -11,6 +11,31 @@ Questa repository contiene i seguenti script:
|
||||
curl -L "https://git.phc.dm.unipi.it/phc/dm-scripts/raw/branch/main/steam-install" | bash
|
||||
```
|
||||
|
||||
- `install-llm-web-interface` — [@aziis98](https://git.phc.dm.unipi.it/aziis98)
|
||||
|
||||
Serve a scaricare una [web-ui per usare LLM](https://github.com/oobabooga/text-generation-webui/) in locale in Aula 3/4. Per utilizzarlo, basta eseguire il seguente comando da terminale
|
||||
|
||||
```bash shell
|
||||
$ curl -LO "https://git.phc.dm.unipi.it/phc/dm-scripts/raw/branch/main/install-llm-web-interface"
|
||||
$ chmod +x install-llm-web-interface
|
||||
|
||||
# La prima volta che lo si esegue, bisogna installare i pacchetti necessari
|
||||
$ ./install-llm-web-interface
|
||||
|
||||
# Le volte successive, si può eseguire questo per impostare una porta specifica
|
||||
$ ./install-llm-web-interface --listen-port 8080
|
||||
```
|
||||
|
||||
Nel frattempo, è possibile usare LLM in locale aprendo il browser all'indirizzo `http://localhost:8080` oppure se si sta usando ssh aprendo un tunnel con
|
||||
|
||||
```bash shell
|
||||
$ ssh -L 8080:localhost:8080 <username>@a3-dott8.cs.dm.unipi.it
|
||||
```
|
||||
|
||||
e poi aprendo il browser all'indirizzo `http://localhost:8080`.
|
||||
|
||||
Una volta nell'interfaccia web si può scaricare un modello di LLM (ad esempio <https://huggingface.co/TheBloke/Orca-2-7B-GGUF>) andando nella tab "Models" ed inserendo l'ID da huggingface (e.g. `TheBloke/Orca-2-7B-GGUF` ed il nome del singolo file `orca-2-7b.Q5_K_M.gguf`), poi premere "Refresh" e poi "Load" nella lista dei modelli per selezionarlo (conviene tenere sotto'occhio il terminare per vedere quando ha finito di scaricare il modello). Una volta caricato il modello, si può andare in "Chat" per usarlo.
|
||||
|
||||
- `printa4` — [@BachoSeven](https://git.phc.dm.unipi.it/BachoSeven)
|
||||
|
||||
Serve a stampare in aula4 (o qualsiasi altra stampante del dip) dal proprio computer, aprendo Okular graficamente da remoto.
|
||||
@@ -30,7 +55,7 @@ Questa repository contiene i seguenti script:
|
||||
- diversi tipi di paper size (A4 di default, per poter mandare in stampa senza dover mettere "fit-to-page")
|
||||
- aggiunta di un bordo interno (a sinistra per le pagine dispari, a destra per le pagine pari) per la rilegatura
|
||||
- pipe da stdin / a stdout
|
||||
|
||||
|
||||
Dipendenze: `PyPDF2`
|
||||
|
||||
- `pokepixel` — [@Fran314](https://git.phc.dm.unipi.it/Fran314)
|
||||
@@ -46,3 +71,15 @@ Questa repository contiene i seguenti script:
|
||||
- `pdfcompress` — [@aziis98](https://git.phc.dm.unipi.it/aziis98) (script preso in prestito [da questa repo](https://git.phc.dm.unipi.it/aziis98/chatgpt-scripts/src/branch/main/bin/pdfcompress2))
|
||||
|
||||
Comprime un PDF vettorizzato (ad esempio note scritte su un iPad) utilizzando poppler (file di ~100MB diventa tranquillamente di ~10MB)
|
||||
|
||||
- `removeproofs` — [@lukefleed](https://git.phc.dm.unipi.it/lukefleed)
|
||||
|
||||
Rimuove le dimostrazioni da un file `.tex`, utile per creare piccoli cheat sheet da portare agli esami dove è consentito portare materiale di studio.
|
||||
|
||||
Utilizzo:
|
||||
|
||||
```bash
|
||||
removeproofs <file.tex>
|
||||
```
|
||||
|
||||
Questo script è stato utilizzato per creare dei riassunti di Geometria 2 da delle dispense più complete: [G2-cheat-sheet](https://github.com/lukefleed/G2-cheat-sheet)
|
||||
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
export HOME="/tmp/$USER"
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
mkdir -p "$HOME"
|
||||
echo "Home moved to /tmp/$USER because of space constraints, this will last only for this session."
|
||||
|
||||
cd "$HOME" || exit 1
|
||||
|
||||
# Install text-generation-webui
|
||||
if [ ! -d "$HOME/text-generation-webui" ]; then
|
||||
git clone https://github.com/oobabooga/text-generation-webui
|
||||
else
|
||||
git -C "$HOME/text-generation-webui" pull
|
||||
fi
|
||||
|
||||
# Install requirements and start webui
|
||||
export GPU_CHOICE="A"
|
||||
export USE_CUDA118="Y"
|
||||
bash "$HOME/text-generation-webui/start_linux.sh" "$@"
|
||||
Regular → Executable
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: $0 <input_tex_file>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
input_file=$1
|
||||
output_file="${input_file%.tex}_without_proofs.tex"
|
||||
|
||||
awk '/\\begin{proof}/, /\\end{proof}/ {next} 1' "$input_file" > "$output_file"
|
||||
|
||||
echo "Lines between \\begin{proof} and \\end{proof} have been removed. Output saved to: $output_file"
|
||||
|
||||
Regular → Executable
+27
-13
@@ -1,24 +1,38 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
# Installs the AppImage for steam
|
||||
set -xeo pipefail
|
||||
|
||||
APP=Steam-202310201446-x86_64.AppImage
|
||||
# Variables
|
||||
APP=Steam-x86_64.AppImage
|
||||
NAME=steam
|
||||
URL="https://github.com/ivan-hc/Steam-appimage/releases/download/continuous/Steam-202310201446-x86_64.AppImage"
|
||||
URL="https://github.com/ivan-hc/Steam-appimage/releases/download/continuous/Steam-202401100234-x86_64.AppImage"
|
||||
LOCAL_BIN_DIR=$HOME/.local/bin
|
||||
DESKTOP_DIR=$HOME/.local/share/applications
|
||||
|
||||
mkdir -p $HOME/.local/bin
|
||||
echo "export PATH=$PATH:$HOME/.local/bin" >> .bashrc
|
||||
echo "export PATH=$PATH:$HOME/.local/bin" >> .bash_profile
|
||||
# Ensure local bin directory is in PATH
|
||||
if [[ ! ":$PATH:" == *":$LOCAL_BIN_DIR:"* ]]; then
|
||||
echo "export PATH=\$PATH:$LOCAL_BIN_DIR" >> $HOME/.bashrc
|
||||
echo "export PATH=\$PATH:$LOCAL_BIN_DIR" >> $HOME/.bash_profile
|
||||
fi
|
||||
|
||||
# Install Steam AppImage
|
||||
cd /tmp
|
||||
curl -LO $URL
|
||||
chmod +x $APP
|
||||
./$APP --appimage-extract
|
||||
mv squashfs-root $HOME/$NAME
|
||||
|
||||
cd $HOME/$NAME
|
||||
ln -sf $(realpath AppRun) $HOME/.local/bin/$NAME
|
||||
desktop-file-install --dir="$HOME/.local/share/applications" $NAME.desktop
|
||||
sed -i "s|Exec=$NAME|Exec=$HOME/.local/bin/$NAME|g" $HOME/.local/share/applications/$NAME.desktop
|
||||
gio set "$HOME/.local/share/applications/$NAME.desktop" "metadata::trusted" true
|
||||
rm -rf /tmp/$APP
|
||||
# Create symbolic link to AppRun
|
||||
ln -sf $(realpath $HOME/$NAME/AppRun) $LOCAL_BIN_DIR/$NAME
|
||||
|
||||
# Install desktop entry
|
||||
desktop-file-install --dir="$DESKTOP_DIR" $HOME/$NAME/$NAME.desktop
|
||||
|
||||
# Update desktop entry
|
||||
sed -i "s|Exec=$NAME|Exec=$LOCAL_BIN_DIR/$NAME|g" $DESKTOP_DIR/$NAME.desktop
|
||||
|
||||
# Mark desktop entry as trusted
|
||||
gio set "$DESKTOP_DIR/$NAME.desktop" "metadata::trusted" true
|
||||
|
||||
# Clean up
|
||||
rm -rf /tmp/$APP
|
||||
|
||||
Reference in New Issue
Block a user