Skip to content

Instantly share code, notes, and snippets.

View marverix's full-sized avatar

Marek Sierociński marverix

View GitHub Profile
@marverix
marverix / linux-commands-cheatsheet.md
Created December 18, 2019 07:20
Useful Linux Commands Cheatsheet

Useful Linux Commands Cheatsheet

How to change all files extensions within directory?

rename 's/\.old-ext$/\.new-ext/' *.old-ext
@marverix
marverix / port-available.js
Created August 27, 2018 13:56
Node.js - Sync check if local port is available (linux only!)
const { execSync } = require('child_process');
module.exports = function(port) {
try {
execSync('nc -z 127.0.0.1 ' + port);
} catch(e) {
return true;
}
return false;
};