With the latest stable Rocket Chat (0.60.3) on Centos 7 machine I got this error :

# node main.js
    const { pause } = require("./debug.js");

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/opt/Rocket.Chat/main.js:4:1)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

This can be fixed by installing a few dependency (magic)

npm install -g inherits n

Then it seems to be recommended to run node.js 8.9.3 :

n 8.9.3

After that I got greeted with a well-known issue on Centos … the older GLIBC librarys :

[root@rocket Rocket.Chat]# node main.js
  return process.dlopen(module, path._makeLong(filename));

Error: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /opt/Rocket.Chat/programs/server/node_modules/fibers/bin/linux-x64-57/fibers.node)
    at Object.Module._extensions..node (module.js:664:18)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/opt/Rocket.Chat/programs/server/node_modules/fibers/fibers.js:24:38)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)

Luckily in this case there is a quick and easy workaround, install some build apps in case they are missing :

yum install g++ build-essential

rebuild node-gyp :

npm install -g node-gyp
cd /opt/Rocket.Chat/programs/server/node_modules/fibers/
node-gyp rebuild
cp -f build/Release/fibers.node bin/linux-x64-57/fibers.node

And rocketchat will boot up again 😀 jippie !

systemctl start rocketchat.service

Happy rocketing ! 🙂

Thanks to stally!

Avoid rsyncing thumb.db

9 January, 2018

If your sync is syncing a bunch of thumb.db files from windows cause someone opened the directory, you can easely remove it from the sync :

rsync -avhn --exclude 'Thumbs.db' source destination

note : I added -n for copy/paste mistakes 🙂

if you got plenty of file types/extensions you want ignored/excluded use :

rsync -avhn --exclude-from '/opt/exclude_rsync_list.txt' source destination

an example of this file could be :


happy syncing.

Suddenly a Linux server, -only- serving as ‘open’ samba share (guest account allowed) stopt working. I logged in and found samba working, no weird network issues, nothing. A mystery !

After a service smb restart and a reboot -h now (sue me, uptime) I increased the log level of smb to level 3 this is done by changing /etc/samba/smb.conf :

        workgroup = SAMBA
        security = user
        passdb backend = tdbsam


        map to guest = Bad User
        log level = 3

        [... below come shares ...]
  path = /data
  force user = testuser
  guest ok = yes

You can then follow what samba is doing at /var/log/samba/log.smbd (for Centos, after restarting the service) This is what I found :

[2017/12/05 11:10:37.388846,  3] ../source3/auth/auth.c:178(auth_check_ntlm_password)
  check_ntlm_password:  Checking password for unmapped user [DESKTOP-XXXXXX]\[svennsvenndDESKTOP-XXXXXX] with the new password interface
[2017/12/05 11:10:37.388886,  3] ../source3/auth/auth.c:181(auth_check_ntlm_password)
  check_ntlm_password:  mapped user is: [TEMPSTORAGE]\[svennd]@[DESKTOP-XXXXXX]
[2017/12/05 11:10:37.388985,  3] ../source3/auth/check_samsec.c:399(check_sam_security)
  check_sam_security: Couldn't find user 'svennd' in passdb.
[2017/12/05 11:10:37.389029,  2] ../source3/auth/auth.c:315(auth_check_ntlm_password)
  check_ntlm_password:  Authentication for user [svennd] -> [svennd] FAILED with error NT_STATUS_NO_SUCH_USER
[2017/12/05 11:10:37.389077,  3] ../source3/auth/auth_util.c:1610(do_map_to_guest_server_info)
  No such user svennd [DESKTOP-XXXXXX] - using guest account
[2017/12/05 11:10:37.390215,  3] ../source3/smbd/server_exit.c:246(exit_server_common)

So in short windows tries to use my local account and fails, this is expected. Then samba gives me the permissions of a guest account. Weirdly enough after that samba reports NT_STATUS_CONNECTION_RESET, or more simply put “server exit”. I tried to find more info on the recent patches using :

rpm -q --changelog samba-common-4.6.2-12.el7_4.noarch | less

At this time of writing the latest “feature change” was way back in march, this installation was newer so that could hardly be the issue.

* Fri Mar 31 2017 Guenther Deschner <gdeschner@redhat.com> - 4.6.2-0
- Update to Samba 4.6.2

In the end, we did not find the issue in the samba server. The issue was the client, running a windows 10 up-to-date version (fall creators update). This was the only change, between a working and not working setup. So Windows must have changed some behavior ? Tested with a Windows 7 machine, this suspicion was confirmed, there it worked. A workaround for my case was to setup a username that the server does know on the client :

C:\Users\svenn>net view \\shareserver
System error 53 has occurred.

The network path was not found.

C:\Users\svenn>net use \\shareserver\data /user:testuser
The command completed successfully.

C:\Users\svenn>net view \\shareserver
Shared resources at \\shareserver

Samba 4.6.2

Share name  Type  Used as  Comment

data        Disk  (UNC)    storage
data_rgb    Disk           storage
The command completed successfully.

And after that I can browse and access the share through explorer. While this for sure is not foolproof, for my case its enough. (single client to server)

This register setting in windows seems to be affecting this issue, thanks Dominik!

A new project : tetromino

8 October, 2017

It’s been silent here for a while, but with a good reason. I been focusing my attention on some side-project. Building a tetris clone game on the PS VITA 😀 (homebrew hacked of course)

You can download the game here

I have even been featured at wololo’s, which is amazing 🙂

new look :

old look :

certificate out-of-date

8 September, 2017

That awkward moment when you write so much articles to help people automate and get certificates and then don’t correctly validate that my server is working correctly … 😀 Sorry for the downtime !

What happened is : I host 3 domains on 1 server, one of those 3 is no longer used, however the script still tries to ask a certificate, this resulted in an error, (since i run this script weekly for quit some weeks now). This results in the nginx server not taking the new certificates. That still leaves me weeks to find out, however I did not find it out. Until today, when I’m on holiday (horrible connection). On top of that I find that cloudflare’s “always on” is in fact : free advertisement for cloudflare’s broken function. (my website was not cashed at all !) and visitors could not even accept the out-of-time certificate.

Well it’s now hotfixed. Enjoy my blog once more ! And I hope I can enjoy the rest of my holidays !

While installing node.js :

Error: Package: 1:nodejs-6.11.1-1.el7.x86_64 (epel)
           Requires: libhttp_parser.so.2()(64bit)
Error: Package: 1:nodejs-6.11.1-1.el7.x86_64 (epel)
           Requires: http-parser >= 2.7.0

You can solve this by installing http_parser manually :

yum install https://kojipkgs.fedoraproject.org//packages/http-parser/2.7.1/3.el7/x86_64/http-parser-2.7.1-3.el7.x86_64.rpm

The reason behind the issue, is in that RHEL 7.4 now includes this package in the default repo, and for that reason its now removed from epel repository. The result is that there is no fight for RHEL users what version is best, but the disadvantage is that Centos users who are stuck for now on Centos 7.3, are missing a dependency for node.js until Centos 7.4 is out that is.

200th post

8 August, 2017

Yeaaaj, 100 more badly written articles and barely working guides ! Well seems I enjoyed making them and somehow something likes to read them. Some statistics to show off !

Like last time, users/bots seem to drop off during the weekend, compared to last time the effect is even easier to see. I assume part of the traffic comes from people searching for help during work hours. Long live weekends.

Overall traffic has been increasing, not really sure why there was a drop last month, neither do I really care. Obv. the last point is still new (since its only 8 days in the month)

I was not aware but clearly Thursdays are my blog day. Last time, Friday (2) and Wednesday (3) where close follow-ups. Tuesday who came up as second to last, is now my 4th most active day, and Saturday keeps being the last on the row.

On to the next 100 articles 🙂

I wanted to redo/rework the Passbolt install on Centos for a while. It’s seems like a horribly long and complex process, but in fact it’s not. With the recently released Passbolt 1.6 and my wish to play with asciinema for a while I thought why not combine both 🙂 Considering this is my first attempt, don’t shoot me ! If you prefer a readable version feel free to use my text guide version.

Read More

It’s not the first time I received this error. It is the error you receive when the file (or large input in general) you tried to upload is too large and the server is declining it. Here is how you can fix it :

Open your server {} specific config file for nginx :

nano /etc/nginx/conf.d/svennd.conf

and add, 10M is ~10MB.

client_max_body_size        10M;

Note that PHP also has an upload limit (see the docs).

Reload Nginx to activate :

service nginx reload


systemctl reload nginx

note that clent_max_body_size can be in both http and server context, I prefer server as it is more specific.

I have some NFS servers (read: the main function is to store data and share it over NFS) to maintain and mostly they simply work (like everything in Linux). Most variables have been battle tested for … well forever. So rarely do you need to check on the best trade-off. Well enter the NFS thread counter.

Read More