22 May, 2018

Arch Linux: Guitarix Settings

Here's how to connect your electric guitar to a Linux system. In this case Manjaro (Arch Linux).

Jack connections: Qjackctl

Guitarix: note the connections between input and output.

Latex: reference to a figure / image

How to make the see page X trick

First: the figure

\begin{figure}
  \includegraphics[width=\linewidth]{images/at-i.jpg}
  \caption{XXX}
  \label{fig:XXX}
\end{figure}\index{XXX}

Now the reference to the illustration:

... see page~   \pageref{fig:XXX}


15 May, 2018

[ SOLVED ] Arch Manjaro: WordPress REST API error 404

Error 404: WordPress REST API on a localhost


WordPress runs on my Manjaro distro of Arch Linux. But the REST API does not work at all. I have tried:


  • Install the plugin via git pull https://github.com/WP-API/WP-API.git 
  • Set the folder permissions to 777
  • Reset the WordPress database after pretty links disaster
  • Reinstall the plugin from git pull https://github.com/WP-API/WP-API.git
Mostly I get error 401, but sometimes it's 502.

Ideas?

---

A fellow lecturer suggested to edit /etc/httpd/conf/httpd.conf :

Quote from this page:
"When the server finds an .htaccess file (as specified by AccessFileName), it needs to know which directives declared in that file can override earlier configuration directives.
Only available in sections

AllowOverride is valid only in  sections specified without regular expressions, not in  or  sections.
When this directive is set to None and AllowOverrideList is set to None.htaccess files are completely ignored. In this case, the server will not even attempt to read .htaccess files in the filesystem.

When this directive is set to All, then any directive which has the .htaccess Context is allowed in .htaccess files."
After that a directory as added that pointed to WordPress:
    AllowOverride All
    AllowOverrideList All
    Require all granted
In a WordPress forum an author suggested to change the permalinks to "post name". The .htaccess file had to be created, with this content:


   RewriteEngine On
   RewriteBase /wordpress/
   RewriteRule ^index\.php$ - [L]
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule . /wordpress/index.php [L]


After a restart of Apache the REST API responded correctly:

# sudo systemctl restart httpd

Et voila!

Json from the REST API

Install themes / plugins

In order to install themes and plugins the owner of the folders should be the Apache user http, so:

# chown -R http:http wordpress/

And so the WordPress installation is ready to fly on the localhost.



10 May, 2018

Apache: how to use a local folder for your code on localhost


  1. Create a folder for your html
    # mkdir ~/html_root
  2. Create a symbolic link in /srv/html/
    # sudo ln -s /home/USER/html_root/ X
  3. Write your code, and test it in a browser, as in:
    # http://localhost/X/

[SOLVED] Install WordPress on a Arch Linux Manjaro LAMP Stack

Bingo! WordPress up and running on Manjaro (Arch Linux)


I followed this recipe. Found on HowToForge.

[SOLVED] Arch LAMP Server PHP Problems

At last! The LAMP stack is up and running. 


At last I found a recipe that created the ArchLinux LAMPP. 



Unfortunately you have to fight idiotic popups and similar all of the time, but the article is sane and easy to follow.


What I struggled with
PHP cannot execute the files in Arch:

* PHP 7.2.5 (cli) (built: Apr 24 2018 18:12:24) ( NTS )
* Linux XXXXX 4.14.39-1-MANJARO #1 SMP PREEMPT Wed May 2 19:03:39 UTC 2018 x86_64 GNU/Linux

MySQL is up and running, and so is Apache. The problem is probably the settings in /etc/httpd/conf/httpd.conf

Next Morning
Tried, tried, reinstalled everything from rock bottom again. No success. The instructions on the Arch wiki don't work (for me at least).

After 4 hours of struggle I gave up - installing a LAMP server should be a nobrainer, as in Ubuntu. Now I try to build ... of all things in Hell ... xampp!

XAMPP
After waiting more than an hour for the Xampp binaries the thing was dropped. Which was very fortunate. I have some bad experiences from previous Xampp usage ... so WTH. Don't care now.

08 May, 2018

Research WordPress REST API

Research for the next semester's classes on the WordPress REST API. 


Learn web code: WP REST API

Headless WordPress Sample
The next tutorial is more beginner oriented. From WP install on MAMP to a REST API introduction to the jSon objects - and a practical implementation of JavaScript in a theme, plus sevearal usefull plugins. The video will show how to get the jSon, but not how to implement it via AJAX. That's for "the next video". Parbleu!

Continued on Github
The videos above hinted at a solution. On WordPress I used a plugin in order to create a child theme. Then the JavaScript / jQuery was added, and I developed an AJAX solution that would fetch the jSon data.





05 May, 2018

Arch Linux: MySQL

MySQL up and running


Here's the guide that helped setting up MySQL in Manjaro. The pixi version is here:

sudo pacman -S mysql
sudo systemctl start mysqld
sudo mysql_secure_installation
mysql -u root -p

02 May, 2018

XFCE Create Program Launcher

  1. Right click on the desktop somewhere
  2. Select create program launcher
  3. Fill in the form, select icon etc.
  4. Chmod a+x YOURLAUNCHER
XFCE: create a program launcher

01 May, 2018

Spotify on Arch Manjaro

Spotify on Arch Manjaro.
Dylan's Knocking on Heaven's Door
seems strangely appropriate.



Spotify is up and running. Since the package is from a Debian based distro Snap is a solution (read: "the solution")


# snap find spotify
# snap install spotify

and then

# snap run spotify

Now the only thing I need is a file that will launch the app with a nice icon for the desktop. But that's for tomorrow.

First things should go first. Because in order to run snap you have to install snap. In case you don't have it:

# pacman -S snapd

It's time to try a new distribution

The Manjaro XFCE desktop with my keyboard bokeh as background.


Now I run the new kid on the blog Arch based Manjaro distro with a XFCE desktop. It's a superfast system with a lightweight distro on a decent PC.

Manjaro use the Linux 4.14.36-1-MANJARO GNU/Linux kernel. Updates are rolling.

Installing Manjaro
  • Unplugged the /home drive (a 2TB harddisk)
  • Installed Manjaro on the SSD stardup disk
  • Added a user
  • Replugged /home disk
  • Followed this guide
First I had to find the /home disk ID by:

# blkid

Then /etc/fstab was edited and this info was added:

# UUID=b87ebb56-f4df-43ee-918a-fa69xxxxxxxx   /home    ext4          defaults       0       2

A nice surprice
After a reboot the system was up and running. To my surprise the users could access their shares immediately. And a very pleasant surprise was the fact that even shortcuts from Nautilus was preserved and ready for use in the XFCE file manager Thunar.

Even symbolic links to certain shared folders were preserved.

SSD - contemplating more real estate
Well my 120GB SSD ran full after an Ubuntu SQL update of some kind. I tried to solve the problem by a new install, but Ubuntu was not able to do a decent dist-update.

After several crashes I decided that enough was enough. So I droppedUbuntu (for a while I guess ...)

The real problem isn't Ubuntu but the fact that the SSD should have more GBs. I guess that it is necessary to follow the development on the boot drive or to update the hardware.