Stuff I'm Up To

Technical Ramblings

Apache Directory Studio — April 19, 2018

Apache Directory Studio

After upgrading Directory Studio – which is a simple case of extracting the tar.gz file into the location you want the executable eg.

$ cd /usr/bin
$ sudo tar xvzf ~/Downloads/ApacheDirectoryStudio-2.0.0.v20170904-M13-linux.gtk.x86_64.tar.gz

I got this error in the log file when running the new version.

org.osgi.framework.BundleException: Unable to acquire the state change lock for the module: osgi.identity;

Continue reading

Advertisements
Access DFS Shares from Linux — March 27, 2018

Access DFS Shares from Linux

I’ve kicked this around a few times and resigned myself to just using the non-DFS path to attach to. But we’ve recently changed some of the servers around and the paths have changed – obviously the DFS paths haven’t. So I thought I’d have a go at fixing the problem.

Continue reading

Sweet Christmas – VS Code — March 13, 2018

Sweet Christmas – VS Code

Ok, so I know Microsoft have been making some big steps in the world of Open Source – I confess to giving them little ear time, mainly because EVERYTHING we seem to do at work ends up a licensing battle that Microsoft always win, and by win I mean empty this years budget in one go.

I’ve been using Atom as my editor of choice for some time now and really like it, but someone suggested I checkout Microsoft Visual Studio Code. I am aware of it. It has the same construction as atom – it’s based on Node.js and built using electron, just the same. So I installed it today… and wowsers! It’s impressive. It uses git and picks up the file changes using git status and I’d almost swear it was atom.

It even has extensions for linting! Of course it also has a PowerShell extension – which to be honest I found missing in atom when coding PS in Linux.

But I’m not 100% sold yet. Atom is going to take some beating. But I’m certainly more surprised by code than I thought I would be.

Code v1.2.1 at the time of writing.

MariaDB Apparmor and No login — February 22, 2018

MariaDB Apparmor and No login

As I’ve been messing around with Sphinx I discovered that MariaDB actually includes the SphinxSE plugin out of the box. So I figured I’d ditch my MySQL installation on Debian and go back to the default Debian repository version MariaDB.

$ sudo apt-get remove mysql-server mysql-client

$ sudo apt-get install mariadb-server mariadb-client

This didn’t go to plan. Firstly it failed to run the apt configure scripts for mariadb-server-10.1 so it would not complete the install.

Checking the logs

Feb 21 15:52:29 mypc kernel: [ 323.603758] audit: type=1400 audit(1519228349.780:26): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/etc/mysql/mariadb.conf.d/" pid=5175 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=0 ouid=0

It goes back to a previous post I made about apparmor and MySQL. This time the problem was because the config file paths/names are different.

name="/etc/mysql/mariadb.conf.d/

Continue reading

The Power of Sphinx — February 21, 2018

The Power of Sphinx

I’ve only really used Sphinx as part of a home project with MySQL. But today found that searching for text in 28 million rows in a PostgreSQL table needs something with a bit more performance that the base SQL server.

Installing Sphinx on Debian is very straight forward if you want the default repository version and not the leading edge version. I saw no reason why not.

$ sudo apt-get install sphinxsearch

Now getting it working takes some fettling of the /etc/sphinxsearch/sphinx.conf file. It doesn’t exist by default so you need to create it either by copying the sphinx.conf.dist file or start fresh.

You also then need to edit the /etc/default/sphinxsearch file and set START=yes.

Continue reading

PostgreSQL Copy Data Between Servers — February 20, 2018

PostgreSQL Copy Data Between Servers

Our GIS team use a PostgreSQL server with PostGIS. They recently asked if there was any way we could display some data in a simple web form for our users. So a bit of development work was required.

I didn’t want to code against their live system so thought I’d install a local version of PostGIS and copy the data from their database.

The database they wanted to access has 28 million rows – so it’s going to take a while.

Continue reading

vi – Visual Mode — February 15, 2018

vi – Visual Mode

I’m sure when using a mouse in a text terminal the visual mode of vi/vim is useful, but I can never figure it out. In fact it prevents me from copying from a vi terminal in a window.

To temporarily disable mouse visual mode in a window, so you can copy your text it’s as simple as hold the SHIFT key down whilst selecting text with your mouse. Or you can disable it in that vi session by typing :set mouse-=a

To permanently disable visual mode in your session create or add the following to your ~/.vimrc file

set mouse-=a

If you need to do this for whilst using vi/vim under sudo, you’ll have to add the above into /root/.vimrc.

Synology DSM 6.1.5-15254 Upgrade — February 7, 2018

Synology DSM 6.1.5-15254 Upgrade

Following this upgrade I accepted to install I spent the evening cursing.

The system started up and services were accessible as usual, but I couldn’t login to the admin Web UI. It just came up with a red box message:

"System is getting ready. Please log in later."

This went on for several hours. I could access an SSH terminal and check the logs and gather data, but I couldn’t figure out why it wouldn’t let me in. Everytime I tried it generated a syslog entry:

DiskStation login.cgi: login.cpp:211 System is not ready

I checked running services, restarting them and nothing. Disable Google authentication, still no joy.

2018-02-06T20:09:38+00:00 DiskStation synopkgctl: SYSTEM: Last message 'resource_api.cpp:163' repeated 1 times, suppressed by syslog-ng on DiskStation
2018-02-06T20:09:38+00:00 DiskStation synopkgctl: resource_api.cpp:163 Acquire web-config for DownloadStation when 0x0000 (done)
2018-02-06T20:09:40+00:00 DiskStation kernel: [ 100.904432] init: pkg-WebStation-userdir main process (11584) terminated with status 1
2018-02-06T20:09:42+00:00 DiskStation synoiscsiep: iscsi_stop_all.cpp:89 Successfully stopped iSCSI service.
2018-02-06T20:09:44+00:00 DiskStation synoiscsiep: iscsi_start_all.cpp:101 Successfully started iSCSI service.
2018-02-06T20:12:51+00:00 DiskStation login.cgi: login.cpp:211 System is not ready
2018-02-06T20:24:05+00:00 DiskStation synomkflvd: synoidx_system.cpp:36 [NOTICE] system is not ready? start anyway.
2018-02-06T20:24:05+00:00 DiskStation synomkthumbd: synoidx_system.cpp:36 [NOTICE] system is not ready? start anyway.
2018-02-06T20:24:10+00:00 DiskStation synoindexd: synoidx_system.cpp:36 [NOTICE] system is not ready? start anyway.
2018-02-06T21:03:24+00:00 DiskStation login.cgi: login.cpp:211 System is not ready

So I gave up on it and thought I’d revisit it today.

Then I received this email at about 3pm today.

Dear user,

DiskStation has finished checking the consistency on system volume (Root). The system is now ready for use.

Sincerely,
Synology DiskStation

and now I can logon like nothing happened.

Update

Today it’s been 6 days since I upgraded to DSM 6.1.6-15266 and I’ve not been able to logon because of the same symptoms. More googling ensued until I came across this comment by delapaco on a similar post here: https://www.supportmyidea.com/cant-login-synology-dsm-system-getting-ready-please-log-later/

So I ran the first two steps and was finally able to successfully login!

$ sudo synobootseq --set-boot-done
$ sudo synobootseq --is-ready
Boot done

But following a reboot it needed this process repeating so I could logon. Very strange. So I’m probably going to have to report this to Synology and see if there’s a fox for it.

 

PHP7.2 and MSSQL Drivers — February 5, 2018

PHP7.2 and MSSQL Drivers

I upgraded to PHP v7.2 on my Debian Buster/Sid today. Not a problem until I realised I’d broken my Microsoft SQL Drivers.

The real reason for my update from v7.0 to v7.2 was down to a problem I suffered with some Laravel console commands I was working on. When I ran a CLI based command php artisan group:command, which is a command I’m writing that uses a model from an MSSQL server. It would come up with an error message:

In Connection.php line 664:
                                                                               
  could not find driver (SQL: select top 1 * from [vwContract] order by [Ref]  
   asc)                                                                        
                                                                               
In Connector.php line 67:
                         
  could not find driver  

Continue reading

Mysql Broken After Apt Upgrade — January 18, 2018

Mysql Broken After Apt Upgrade

My local install of mysql-community-server decided to fail today after applying some updates. I’m running Debian buster/sid so these kind of things are to be expected. But this was a totally new one to me.

Mysql failed to start so the update wouldn’t install.

Unpacking mysql-community-server (5.7.21-1debian9) ...
Setting up mysql-community-client (5.7.21-1debian9) ...
Setting up mysql-client (5.7.21-1debian9) ...
Processing triggers for systemd (236-3) ...
Processing triggers for man-db (2.7.6.1-4) ...
Setting up mysql-community-server (5.7.21-1debian9) ...
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Thu 2018-01-18 08:54:36 GMT; 9ms ago
  Process: 11123 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid ^[[0;1;31m(code=exited, status=1/FAILURE)^[[0m
  Process: 11088 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
dpkg: error processing package mysql-community-server (--configure):
 installed mysql-community-server package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 mysql-community-server
Log ended: 2018-01-18  08:54:36

Then in my syslog file I saw lots of activity constantly trying to start and failing.

Continue reading

Mobility Printing from a Guest Network — January 4, 2018

Mobility Printing from a Guest Network

Today I have been mostly fumbling around in DNS trying to get untrusted devices on our Guest network to print to our PaperCut Pull Printing system using NAT.

All our WiFi users connect to the Guest VLAN which is isolated from the main production network. There are very few services that need to come from the Guest network into the Trusted zone, but this pull printing is one of them.

untitled_page

Continue reading

PHP7.0, Microsoft SQL Driver & Debian (stretch) — December 12, 2017

PHP7.0, Microsoft SQL Driver & Debian (stretch)

What a mission today has been. I think I’ll ultimately roll back to using Debian Jessie as Stretch isn’t a supported system, yet.

To get the MS SQL ODBC driver working even in Jessie appears to be a challenge. In Stretch I almost surrendered. It is working, but I do think it’s a bit of a hack as I’ve had to install an older libssl1.0.0 and enable the locale en_US.UTF-8.

PHP development voted out the inclusion of MS SQL to the project so now you must compile and install it yourself. There are some very good instructions out there to help you – even from Microsoft.

https://docs.microsoft.com/en-gb/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server

Continue reading