Skip to content

Commit

Permalink
adding PWA and WASM
Browse files Browse the repository at this point in the history
  • Loading branch information
JAlcocerT committed Feb 11, 2024
1 parent f82ba38 commit 7f1cafb
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 4 deletions.
8 changes: 6 additions & 2 deletions content/docs/Debian/content_creation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ flatpak run com.obsproject.Studio

### Editing Videos in Linux

Probably the simplest will be KDEnlive. But here you have few options.
<!--
https://www.youtube.com/watch?v=EHnAV6fObGI -->

```sh
#sudo snap install blender --classic && snap install freecad && snap install openscad && snap install cura-slicer

Expand All @@ -41,13 +45,13 @@ https://gist.githubusercontent.com/JAlcocerT/197667ec5ec0da53e78eb58c4253a73f/ra

## Photo Editing in Linux

The one and only - GIMP:
* The one and only - **GIMP**:

```sh
sudo snap install gimp
```

Resize Images without loosing quality - Upscayl
* Resize Images without loosing quality - **Upscayl**

A great project that provides us with 3 different ways to install (For Debian any of these will do): [snap](https://jalcocert.github.io/Linux/docs/debian/linux_installing_apps/#snap) / [flatpak](https://jalcocert.github.io/Linux/docs/debian/linux_installing_apps/#flatpak) / [AppImage](https://jalcocert.github.io/Linux/docs/debian/linux_installing_apps/#ui)

Expand Down
94 changes: 93 additions & 1 deletion content/docs/Linux_&_Cloud.md/selfhosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ The [ML Compilation for LLMs](https://github.com/mlc-ai/mlc-llm) project aims to
* Automatic111
* Fooocus

### Voice to Text

* [Piper](https://github.com/rhasspy/piper) - Also works [Text to Voice](https://www.youtube.com/watch?v=SzRF50UwzYk)
* [Voices at HF](https://huggingface.co/rhasspy/piper-voices/tree/main)

### Affordable Local Gen AI with iGPU's


Expand Down Expand Up @@ -156,4 +161,91 @@ Duplicati to other location (HD / Mega, One drive, s3...)

* [NGINX](https://fossengineer.com/selfhosting-nginx-proxy-manager-docker/)
* [Cloudflare](https://fossengineer.com/selfhosting-cloudflared-tunnel-docker/)
* Authelia / Zitadel / Authentik
* Authelia / Zitadel / Authentik

### What about Web Assembly?

With WASM we can run Apps coded in other language (other than web language like js) in our browsers.

WASM allow us to compiled code and run it in various environments (for example browsers) - Regardless of OS and even architecture ARM/X86/RISC-V...

With Docker we have (generally) bigger Images than WASM. Wasm follows both OCI and w3c standards.


```mermaid
graph TD;
WASM_Module_1(".WASM Module 1,2,3...") -->|WA| WASM_Runtime("WASM Runtime (wasmtime, wamr, wagi)");
WASM_Runtime -->|WASI - Web Assembly Interface| Host_OS("Host OS");
```

{{% details title="Get Started with WASM 🐰" closed="true" %}}

Install emcc:

```sh
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest

./emsdk activate latest
source ./emsdk_env.sh
```

This compiles the C to ---> html, js, wasm (this is our WASM Module)
```sh
#emcc helloworld.c -o helloworld.html
emcc -o hello.html hello.c
```

See what was created:

```sh
python3 -m http.server 8080 #choose any port
```

To run wasm inside docker: you need to enable it as Beta feature at this time of writing

```sh
sudo apt-get install ./docker-desktop-4.27.2-amd64.deb
#settings -> features in development -> Enable WASM
```

Now instead of compiling the html or js app, we will just compile the .wasm module:

```sh
emcc -o hello.wasm hello.c

#ll hello.wasm
#file hello.wasm
```

Create your DockerfileWasm

```Dockerfile
FROM scratch

COPY helloworld.wasm /helloworld.wasm
ENTRYPOINT [ "/helloworld.wasm" ]
```

Build your WASM Image
```sh
docker buildx build --platform wasi/wasm -t fossengineer/helloworld-wasm -f DockerfileWasm .
#docker image ls | head
```

Run WASM with Docker:

```sh
docker run --platform wasi/wasm --runtime io.containerd.wasmedge.v1 fossengineer/helloworld-wasm
```

Run an already created [WASM (as standalone)](https://wasmedge.org/docs/start/getting-started/quick_start_docker/#run-a-standalone-wasm-app) with docker:

```sh
docker run --rm --runtime=io.containerd.wasmedge.v1 --platform=wasi/wasm secondstate/rust-example-hello:latest
```


{{% /details %}}

14 changes: 13 additions & 1 deletion content/docs/NIX/fav-apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ This installs a Nextcloud Client. [You can also have your own Nextcloud Server](
flatpak install flathub com.hunterwittenborn.Celeste
```

As simple as this, you have support for Google Drive or Proton Drive (among others) in Linux.
As simple as this, you have support for Google Drive or **Proton Drive** (among others) in Linux.

You can have a look also to FreeFileSync, RClone as well.{{< /tab >}}
{{< tab >}}**Weylus**: [A great App](https://github.com/H-M-H/Weylus) to use your Table as a second (Touch) Screen.
Expand All @@ -82,6 +82,7 @@ This installs a Nextcloud Client. [You can also have your own Nextcloud Server](
{{< /tab >}}
{{< tab >}}**App Fleet**:
Create workspaces for your Desktop

```sh
curl https://raw.githubusercontent.com/omegaui/app_fleet/main/network-install.sh | bash
```
Expand Down Expand Up @@ -191,6 +192,17 @@ If you want to make your life easier, check how to install them with [Chocolatey
* https://2fas.com/browser-extension/
* https://bitwarden.com/download/

### What about PWA?

Progressive Web Apps can fit any form factor (desktop, mobile, tablet, or forms yet to emerge).

They are also Connectivity independent – Service workers allow apps to work offline or on low-quality networks.
And they are App-like – Feel like a native app to the user with app-style interactions and navigation, plus they can be distributed without using the Google/Apple stores, simply use them with a browser and *no installation required**.

* Hand Written notes in browser - [ExcaliDraw](https://github.com/excalidraw/excalidraw)

* More Ideas? [Awsome-PWA](https://github.com/hemanth/awesome-pwa)

### What about the remaining 20% of people and 20% of use cases?

First, I did not want to make this a really complex and long list.
Expand Down
1 change: 1 addition & 0 deletions content/docs/Privacy/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ How this also resonates with Linux?
Well, nature of crypto is F/OSS (if it is not you better run):

* Many [wallets](https://ethereum.org/wallets/find-wallet) are F/OSS
* You can explore them with F/OSS tools like the [PWA Merklin](https://github.com/toniengelhardt/merklin)
* Smart Contracts are F/OSS
* And [dApps](https://dappradar.com/) sense is also F/OSS
* And you can have a look to full history of transactions: [ETH](https://etherscan.io/txs), [BTC](https://bitcoinexplorer.org/)...
Expand Down

0 comments on commit 7f1cafb

Please sign in to comment.