BC3 Browser

- 1 min read

As part of my BIM workbench project I’ve created a browser to show BC3 files on the browser, I need ths pice of software to link the BC3 files with the Revit files.

BIM Workbench Beta

- 1 min read

This is a beta version of a BIM Workbench for Autodesk Revit. It is a Vue frontend and a Node.js backend. The backend is a simple REST API that communicates with the Revit API. The frontend is a simple Vue.js app that allows the user to create a new project, upload a Revit file, and get the project information.

Portera

- 2 mins read

portera 🚀

portera🚀 provides remote logs for you node apps with an awesome style :).

portera has two parts, a library that wrap your console object by default, redirecting the output to portera server, its receive your data and serve a web page where you can display an awesome output, just like that

Sample Web

Installation

github

Motivation

These days I spent more time at home by corona quarantine, time to practice and learn new things. I began to do a sample project in node for the company where I work, it was something that I had have in my mind time ago. The project its a middleware between our different management programs and third part applications, this middleware should contain all bussiness logic necesary by thrird part systems.

NEngine is a skeleton project that I use to start new projects where I need to use SQL Server for the database and JWT tokens for authentication. The project is available on GitHub

It is necessary to have a SQL Server database with stored procedures to authenticate the user and generate the JWT token. The stored procedures are:

{
  "CHECK_EMAIL": "DATABASE.dbo.checkEmail @email = @email",
  "SAVE_USER": "DATABASE.dbo.saveUser @email = @email, @password = @password",
  "LIST_USERS": "DATABASE.dbo.listUsers",
  "CHECK_PASSWORD": "DATABASE.dbo.checkPassword @email = @email, @password = @password",
  "CHECK_PASSWORD1": "DATABASE.dbo.checkPassword"
}

Stored Procedures

USE [DemoDB]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


ALTER PROCEDURE [dbo].[checkEmail] (@email VARCHAR(50))
AS
BEGIN
	SELECT * from DemoUser WHERE email = @email	
END

ALTER PROCEDURE [dbo].[checkPassword] (@email NVARCHAR(50), @password NVARCHAR(60))
AS
BEGIN
 SELECT email, password from DemoUser WHERE email = @email	AND password = @password
 --IF @@ROWCOUNT = 0 BEGIN
 --	select 'none' as email, 'none' as password   
 --END 
END

ALTER PROCEDURE [dbo].[saveUser] (@email VARCHAR(50), @password VARCHAR(10))
AS
BEGIN
	INSERT INTO DemoUser(email, password) VALUES (@email, @password)
END

ALTER PROCEDURE [dbo].[listUsers]
AS
BEGIN
	SELECT * from DemoUser 
END

LVM Add Disk (work notes)

- 4 mins read

Introduction & Explanation (pasted)

Why LVM?

The reason why we love LVM is because when you need to increase the space it’s really easy. If you have vanilla EXT4 and you want to enlarge it, then you need to work out extents and at this point we feel it’s too complicated and technical. See here if you simply want to add a new EXT4 disk without LVM.

Below are the commands used to get the whole operation going.

SSH

- 1 min read

SSH related

ssh-copy-id windows -> linux

cat ~/.ssh/id_rsa.pub | ssh root@agora "cat >> ~/.ssh/authorized_keys"

github

ssh-keygen -t ed25519 -C "your_email@example.com"
ssh-keygen -t rsa -b 4096 -C "your_email@example.com" (old)

github config ~/.ssh/config

Host github.com
      Hostname github.com
      PreferredAuthentications publickey
      IdentityFile ~/.ssh/gh

ssh-agent

$ eval "$(ssh-agent -s)"
> Agent pid 59566

add key to agent

ssh-add ~/.ssh/id_ed25519 

Windows ssh-agent

Set-Service ssh-agent -StartupType Manual
Start-Service ssh-agent

Synology Docker ssh context error

- 2 mins read

Enable homes

Modify sshd_config

Match User romheat 
    AllowTcpForwarding yes

PermitUserEnvironment yes

Workarround ssh context error

â–  docker ps
error during connect: Get "http://docker/v1.24/containers/json": 
command [ssh -l xxxx -- nas docker system dial-stdio] has exited with exit status 127, please make sure the URL is valid, 
and Docker 18.09 or later is installed on the remote host: stderr=sh: docker: command not found


user@sputnik | ~/tmp/abb 
â–  ssh nas 'echo $PATH'
/usr/bin:/bin:/usr/sbin:/sbin

user@sputnik | ~/tmp/abb 
â–  ssh nas

Synology strongly advises you not to run commands as the root user, who has
the highest privileges on the system. Doing so may cause major damages
to the system. Please note that if you choose to proceed, all consequences are
at your own risk.

user@CSSNAS:~$ ls
user@CSSNAS:~$ ls -la
total 0
drwxrwxrwx+ 1 user users  8 Sep 25 17:54 .
drwxrwxrwx+ 1 root    root  54 Sep 25 17:52 ..
drwxrwxrwx+ 1 user users 30 Sep 25 17:54 .ssh
user@CSSNAS:~$ ls .ssh
authorized_keys
user@CSSNAS:~$ echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
user@CSSNAS:~$ echo PATH=$PATH  >> ~/.ssh/environment
user@CSSNAS:~$ cat .ssh/environment 
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
user@CSSNAS:/etc$ sudo synogroup --add docker
Group Name: [docker]
Group Type: [AUTH_LOCAL]
Group ID:   [65536]
Group Members: 
user@CSSNAS:/etc$ sudo synogroup --member docker user,root
Group Name: [docker]
Group Type: [AUTH_LOCAL]
Group ID:   [65536]
Group Members: 
0:[user]
1:[root]
user@CSSNAS:/etc$ sudo synogroup --member docker root
Group Name: [docker]
Group Type: [AUTH_LOCAL]
Group ID:   [65536]
Group Members: 
0:[root]
user@CSSNAS:/etc$ sudo chown root:docker /var/run/docker.sock

sudo synopkg restart Docker