Vagrant error


If you see the below error when trying to run the vagrant up command. Add the export variable to fix the problem.

Error:

1114: A dynamic link library (DLL) initialization routine failed. - C:/HashiCorp/Vagrant/embedded/gems/gems/nio4r-1.0.0/lib/nio4r_ext.so

Solution

export NIO4R_PURE="yes"
 
Advertisements

Mongod max processes


If you encounter a problem with MongoDB with the below error. Its worth checking that your Linux OS does not have an override for your sysctl.conf settings called etc/security/limits.d/90-nproc.conf

Error

[initandlisten] pthread_create failed: errno:11 Resource temporarily unavailable
[initandlisten] can’t create new thread, closing connection

Solution

Add a new conf file after with the updated details in the /etc/security/limits.d/ folder entitled 91.mongod.conf. Ensure that the number is after the previous conf file to ensure it gets loaded last.

Example contents


root - nofile 21000
mongod - nofile 21000
mongod soft nproc 62848
mongod hard nproc 62848

batch script to check for file mapping and remap if disconnected


The below script was set to check for a specific file mapping that was disconnecting. If detected it will then remap the drive.

Simply change the s part in s:null to your drive letter and then add in the Email and mapping details which are highlighted in caps with the hyphen (eg EMAIL-HERE)

if exist s:nul if exist map.lock del map.lock & goto END

if exist map.lock goto END

if exist s:nul goto END
else
print "drive not mapped"
blat -to "EMAIL-HERE" -server SMTP-HERE -f SERVER-HERE@root.com -subject "Mapping Failed" -body "drive Mapping Failed/disconnected"
echo & map.lock
net use s: \\DNS-ADDRESS-HERE\FOLDER-HERE
:END