Showing posts with label Linux Mint. Show all posts
Showing posts with label Linux Mint. Show all posts

Wednesday, May 29, 2024

Making your own Saktumiva server using Ubuntu

The following are instructions for using the command-line interface to set up your own instance of Charles Li’s Saktumiva (Upama) on your own Ubuntu-type server.* You’re going to be working in /var/www a lot, so you need to use sudo for almost all commands. Unless otherwise stated, you’ll do all these commands in the /var/www directory. I’m assuming that you sit in /var/www and to download files to that location, etc., using sudo all the time. (or just becoming root for a while sudo su).
  1. Install apache2 (not nginx; it probably works, but we’re doing apache2 here). 

     sudo apt-get install apache2  

    You will then have a directory /var/www/html which is where all your later files for Dokuwiki and Upama will go. Next, create a file  

    /etc/apache2/sites-available/dokuwiki.conf  

    with the contents

    <VirtualHost *:80>
      ServerAdmin <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b1d0d5dcd8dff1d4c9d0dcc1ddd49fd2dedc">[email protected]</a>
      DocumentRoot /var/www/html/
      ServerName your_domain_or_IP
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>

    Replace "your_domain_or_IP" with the public IP number of your server. (I got the above from /etc/apache2/sites-available/dokuwiki.conf and I’m not certain it is necessary.) 

  2. Install php and extras:

    sudo apt install php php-xml php8.1-mbstring

  3. Install Dokuwiki by following the instructions at https://www.dokuwiki.org/install. Broadly, you fetch the file dokuwiki-stable.tgz by saying

    cd /var/www sudo wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz

    And then you’ll unpack the tgz file into /var/www/html using the commands

    cd /var/www/html sudo tar xvf /var/www/dokuwiki-stable.tgz -C /var/www/html 

    The -C arguments above tell tar to unpack the archive to the /var/www/html directory. You should then have a directory called something like /var/www/html/dokuwiki-2024-02-06a. Rename it to just ./dokuwiki:

    sudo mv  /var/www/html/dokuwiki-2024-02-06a /var/www/html/dokuwiki

  4. Now fetch the Upama plugin from Github:

    cd /var/www sudo git clone https://github.com/chchch/upama.git

  5. Install Upama. Charles explains what to do at the bottom of this page: https://github.com/chchch/upama . There’s no installation as such; all you do is copy the files to the right dokuwiki directories.

    To be more explicit, do the following:

    cd /var/www (where you now have an upama directory)

    Now copy the folders and files from the upama directory into the dokuwiki directory:

    sudo cp -r /var/www/upama/dokuwiki/* /var/www/html/dokuwiki/

    The folders that get copied are /var/www/upama/dokuwiki/data -> /var/www/html/dokuwiki/data /var/www/upama/dokuwiki/lib -> /var/www/html/dokuwiki/lib  

    One last thing:

    sudo touch /var/www/html/dokuwiki/data/pages/sidebar.txt  

    This creates the empty file /var/www/html/dokuwiki/data/pages/sidebar.txt

  6. Set some file permissions and ownership. This is a bit of a nightmare, and www.dokuwiki.org’s documentation is awful. But all your really need to do is this: sudo chmod -R 777 /var/www/html/dokuwiki/data/ sudo chmod -R 777 /var/www/html/dokuwiki/lib/ sudo chmod -R 777 /var/www/html/dokuwiki/conf/ sudo chown -R www-data:www-data /var/www/html/

  7. Next, some necessary apache stuff I got from https://forum.dokuwiki.org/d/9893-the-datadir-pages-at-data-pages-is-not-found/4 . We’ve already done the stuff up to Step C. Now edit the file apache2.conf. I use the editor vi; pick your favourite non-graphics editor.

    sudo vi /etc/apache2/apache2.conf 

     Find the lines

    <Directory /var/www/>
    ...
    </Directory>

    and below them add the following two new sections:

    <Directory /var/www/dokuwiki>
    order deny,allow
    allow from all
    </Directory>

    <LocationMatch "/(data|conf|bin|inc)/">
      order allow,deny
      deny from all
      satisfy all
    </LocationMatch>

    Then restart the apache server: sudo service apache2 restart Open a new browser tab and go to the page <my_IP_address>/dokuwiki/install.php This should open a page of dokuwiki settings. This page only appears the first time you invoke it; later, you get instructions on how to change things in a more low-level manner. At your dokuwiki page, log in and go to Admin/Configuration Manager. Amongst the initial “Basic” settings, find the setting for “template” and change it from “dokuwiki” to “saktumiva”. It looks like this:

     

    And go to the bottom of the screen and hit "save". 

  8. Stay with me. We’re almost done. The next thing is to add some TEI files of your edition.They are going to live in this directory:

      cd /var/www/html/dokuwiki/data/pages/wiki/  

    Create a file structure under wiki/ that makes sense to you. For example, sudo mkdir /var/www/html/dokuwiki/data/pages/wiki/Sakuntala/

    Copy your TEI files into ../Sakuntala/.  

    sudo cp /home/me/Documents/SaktutalaTEIfiles/* /var/www/html/dokuwiki/data/pages/wiki/Sakuntala

    Remember that the files need the extension .txt, even if they are xml files.

    You can also create a file start.txt in the ../Sakuntala/ directory that contains a nice starting page for your project. This must be written in dokuwiki syntax (cheatsheet).

  9. At this point, you should have a usable system. However, there’s a useful tweak. If you are going to upload your TEI files from your desktop to your new Saktumiva server by ftp, perhaps using Filezilla, you will want to change the ownership of files under ../Sakuntala/ so that your ftp identity can write files to that directory. sudo chown -R <me>:<me> /var/www/html/dokuwiki/data/pages/wiki/Sakuntala/

    where “<me>” is your Filezilla ftp login username. (You can set up users in Dokuwiki under Admin/User Manager).

  10. Other tweaks.
    • If your collation-generation times out, try upping the max execution in /etc/php8.1/apache/php.ini.
    • If your installation can't find symlinked files under directories, try adding the option +FollowSymLinks to  /etc/apache2/sites-enabled/000-default.conf:

      DocumentRoot /var/www/html
              <Directory />
              Options +FollowSymLinks
              AllowOverride None
              </Directory>
    • As a variant of point 9. above, you may prefer to use Saktumiva on your own laptop or desktop, rather than from a remote server.  If you want to link files from somewhere else on your disk into the Dokuwiki data/pages/wiki directory, you need to use hard links, not soft, symbolic links.  In Unix, ln <target> <name> not ln -s <target> <name>.   And if you want to be able to edit them through the Dokuwiki interface, say
      cd /var/www/html/dokuwiki/data/pages/wiki/Sakuntala/
      sudo chown -R <me>:www-data Sakuntala
      so that you are the "owner" but the "group" is still Apache.

-----------------------------------

*This installation guide by Christas Pontikis is very helpful: 

Dominik Wujastyk

June, August 2024

Friday, April 22, 2022

Linux Mint Cinnamon problem and fix

 I recently installed and used a Python program, internetarchive.  Somewhere along the line of installing it with pip, the Python setup on my machine got changed, not in a good way.  Lots of Python programs are apparently very sensitive to Python version numbers.  

The symptom was that sound stopped working on my system (except in Zoom, which evidently handles its own sound subsystem).  Then, sound menu wouldn't come up.  Then the Cinnamon system settings control centre, cinnamon-settings, wouldn't come up. It generated an error saying that it couldn't find "requests."   At another time, it couldn't find "urllib3".  

Cut a long story short, running

sudo apt reinstall requests urllib3

fixed the problem.



Wednesday, June 03, 2020

The demise of gksudo from Ubuntu-based distributions and what to do about it

I gather that there were good security-related reasons for discontinuing gksudo. But it's quite inconvenient not having it, for example when you are adding new items to the Linux Mint main menu (using menulibre, for example).

Here's what I do:
  • install ssh-askpass

  • add this line
    SUDO_ASKPASS=/usr/bin/ssh-askpass
    to the file
    /etc/environment
  • Then, in menu or batch commands that you want to pop-up a graphical p/w prompt, say
    sudo -A <command>

Thursday, February 06, 2020

Automounting google-drive-ocamlfuse: getting Google Drive to appear as a Linux folder

This is well documented elsewhere, but just for clarity, here are my settings, that work. I.e., the Google drive appears automatically mounted after a fresh boot.

1. Install google-drive-ocamlfuse

2. Line in /etc/fstab (all one line):
gdfuse#default  /home/dom/GoogleDriveUofA    fuse    uid=1000,gid=1000,allow_other,user,_netdev     0       0

3. Contents of executable /usr/bin/gdfuse
#!/bin/bash
su dom -l -c "google-drive-ocamlfuse -label $1 $*"
exit 0

Tuesday, April 30, 2019

Linux Mint 19.1 Cinnamon and display flickering

When I upgraded to Linux Mint 19.1 with Cinnamon, I encountered a problem that my screen flickered immediately after logging in.  Others encountered the same problem (here).
I found that the solution proposed there, i.e., to delete the line
CLUTTER_PAINT=disable-clipped-redraws:disable-culling
from the file
/etc/environment
worked for me.  Logging out and back in after that change gave me a stable display.

Monday, July 09, 2018

Tweaking the Thinkpad's TrackPoint settings in Linux Mint 19

With the update to Linux Mint 19 Cinnamon, the sliders controlling the trackpoint's accelleration and speed on my Thinkpad T560 and T500 don't work any more.  I expect it will get fixed soon.  Meanwhile, as root I  can manually edit the parameters in the filesin the directory
  • /sys/devices/platform/i8042/serio1/serio2
The above directory is found by
  • find /sys/devices/platform/i8042 -name name | xargs grep -Fl TrackPoint | sed 's/\/input\/input[0-9]*\/name$//'
Settings are reset at reboot.  :-(

I like sensitivity 125 and speed 80 on the T560; 190 and 90, inertia 10, on the T500.

Update


I found this solution (X1 parameters) that automates everything and survives reboot :-)

Another update, March 2020

Lalufu at github said,
You can also use xinput to modify the libinput values directly:
Run xinput to show the pointers the system knows about. If you have a ThinkPad you should see something along the lines of TPPS/2 IBM TrackPoint or similar.
xinput --set-prop "TPPS/2 IBM TrackPoint" "libinput Accel Speed" -0.5
will modify the pointer speed. Play around with the value to see what you like. If you want this to survive a reboot you can stick this in .bash_profile.

Tuesday, June 13, 2017

Del latitude xinput settings

See https://askubuntu.com/questions/688270/mouse-speed-too-fast

Put the following commands in a file (foobar.sh), make the file executable (chmod +x foobar.sh), and then run it.

#!/bin/sh
xinput --set-prop "AlpsPS/2 ALPS DualPoint Stick" "Device Accel Constant Deceleration" 8
xinput --set-prop "AlpsPS/2 ALPS DualPoint Stick" "Device Accel Velocity Scaling" .8
xinput --set-prop "AlpsPS/2 ALPS DualPoint Stick" "Device Accel Adaptive Deceleration" 8


You can run this command on startup from the Startup Applications menu.

Monday, May 15, 2017

IBUS bug fix ... again (sigh!)

Further to https://cikitsa.blogspot.ca/2012/01/ibus-bug-fix.html, I found the same bug cropping up in Linux Mint 18.1, with IBUS 1.15.11.

Some applications don't like IBUS + m17n, and certain input mim files. For example, LibreOffice and JabRef.  Trying to type "ācārya" will give the result is "ācāry a". And in other strings, some letters are inverted: "is" becomes "si" and so forth.

Here's the fix.

Create a file called, say ibus-setting.sh with the following one-line content:
export IBUS_ENABLE_SYNC_MODE=0
Copy the file ibus-setting.sh to the directory /etc/profile.d/, like this:
sudo cp ibus-setting.sh /etc/profile.d
Make the file executable, like this:
sudo chmod +x /etc/profile.d/ibus-setting.sh
Logout and login again.

Phew!

This fixes the behaviour of IBUS + m17n with most applications, including LibreOffice and Java applications like JabRef.  However, some applications compiled with QT5 still have problems.  So, for example, you have to use the version of TeXStudio that is compiled with QT4, not QT5. [Update September 2018: QT5 now works fine with Ibus, so one can use the QT5 version of TeXstudio with no problem.]

Friday, December 11, 2015

Linux Mint swapfile

Getting the swap file working in Linux Mint.  Using LVM

sudo /sbin/mkswap /dev/mapper/foobar [e.g., mint--vg-swap_1]
sudo swapon -a

Thursday, August 07, 2014

Linux Mint 17, Cinnamon, Firefox 31 = freeze

I've been very happy with Linux Mint 17, and the Cinnamon GUI.
Except for the occasional system freezes.  This happened usually when I was swapping between windows (alt+tab), and required a re-login.

I've spent some time looking around the web and trying to diagnose the problem.  I've found one change that seems to have cleared up the problem, and I am not aware that anyone else has mentioned it yet.  I've uninstalled Firefox (31), and replaced it with Google Chrome.  I haven't had a freeze since doing that.  Fingers crossed.