12 March, 2019

Manjaro: how to print a several copies

Problem: When I try to print several copies of a file, only one is printed, then the printjob is terminated.

Solution: a bash file, like this:

for i in {1..18}
do
  lp foo.pdf
done

20 February, 2019

Quicktime

How to trim a video (clip): CMD + T. A yellow box will appear. Trim and save. The video below saved my day.


06 January, 2019

Manjaro: NPM conflicting versions cannot update






Problem solved npm up and running again.
Problem: Could not update Manjaro after an update in NPM. The message was: "conflicting versions".


Solution: Removed all NPM packages, and then update was possible.

I guess the next step will be to reinstall NPM. It is of course unfortunate, since there is a lot of nodejs related stuff on my system. So I'll hope for the best ...

And here I was right. I cannot install NPM again! However there is a list of conflicting files, that exist in the system, even though NPM was removed. I guess that I have to remove these 11 files manually:

npm: /usr/lib/node_modules/npm/.licensee.json findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/ci-info/vendors.json findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/graceful-fs/clone.js findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/chownr/LICENSE findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/chownr/README.md findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/chownr/chownr.js findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/chownr/package.json findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/minipass/LICENSE findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/minipass/README.md findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/minipass/package.json findes allerede i filsystemet

Hypothesis: With my experience with NPM I guess that this may cause problems, if these files relate to something else. But ... without further ado I'll remove the problemmakers.

Experiment: remove 11 or so troublemakers.

In order to do so I created a bash script:

The "npm:" was replaced with "rm" in the Mousepad editor, and end of the lines " findes allerede i filsystemet" (danish for = "the file already exists in the file system") was removed in the same way. So the error message was transformed to a simple bash file.

Note the missing shebang (I admit, I'm lazy here but the thing worked for me). You'll have to run this as sudo, since one of the files is protected.

The next step is to reinstall npm.

Result: Success - NPM is now up and running version in 6.5.0. And pacman & co. are able to update the system.

29 November, 2018

Mac: fan running like mad

Now the CPU load seems normal

Problem: Fan running like mad. In top the CPU load was 80-90%. Only a few programs were opened, like Chrome, Atom and MAMP.

Solution: 

  1. Click  > sleep
  2. Wake the system up
  3. Click  > restart
Then the system acted normal.  A simple and effective cure for a weird behavior in the OS.

Compiz: Widow decoration invisible



Problem: Now and then after a reboot or restart of the system the window decorations disappear.

Solution: Open the Compiz Settings Manager and set a mark at "Enable Window Decorator" (translated from Danish - I'm not sure that these are the correct English wording, but see the illustration).

09 November, 2018

Outlook encrypt mail in a browser

Just click on the encrypt icon
In Europe I guess we have to encrypt our mails, at least when they contain sensitive personal information. I'm not sure whether this form of encryption is very secure, but at least I guess that the data is encrypted during transit.


  1. Write your mail
  2. Click encrypt
  3. Click the send icon

Problem: Send encrypted mail via Outlook to Gmail

You're told that a code will be sent to the email, however the code never arrived to gmail. If it's a standard issue, this encrypt system is useless. You cannot expect that all will use Outlook.

07 July, 2018

Epson ET-2750

Epson ET-2750 on my LAN.


Epson has released printer drivers for Linux, but the drivers are not made for Arch Linux. I downloaded the drivers, and found the relevant .pdo files, but the USB install did not work as expected in CUPS.

On the tiny printer screen I saw a wifi option, entered the LAN password. Then I could visit the printer on a local tcp/ip address. From the web interface installing the printer was easy.

So don't mess with drivers, just use the wifi options.

05 July, 2018

Running Koala on Max

Koala is a nice tool for SASS, Less and JavaScript kompilation / testing. However if you try to run the program on a Mac you have to allow the program.

After installation find the program in your Programs folder. Then press 'control' and right-click on the program launcher icon. Now you are able to run the program.

After this the program will launch normally from the launchpad.

03 June, 2018

Gmail Becomes Useless

Google tracking me via mobile devices


Now - every time I try to log into my gmail account Google wants to send an SMS with a code. Now this may look as if it's security, but in reality it is spying on the user. Since I don't have my mobile next to me all the time, the gmail account will become too cumbersome to use. So now I think the time has come where I will stop using gmail.

If I cannot log into my account without a mobile device gmail becomes useless.

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.

25 April, 2018

Ubuntu up and running

Strange. Almost gave up on Ubuntu. But next morning it was just:

apt update && apt upgrade
apt dist-upgrade
reboot

... and BINGO - the thing just worked as a charm.

The next step will be add the harddrive with the user data and configure the user access but that's not for now.