Linux   Linux – SQL Server command line to perform queries (mssql-cli)



There are different methods to run queries against an SQL Server from a Linux machine. The one I am using is mssql-cli (https://github.com/dbcli/mssql-cli)

As you can check in the related github website, it has the following features:

  • Auto-completion
  • Syntax highlighting
  • Query history
  • Configuration file support
  • Multi-line queries

Installation

The -Q parameter

It has been packetized for a lot of distributions … Read more

Linux   Linux – Show git branch in bash prompt



If you are a Git user, you can find very useful this custom prompt.

Branch

Shows working branch when it detects the current folder is a git one:

user1@labdebian ~/data $
user1@labdebian ~/data $ cd ../myproject/
user1@labdebian ~/myproject (master) $
user1@labdebian ~/myproject (master) $ git checkout -b branch1
Switched to a new branch 'branch1'
user1@labdebian ~/myproject (branch1) $
user1@labdebian ~/myproject
Read more

Linux   Linux – Join to Windows domain (realm command)



Dont be afraid. Joining a linux machine to a windows active directory domain is not difficult. This post explains step by step how to join a Debian or Ubuntu linux machine but it can applied for other distributions without much different commands.

Install needed packages

Install realmd

apt-get install realmd

It may happen that the command returns an error like … Read more

F5 BIG-IP icon   F5 BIG-IP – Authentication using active directory



By default F5 BigIp configuration utility uses local users to authenticate.

But if your enviroment allows it, using another way like Active Directory, LDAP, RADIUS might be very interesting. This post focuses in Active Directory but, anyway, it can point you and be a great help to configure for another type of server.

So, follow these easy steps:

Configure Active

Read more

Checkpoint   Checkpoint – /var/log full (possible cause)



Yesterday I realized (after checking the backup of one of my gateways was failing) that the /var/log partition was 100% full:

[Expert@vsx1:0]# df -h
Filesystem 			Size 	Used 	Avail 	Use% 	Mounted on
/dev/mapper/vg_splat-lv_current 31G 	21G 	9.0G 	70% 	/
/dev/md0 			289M 	130M 	145M 	48% 	/boot 
tmpfs 				32G 	0 	32G 	0% 	/dev/shm
/dev/mapper/vg_splat-lv_log 	146G 	146G 	0 	100% 	/var/log

Surprinsingly, it used to have … Read more

POWERSHELL   Powershell – Could not create SSL/TLS secure channel



I use Powershell to send monitoring results to the Icinga API (passive checks). For example, to check if the Exchange backups were processed correctly, I run a Exchange powershell and then the results are sent using “Invoke-WebRequest” command.

Since I disabled obsolete and insecure TLSv1 and TLSv1.1 protocols in the Exchange server, the script was not working anymore returning error:… Read more

   Exchange – Bulk import of distribution group members from csv



A short but useful post:

Suppose you need to import hundreds of members to a distribution group.
The list is in a CSV file:

Name,Email
user1,user1@domain1.com
user2,user2@domain2.com
user3,user3@domain3.com
user4,user4@domain4.com
user5,user5@domain5.com
user6,user6@domain6.com
user7,user7@domain7.com
user8,user8@domain8.com
user9,user9@domain9.com
user10,user10@domain10.com
user11,user11@domain11.com
user12,user12@domain12.com
user13,user13@domain13.com
user14,user14@domain14.com
user15,user15@domain15.com
user16,user16@domain16.com
user17,user17@domain17.com
user18,user18@domain18.com
...

To bulk import all the users, a simple command like this is enough:… Read more

   Nextcloud – Error modifying files or folders: locked error



Yesterday I came across a problem in which I tried to modify (rename, delete, …) a folder and it returned an error.

Nextcloud logs (/var/www/nextcloud/data/nextcloud.log) showed the following:

"reqId":"Pf4KW9q1WDVe1YdmG0Mt","level":3,"time":"2019-09-10T16:36:53+00:00","remoteAddr":"63.223.129.127","user":"user1","app":"no app in context","method":"DELETE","url":"\/remote.php\/dav\/files\/user1\/ALBUMS\/New%20folder","message":{"Exception":"OCP\\Lock\\LockedException","Message":"\"files\/8010dab5adf49336ecdaf75a2008d5ab\" is locked","Code":0,"Trace":[{"file":"\/var\/www\/html\/nextcloud\/lib\/private\/Files\/Storage\/Common.php","line":779,"function":"changeLock","class":"OC\\Lock\\DBLockingProvider","type":"->","args":["files\/8010dab5adf49336ecdaf75a2008d5ab",2]},{"file":"\/var\/www\/html\/nextcloud\/lib\/private\/Files\/Storage\/Wrapper\/Wrapper.php","line":615,"function":"changeLock","class":"OC\\Files\\Storage\\Common","type":"->","args":["Nueva carpeta",2,{"__class__":"OC\\Lock\\DBLockingProvider"}

Solution

Enter maintenance mode

sudo -u www-data php occ maintenance:mode --on

Then, all entries of the table oc_file_locks … Read more

Home Server icon   Home Server (9) – Upgrade HP Microserver Gen8 CPU



Im using my Microserver Gen8 a lot and, sometimes the poor performance of the CPU is noted (when showing galleries with many images for example). So I decided to replace it by another better one.

CPU model to choose

I chose the cpu model based on this resource

Those are compatible CPU with different performances prices and all of them … Read more