Skip to content

Instantly share code, notes, and snippets.

@rafaelrinaldi
rafaelrinaldi / deployer.js
Created June 14, 2016 19:51
Deploy stuff through FTP via npm scripts/CLI
'use strict';
/**
* Simple deployment script.
*
* Run it through:
* $ npm run deploy
*
* Note that the script will add all files to remote server without doing diffs
* or anything. It behaves pretty much like rsync.
@Fuxy22
Fuxy22 / bash_aliases.sh
Last active November 7, 2021 01:36
Bash Script functions to Manage /etc/hosts file for adding/removing hostnames.
# remove specified host from /etc/hosts
function removehost() {
if [[ "$1" ]]
then
HOSTNAME=$1
if [ -n "$(grep $HOSTNAME /etc/hosts)" ]
then
echo "$HOSTNAME Found in your /etc/hosts, Removing now...";
sudo sed -i".bak" "/$HOSTNAME/d" /etc/hosts