Showing posts with label computer. Show all posts
Showing posts with label computer. Show all posts

Installation steps /script snippets for Open Web-UI on Debian

This is just a quick info dump for my own future reference, an anyone else who might benefit. Many parts are uncertain and should be investigated for clean up. But it works, and I have other priorities. Apologies at the mess and hard to read order, but there are plenty of other nice walkthroughs that I followed for this. I recommend one of them instead as your base, and this just as a reference.


Now, how to do code blocks in this interface...? Alas, not in the base offering of Blogger... Yuck.


  • System: Debian trixie/sid mixed with many stable packages, as of 2025-06-14.
  • Desireable: A remote access method, such as tailscale or easily opened and secured ports.
  • Option selected: A more native python based, rather than the docker container option.

Install pipx and dependencies via package manager of choice.

Configure some settings files in the directory, especially environment variables.

Here is a dump of my files / scripts used. Adjustments are needed.

First section includes multiple files, which should be configured per your system needs.


::::::::::::::
open-webui.env
::::::::::::::

# ==========================
# Open WebUI Environment (.env)
# ==========================
# refer https://docs.openwebui.com/getting-started/env-configuration/#overview

# - Non-PersistentConfig variables can be changed at any time and will take effect on restart.

# Bind to 0.0.0.0 for LAN access (default port 8080)
WEBUI_HOST=0.0.0.0
WEBUI_PORT=8081
# FIXME: used?
HOST=0.0.0.0
PORT=8081

# disable telemetry
# Telemetry/analytics controls (not PersistentConfig)
SCARF_NO_ANALYTICS=true
DO_NOT_TRACK=true
ANONYMIZED_TELEMETRY=false


# ==========================
# Unknown if PersistentConfig

# Enable audio in / out features
## Speech-to-Text (STT) configuration for DeepInfra
AUDIO_STT_ENGINE=openai
AUDIO_STT_MODEL=whisper-large-v3-turbo
# FIXME: or is it?
# AUDIO_STT_ENGINE=openai
# AUDIO_STT_MODEL=openai/whisper-large-v3-turbo
## Text-to-Speech (TTS) configuration for DeepInfra
AUDIO_TTS_ENGINE=hexgrad
AUDIO_TTS_MODEL=Kokoro-82M
# FIXME: or is it?
# AUDIO_TTS_ENGINE=openai
# AUDIO_TTS_MODEL=hexgrad/Kokoro-82M
# Many voice choices: https://deepinfra.com/hexgrad/Kokoro-82M/api?example=http
AUDIO_TTS_VOICE=af_bella


ENABLE_ONEDRIVE_INTEGRATION=True
# UNKNOWN: ONEDRIVE_CLIENT_ID


# Description: Specifies the base directory for data storage, including uploads, cache, vector database, etc.
# FIXME: Use XDG instead.
DATA_DIR=/home/USERID/Projects/Open-webui/OpenWebUI_Data

# ==========================
::::::::::::::
open-webui.env.first_run_lan
::::::::::::::
# ==========================
# Open WebUI Environment (.env.first_run_lan)
# only first run
# ==========================
# Allow open access
# Disable user authentication (WARNING: insecure, use only in trusted LAN)
# Disable user accounts and authentication
# User/account/authentication controls
ENABLE_SIGNUP=False
WEBUI_AUTH=False


::::::::::::::
open-webui.envish.first_run
::::::::::::::

# To be sourced.

# ==========================
# Open WebUI Environment (open-webui.envish.first_run)
# only first run
# refer https://docs.openwebui.com/getting-started/env-configuration/#overview
# ==========================
mkdir -p "${HOME}"/Documents/OpenWebUI

# DeepInfra API configuration
OPENAI_API_BASE_URL=https://api.deepinfra.com/v1      # PersistentConfig: Yes
# OPENAI_API_KEY=your_deepinfra_api_key_here            # PersistentConfig: Yes
export DEEPINFRA_TOKEN=$(pass show Passwords/api.deepinfra.com)
OPENAI_API_KEY=$DEEPINFRA_TOKEN

# Default language/locale
# DEFAULT already, but for good measure.
DEFAULT_LOCALE=en-US                                     # PersistentConfig: Yes

# Enable image generation (set to True since DeepInfra supports it)
ENABLE_IMAGE_GENERATION=True                          # PersistentConfig: Yes

# include OLLAMA_BASE_URL since using Ollama locally.
OLLAMA_BASE_URL=http://NAME_OF_LOCAL_HOST_IN_REMOTELY_ACCESSIBLE_FORM:11434  # PersistentConfig: Yes

# ==========================
# Notes:
# - PersistentConfig variables are only read from this file on FIRST LAUNCH.
#   To change them later, use the Open WebUI interface or clear the internal config.
Now ready to try an installation. At a regular bash prompt:

mkdir -p ${HOME}/Tmp/Pip_Cache # outside of tmpfs (which is too small)
TMPDIR="${HOME}"/Tmp/Pip_Cache pipx install open-webui   # Alternatively "--no-cache-dir"
sudo ufw allow 8081

Next, first run including configuration

:::::::::::::: open-webui.init.sh ::::::::::::::

# preload password-repo

# safer, but not support pass calling : Export variables: export $(grep -v '^#' ~/.open-webui/.env | xargs)
source ./open-webui.envish.first_run
export $(grep -v '^#' ./open-webui.env.first_run_lan | xargs)
export $(grep -v '^#' ./open-webui.env | xargs)
echo is DATA_DIR correct?  : $DATA_DIR
open-webui serve --host $WEBUI_HOST --port $WEBUI_PORT
:::::::::::::: open-webui.run.sh ::::::::::::::

# safer, but not support pass calling : Export variables: export $(grep -v '^#' ~/.open-webui/.env | xargs)
export $(grep -v '^#' ./open-webui.env | xargs)
open-webui serve --host $WEBUI_HOST --port $WEBUI_PORT
:::::::::::::: open-webui.upgrade.sh ::::::::::::::

TMPDIR="${HOME}"/Tmp/Pip_Cache pipx upgrade open-webui   # Alternatively "--no-cache-dir"

That is what I did.

Book recommendations and recent reads

Be aware, I feel books worth reading are ones that should affect your thinking on the world, your world view.  That means they should impact the most controversial topics…

 

 

Latest Reads - In Progress

               Christian Bible

               (Currently going through the book of Proverbs. I find the Contemporary English Version the translation I like the best, with World English Bible  being the freely available translation I like. The section of the Gospel of John and the 1st Letter to the Corinthians by Paul are good places to start, and the whole is beneficial.)

               Security Engineering by Ross Anderson:https://www.cl.cam.ac.uk/~rja14/book.html

               (It is slow going for me due to time constraints and the large size, but I like it.)

 

Latest Reads finished

               Francis Bacon's New Atlantis

 

Recommended

               U.S.A. Constitution and amendments

               DVZine 

               The Cathedral and the Bazaar

               Transparent Society

(Both an article and a book. Previously shared this with some in SBD on Teams)

In the Beginning was the Command Line

               (Excellent discussion of user interfaces approaches)

             Hackers, Heroes of the Computer Revolution by Steven Levy

               E-Books by Jules Verne at Project Gutenberg, https://www.gutenberg.org/ebooks/author/60

               E-Books by many other freely available at Project Gutenberg

 

Longer list (but still incomplete) available at

               https://www.librarything.com/catalog/hrabbey

               or

               https://www.goodreads.com/review/list/155915753-howard-abbey

               (My rating scale is 1 = worth reading, 3 = really good, 5 = a must read)

 

 

Another tidbit:

My wife Jodi is a voracious reader, helps with our church library, and enjoys helping people find books that they might enjoy reading.

 

Enjoy,

Howard

How to Identify What Number is Your Font Character

This is a bit of an update / extra information for the information found at http://scripts.sil.org/UTTUsingUnicodeMacros (also archived at the Internet Archive).
It was written in 2005, but I found it still useful.
However, the toolbar icon mentioned in that page was not found in Office 2010.

Below is another method for identifying the computer encoding number associated with a character one has but does not know.

In Windows 7, there is Private Character Editor (eudcedit.exe), which can be started from search box of Start menu.  It requires administrative permissions to run.
Once opened,

  • Select an empty box to open a character editor.
  • Make sure in upper left, Character Set selected is Unicode
  • Select on the menu Edit, then Copy Character
  • Click in the Shape box to activate.
  • Paste in a single unknown character of interest from the Windows clipboard, and the numeric code should be listed above it in hexadecimal.
This was the easiest way I found to identify non-ASCII characters.

The two characters I was looking for were ° (0x00B0) and ℃ (0x2103).

To go from number to display of character to copy, charmap.exe is the program I recommend using.

Method to import contacts from CardMunch to Google Contacts

The script below is my method of importing contacts from CardMunch to Google Contacts.  It could be useful for any address book which imports VCF files.
It automates part of the work, but much still is manual.

CardMunch is an iOS app and service purchased by LinkedIn that digitizes pictures of business cards into an address book, with export (one by one) to iOS contacts, and to e-mail.
Since I am using Google Contacts, I want to automate the transfer as much as possible.  I feel it is still easier than typing cards in by hand, although I am not confident of that.

Method to post code snippets on Blogger

Blogspot method used to post code blocks, courtesy of gt-ebuddy at
http://stackoverflow.com/questions/679189/formatting-code-snippets-for-blogging-on-blogger/8697421#8697421 :
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; 
                color: #000000; background-color: #eee;
                font-size: 12px; border: 1px dashed #999999;
                line-height: 14px; padding: 5px; 
                overflow: auto; width: 100%">
       <code style="color:#000000;word-wrap:normal;">

            <<<<<<<YOUR CODE HERE>>>>>>>

       </code>
</pre>
Depending on if using compose or HTML window, may need to adjust option of Compose Mode "Show HTML literally" or "Interpret typed HTML".

DropBox usage tip: Pseudo-secure sharing

Dropbox is a free 2 Gig cloud file storage service.  It also allows sharing files.

To give a mid level of security, you might consider using the public directory, but adding 8 random characters to the directory name of each share.
Dropbox does not let users see the directory contents, but lets anyone access if they know the full file URL.

If I was to regularly start sharing, I would do something like:
DropBox_Dir/Public/Shared with Company A/2011-11-30-2tVhh2E8/file.zip
which equals download URL http://dl.dropbox.com/u/7099970/Shared%20with%20Company%2A/2011-11-30-2tVhh2E8/file.zip
DropBox_Dir/Public/Shared with Company B/2011-11-30-RrH8HZ5k/file.zip
DropBox_Dir/Public/Shared with Company A/2011-12-01-F7XyvwXj/file.zip
DropBox_Dir/Public/Shared with Company B/2011-12-02-Jh5Ts2GE/file.zip

These would get shortened via dropbox's URL shortener to
http://db.tt/ABCDEFGH , but the expansion would be seen afterward.
A regular pattern would be easy to predict.
Adding a string acts as a password.  The password generator I use is built into the LastPass web browsing plugin, but many are available.

The more hassle option is to have all users join dropbox, and then the sharer selects who to share files / folders with.  For my sharing applications, that was not an option.

Here is my Drop box referral code if you ever want to use it:  http://db.tt/c9XSDu3r.
Enjoy.


Originally posted 11/30/2011 5:12 PM EST.
Updated 2/4/2013 to fix 2 typos.  Also adding note below:
Note creating a db.tt short link decreases security.  It provides a less secure way to access it, although it would be only be discoverable by pure random checking of many short links, not limited to any particular user.

Portable Frozen Bubble on Microsoft Windows

Portable Installation walk-through for Frozen Bubble 2.2.1beta1 on Microsoft Windows

It is a bit complex. 
Perhaps best overall would be to use a live CD of Linux or install a Linux distribution.  Then frozen bubble, and many other games and programs, would be just a few clicks away.
Check first if a Windows version is available at www.frozen-bubble.org/.
Also, if you know someone who has the portable version already, copying it seems to work.  It is GPL, so it is legally free to copy.  The compressed size is 94.3MB, so I have not mirrored it on-line.  (Probably it can be made a lot smaller by trimming out downloaded sources, and unneeded perl modules.)

Both regular installation & a portable installation are possible.
I used the portable version, allowing putting it on a removable drive and running from any Windows computer.  This needs slightly more set-up however. 

Regular instructions
mirrored from Frozen Bubble on FaceBook.
----------------------------------------
Windows Install:
1. Download and install Strawberry Perl @ http://strawberryperl.com/
2. After install press Windows key + R.
3. type: cpan Games::FrozenBubble (Step 3 takes about 30mins to download and install.)
4. Press Windows key + R
5. type: frozen-bubble
Do step 4 and 5 each time to launch the game or create a .bat file to launch it.
----------------------------------------
Updating is done by just re-running: cpan Games::FrozenBubble

Portable Frozen Bubble for Windows:
The portable installation walk-through below is an expansion and modification of the regular installation.

System Requirements: About 399 MB.
Other requirements unknown.  Refer to Strawberry Perl, and perhaps SDL.

Installation:
1. Download Strawberry Perl portable.
It can be found at http://strawberryperl.com/
I used "strawberry-perl-5.12.3.0-portable.zip".  It is 54.4 MB.
2. As described in "README.portable.txt", extract strawberry portable ZIP into e.g. c:\myperl\
  Note: choose a directory name without spaces and non us-ascii characters.
3. Double click / run "portableshell.bat"
4. Enter in cmd window : cpan Games::FrozenBubble
If it seems like it had errors, or if later steps do not seem to work, running it again might fix problems. 
5. Wait until complete.  Can take 30 minutes to a couple hours to download and configure, depending on network speed and computer speed.
6. Enter: frozen-bubble
7. To exit game, press Esc.
8. To exit cmd window, enter: exit

Running basically installed game:
A. Find directory of Strawberry Perl portable.
B. Double click / run "portableshell.bat"
C. Enter: frozen-bubble
D. To exit game, press Esc.
E. To exit cmd window, enter: exit

Intermediate level of installation:
F. Copy "portableshell.bat" to "frozen-bubble-start.bat".
G. Edit in WordPad (under All Programs, Accessories) or other favorite text editor that handles Unix format files.  (Notepad will not work.)
H. Change last line from:
---
cmd
---
to
---
echo Starting frozen-bubble...
frozen-bubble
---
I. Save as text.
J. Click and drag "frozen-bubble-start.bat" to start menu, all programs, and place it where on the menu you would like it.  A shortcut copy will be created.
K. Now select "frozen-bubble-start.bat" or "Shortcut to frozen-bubble-start" in the menu to start Frozen Bubble.
L. To change the name in the menu, right click on the "Shortcut to frozen-bubble-start" menu item, and select "Rename".

Advanced level of installation:
M. To change the icon, right click on the "Shortcut to frozen-bubble-start" menu item, and select "Properties", then "Change icon".
Files convertable into a windows icon with Gimp can be found at someplace like:
...\strawberry-perl-5.12.3.0-portable\cpan\build\Games-FrozenBubble-2.212-yVOabf\share\icons

Enjoy!


Other Notes:
It seems that this is not exactly the official frozen bubble, as some tweaks were made to it.  So it should be considered an unoffical port, until something is available from the main frozen bubble web site.

I could create a batch script file to do basic and part of intermediate installation, which would depend on wget.exe.  However, it would require updating the stawberry perl link occasionally, and I hope the below walk-through is simple enough.  Once the 2.2.1 version becomes considered stable (or before), I hope a fancier Windows-style installer will become available.  I do not have experience with creating such installers.

Possible options investigated:
    Via Stawberry perl
     WinXP available, but older windows seem to not be supported; Linux boot USB/CD better in that case.
        Works!  Not widely obvious how though.  Hence I wrote it up.
    Live CD easiest?
     bootable for speed
     Emulateable via qemu for quick testing, easier use.
        Gives other programs, like gcompris, as well.
         GCompris not freely available on Windows.
        DouDou Linux seems a good choice for CD bootable.
    FB-win32 @ Sourceforge
        need perl 5.6.*,
         but no longer freely available from FB-win's linked to site.
    Brothersoft at http://www.brothersoft.com/games/frozen-bubble-download.html
     BAD source; tries to install ad-ware.
     AND: labelled as 2.2.0 for windows,
     but 2.2.0 supposedly not for windows.
     but in a bz2 archive, so hard to use, if possbile at all.
     Strongly suspect it is the Unix environment files.

This walk-through is placed in public domain, as described at the  Creative Commons Public Domain page.

Published Revision 2011-05-29-1750EDT