25 December, 2016

Make /var/www/html/ writable

From the history:

 76  sudo gpasswd -a "per" www-data
   77  sudo chown -R "$USER":www-data /var/www
   78  find /var/www -type f -exec chmod 0660 {} \;
   79  sudo find /var/www -type d -exec chmod 2770 {} \;
   80  touch x
   81  rm x

Line 80 - 81 is just a test. 

17 December, 2016

WordPress Localhost 404 errors

I had to change /etc/apache2/apache2.conf file. In these lines None were changed to All:

14 December, 2016

Speed Up Mint

I have used two simple steps:

  • Cinnamon: disable all visual effects
  • Install the MATE Desktop: good for old PCs
After a few minutes with MATE my reaction was: why on earth didn't I change before ...

21 November, 2016

Where is the anacrontab log?

You can access the anacrontab like this:

awk '/anacron/' /var/log/syslog | less

Result:

root@Odin:~# awk '/anacron/' /var/log/syslog
Nov 21 08:11:58 Odin anacron[877]: Job `cron.daily' terminated
Nov 21 08:11:58 Odin anacron[877]: Normal exit (1 job run)
Nov 21 18:42:13 Odin systemd[1]: Started Run anacron jobs.
Nov 21 18:42:13 Odin anacron[845]: Anacron 2.3 started on 2016-11-21
Nov 21 18:42:13 Odin anacron[845]: Normal exit (0 jobs run)
Nov 21 20:38:31 Odin systemd[1]: Started Run anacron jobs.
Nov 21 20:38:31 Odin anacron[770]: Anacron 2.3 started on 2016-11-21
Nov 21 20:38:31 Odin anacron[770]: Will run job `db.backup' in 60 min.
Nov 21 20:38:31 Odin anacron[770]: Will run job `daglig.backup' in 200 min.
Nov 21 20:38:31 Odin anacron[770]: Jobs will be executed sequentially
Nov 21 21:05:50 Odin systemd[1]: Started Run anacron jobs.
Nov 21 21:05:50 Odin anacron[833]: Anacron 2.3 started on 2016-11-21
Nov 21 21:05:50 Odin anacron[833]: Will run job `test' in 1 min.
Nov 21 21:05:50 Odin anacron[833]: Will run job `db.backup' in 60 min.
Nov 21 21:05:50 Odin anacron[833]: Will run job `daglig.backup' in 200 min.
Nov 21 21:05:50 Odin anacron[833]: Jobs will be executed sequentially
Nov 21 20:07:06 Odin anacron[833]: Job `test' started
Nov 21 20:07:06 Odin anacron[833]: Job `test' terminated
Nov 21 22:05:50 Odin anacron[833]: Job `db.backup' started

Nov 21 22:05:50 Odin anacron[833]: Job `db.backup' terminated

Test anacrontab

Edit the anacrontab file:

nano /etc/anacrontab

Write this line:

1 1 test echo "anacron okidoki" > /home/yourUserName/anacron.log

Reboot. Wait one minute. If you see the file anacron.log in your home directory, you know that anacrontab runs.

07 November, 2016

Linux: Sound Recorder in Bash

This file is made for my research project "What You Should Know About WordPress". I need to record a series of semistructured interviews. So I needed something as simple as a soundrecorder. That's a job for bash:

#!/bin/bash

# Record interview
# Encode as MP3

# User Input
echo "I'll record sound and save the file as MP3"
echo "What is the name of your file? (Remember: .mp3)"
read filename

# Record and encode
arecord -v -f cd -t raw | lame -r - $filename

07 October, 2016

Mount H: on Windows shares

# sudo apt get install samba-client samba-common cifs-utils
# mount -t auto -o user=XXXX //server

05 October, 2016

MS Lumia Phone

My new work phone is MS Lumia. I've never tried MS in the role as a mobile. Now the battery is loading, and I wait for some apps to download. Only 3 reboots was necsessary in order to use the thing.

Setting up Outlook was easy, but I had to ignore several "helpfull" suggestions about getting a MS account. No thanx.

A nice feature is the watch when the screen is blank.

MS Lumia Phone

My new work phone is MS Lumia. I've never tried MS in the role as a mobile. Now the battery is loading, and I wait for some apps to download. Only one reboot was necsessary.

27 September, 2016

Raspberry Pi B+

Use a USB to mini-USB cable as a power supply between TV (or similar) and Pi.

15 September, 2016

Webp and Linux

Install the package webp:

# sudo apt-get install webp

Now you can convert image files with cwebp:

# cweb file.png -o file.webp

Or decompress via dwebp.

08 September, 2016

Windows improved

Today's work on a Windows system was pleasant. W10 is a great improvement. But I still prefer Linux.

01 September, 2016

Tex to Docx

So you want to translate .tex to .dex? It's easy. Use pandoc:

# /home/per/Dropbox/ddfo/sit_lux/synopsis.tex

31 August, 2016

Cannot connect to Philips Hue

For some reason Philips Hue cannot get an ip-address it seems. So the system is basicly useless. I have tried several reboots of the router, the Hue thing etc. Nothing has helped so har.

I suspect an error because my Android phone wants the same IP. However if I turn off the phone and boot from rock bottom there is only light in two LEDs.

30 August, 2016

Synchroniz Tomboy Notes

If you have more than one computer: save the notes on Dropbox. Then synchronize your systems with that folder. It works like a charm.

26 August, 2016

Docx - cannot print properly from Linux

Skyprinting from Linux or Windows does not give the same result. I'm not printing from Libre Office. I just upload the file from the directory. My conclusion: .docx is not an open format at all. You have to print from Windows.

15 August, 2016

Latex and Your Organization

As a researcher and author it's obvious to write in the Latex format. But when you hand in your work, you often have to downscale to some MS Word .docx template. I can do it. But I don't love .docx.

13 August, 2016

Lyx Debugging

Getting an error in Lyx is pretty normal. That is when you try to compile to .dvi or .pdf. But how can you edit an error in myfile.lyx in line 666? From inside Lyx it's not possible to edit the source. As far as I know, that is.

So, the quick a dirty solution is:
  1. Get out of the file in Lyx.
  2. Open the file in your favorite editor (vi, nano, gedit ... etc.)
  3. Go to the line with an error. 
  4. Fix or remove whatever seems wrong. 
  5. Save and open the file in Lyx again.
  6. Compile ... and hope for the best.
Sometimes the error may have it's origin from a bibtex file. Same recipe here.

06 August, 2016

Lyx header for a Paper

Latex header sample.


  • Colored table cells
  • Author / year bibliography
  • Somewhat scalable tables
The Latex header:


\usepackage{comment}
\begin{comment}
 
 TABELLER FARVER OG MULTICOLUMN
 Formatterer farvede tabeller.
 Husk: man kan definere farvekoder.

\end{comment}
\usepackage{multirow} 
\usepackage[table]{xcolor}
\usepackage{graphicx}

\begin{comment} 
 HEADER OG FOOTER
 Indsæt herunder
\end{comment}

\lhead{"Et in arcadea ego"}
\rhead{Per Thykjær Jensen}
\chead{2016}

\bibliographystyle{plainnat}
\usepackage{graphicx}

17 July, 2016

HP Elitebook / Ubuntu Studio: battery decharge after shutdown

Trying this recipe.

# sudo -i
# gedit gedit /etc/default/grub

Change the line to:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=force"

06 July, 2016

Dropped Linux Mint

Well ... I tried and tried, but never found a  cure fore the unstable wifi under Linux Mint. So I dropped Mint in favor of Ubuntu Studio Edition. I teach multimedia design. So it must be a good match.

LInux MInt: unstable wifi

Yep, it's still a problem. Tried this recipe: http://ubuntuforums.org/showthread.php?t=1980142