devnull

Man of many talents. Server janitor, Chief Googler, Vice President of Pencil Sharpening, Director of Turning Things Off and On Again. Technology Plumber using Linux for stuff like Satellite STB, home CCTV system, kitchen sound bar, workstations, even car onboard computer. And servers, oh yeah - lots of them. I've been a Linux Mercenary for quite a while now, often using information posted by kind strangers on the Internet to solve problems during this journey. This blog is a humble attempt to give something back to the community.

Feb 102016
 

4x_NvidiaGTX780 GPU

I’ve got Centos 7 based Bacula installation with storage daemon writing to file volumes located on ZFS filesystem. Chown’ing filesystem to user bacula was not enough, SElinux being SElinux didn’t particularly like bacula writing to location chosen by me (/tank/backup) as it expects Bacula to write to /bacula by default.

Lets identify available Bacula contexts and re-label /tank/backup accordingly

# semanage fcontext -l | grep bacula
 /bacula(/.*)? all files system_u:object_r:bacula_store_t:s0
 /etc/bacula.* all files system_u:object_r:bacula_etc_t:s0
 /var/bacula(/.*)? all files system_u:object_r:bacula_store_t:s0
 /var/lib/bacula.* all files system_u:object_r:bacula_var_lib_t:s0
 /var/log/bacula.* all files system_u:object_r:bacula_log_t:s0
 /var/run/bacula.* regular file system_u:object_r:bacula_var_run_t:s0
 /usr/sbin/bacula.* regular file system_u:object_r:bacula_exec_t:s0
 /var/spool/bacula.* all files system_u:object_r:bacula_spool_t:s0
 /var/spool/bacula/log(/.*)? all files system_u:object_r:var_log_t:s0
 /etc/rc\.d/init\.d/bacula.* regular file system_u:object_r:bacula_initrc_exec_t:s0
 /usr/sbin/bat regular file system_u:object_r:bacula_admin_exec_t:s0
 /usr/sbin/bconsole regular file system_u:object_r:bacula_admin_exec_t:s0

Ahh OK, so it’s called “system_u:object_r:bacula_store_t:s0” – lets apply it

chcon system_u:object_r:bacula_store_t:s0 /tank/backup
semanage fcontext -a -t bacula_store_t "/tank/backup(/.*)?"
restorecon -R -v /tank/backup

Same will work if your Centos 7 client will refuse to restore data to /bacula-restores, with message in server log:

26-Sep 14:40 death-star JobId 24822: Error: mkpath.c:138 Cannot create directory /bacula-restores/backup: ERR=Permission denied

and message in client log:

type=AVC msg=audit(1474897201.721:307): avc:  denied  { write } for  pid=26477 comm="bacula-fd" name="bacula-restores" dev="vda1" ino=159551617 scontext=system_u:system_r:bacula_t:s0 tcontext=unconfined_u:object_r:default_t:s0 tclass=dir

Simply run:

chcon system_u:object_r:bacula_store_t:s0 /bacula-restores
semanage fcontext -a -t bacula_store_t "/bacula-restores(/.*)?"
restorecon -R -v /bacula-restores
ls -lZ /

and now your restore job will run just fine. Magic.

Feb 032016
 

Intro

I wanted to enable Bluetooth hands-free talk and music streaming in my Corolla Verso and because I’m very pleased with Yatour interface I use in my other car I decided to go down the same route.

For Toyota Corolla Verso 1.8 2005 T3 we need Yatour YT-M06 BTM which is around £70 delivered (Amazon UK).

In order to hook it up we need to access back panel of the car radio unit first, to plug the cable provided by Yatour into CD-changer socket.

It’s not that difficult to get it fitted so I hope this guide will help someone.

 

Dismantling

First use a knife or spatula to pry and remove side panels

View post on imgur.com

 

View post on imgur.com

Disconnect cigarette lighter

View post on imgur.com

Continue with plastic panel on left hand side

View post on imgur.com

View post on imgur.com

Removing AC controller

Just two Philips screws and then disconnect two plugs

View post on imgur.com

View post on imgur.com

View post on imgur.com

View post on imgur.com

View post on imgur.com

Finally, radio unit

Two screws on the bottom and two at the sides.

View post on imgur.com

Ideally get a 10mm magnetic nut driver with extension bar as two side screws are no so easy to reach.

View post on imgur.com

View post on imgur.com

CD-changer cable provided in the box:

View post on imgur.com

Plug the white bit into a socket at the back of the radio – there is only one that is matching shape!

View post on imgur.com

View post on imgur.com

Put it back together in reverse order

Plug the other end of the CD-changer cable into Yatour unit. Plug in a Bluetooth module cable as well.

Turn on the radio and press CD twice to switch to Yatour, you can now listen to music from SD card or stream it from your phone.

Notes

  • Make sure your SD card is formatted with FAT
  • Make sure your folders are named appropriately (CD01, CD02, up to CD15 I believe).
  • Music is playing in the wrong order? It’s because Yatour disregards file names! File creation dates (timestamp) is what matters, there are tools to set timestamps get around this problem. On Linux you can use `touch` in the loop or something.
  • Once phone is paired via Bluetooth with Yatour, in order to receive a phone call press Next (Forward) on the steering wheel. To finish press Next again. To reject keep Next for 3sec.

View post on imgur.com

Here is where I attached Bluetooth module using double sided sticky tabs.Used same pads to secure Yatour unit, I keep it in space between handbrake and gear stick.

View post on imgur.com

Microphone is on the A pillar close to the roof

View post on imgur.com

 

Video here:

 

And gallery here

 

Leave a comment if you found this guide useful 😉