Month: August 2016

Delete files with a pattern recursively using the terminal

This is just a simple way to delete files recursively using your terminal in any UNIX-like operating system: find . -type f -name “FILES_PATTERN” -exec rm {} \; // Example find . -type f -name “*.mp3″ -exec rm {} \; Explanation -name “FILES_PATTERN” : File pattern. -exec rm -rf {} \; : Delete all files […]

Read More

How to know if a user is authenticated or not in WCM 8 and 8.5

This is pretty simple way to check if any user has a session started or not; this is useful in cases where you want to display or execute an specific code depending on the user session. To create this kind of validation we can take advantage of the WCM plugins Equals and NotEquals [Plugin:Equals text1=”true” text2=”[Plugin:RequestAttribute key=’userLoggedIn’ […]

Read More

Update Node.js using the terminal

These are just the steps to update Node.js by using your terminal: sudo npm cache clean -f sudo npm install -g n The n package represents a Node helper, and running this command upgrades node to the latest stable version. sudo n stable Just to confirm we can check our version: node -v // Output […]

Read More