Category Archives: Computer geek stuff

pthreads install on CentOS with cpanel (resolved)

I upgraded from PHP5.4. (end of life) to PHP5.6, and lost the functionality of pthreads on my CentOS6.7 VPS.
After much searching and trials, it turns out that I need specify the specific version of pthreads to be installed, otherwise the newest version gets installed. In this case the newest version pthreads-3.0.9 is only available for php7.0
The last version that worked with PHP5.x is pthreads-2.0.10. None of the 3.0.x versions of phteads work with the php 5.x family.

So to install pthreads to work with php 5.6, run:
#pecl install pthreads-2.0.10

 

Just for reference, if you try to install the latest pthreads (currently 3.0.9) while running php 5.x, you get the message:

pecl/pthreads requires PHP (version >= 7.0.0RC2), installed version is 5.6.15
No valid packages found
install failed

After pthreads are installed, restart the apache web server

#service httpd restart

Laravel project returns blank page

I had this happen a couple of times so I should document it for future reference.
Copying a laravel project to another account renders some pages (pages that use templates) as blank. The change is to chmod the storage/app, storage/framework and storage/logs folders to 777.
I don’t know if all the folders need that permission, but I didn’t investigate what the minimum permissions required are.

Learning a MVC framework : laravel 5

Some useful links:

http://laravel.com/docs/5.0/helpers#urls

call custom files (php or otherwise) into a laravel project. For me app.php file to which I added

'Helpers'   => 'app\TradeLogic\engine'

was in config/app.php

The app.php file didn’t help.

What actually worked was adding :

include_once (__DIR__.'/../resources/views/engine.php');

to the file bootstrap/autoload.php
The path shown is from the location of the autoload file.

 

Migrations

To drop a column, need to run “composer require doctrine/dbal” otherwise a rollback that drops a column will fail.

If the filename of a migration got changed, or it got deleted, the ‘php artisan migrate’ command will complain. Need to run ‘composer dumpautoload’ shich will fix things.

kvm localized virtual desktops

I read something interesting the other day. Running multiple VMs, on the same computer; the catch is that they are all running on the same desktop (not headless) sharing one display. The term is “kvm localized virtual desktops”.

The place I read this was the UnRaid blog, talking about KVM integration into the UnRaid 6 system (SOURCE).

Since OpenSuSE has tools and support for kvm, I shall try this.

It would be interesting to run linux and windows and not have to dual boot, and have access to the same GPU from both OSs.

space usage

Recently came across one of my linux VM machines that ran out of disk space. But where did all the space go? What ate it up?

du -h <dir> | grep ‘[0-9\.]\+G’

This will list a sorted view of the foles/folders from largest to smallest.

(SOURCE)

Network storage and backup

I lost a HD the other day and whatever data was on it. I think I had most things backued up but there was still some data that is gone forever. This got me thinking about how to better protect ALL devices in my house.

Storage is cheap, but I don’t want 2 HD in every machine. And some machines like the laptops can’t use 2 HDs.

At the same time I need to re-evaluate the NAS solution in my house. I’m currently managing two systems. An UnRaid computer for archival storage and a Nas4Free machine for a faster access of data.

Steps:

1. Add an SSD drive to UnRaid as a cache drive to speed up write functions on the UnRaid system, and compare network read/write speeds with the Nas4Free box. See how different the two really are.

2a. If speeds are very close, take apart the Nas4Free array and move the two 2TB drives to the UnRaid system.

2b. If speeds are not close buy two 2TB drives and replace the two 1TB drives in the UnRaid system. This will increase the array capacity by 2TB.

3. For all computers set up some software that will backup the working files of all computers to a backup folder on the UnRaid system. Have this backup be done once a day (probably at night). A scheduled rsync operation (that also mirrors deleted files) should suffice. I don’t want an ever growing amount of data. Just a mirror copy of the machine’s HD in case it fails.