This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin | |
user=refhi | |
backups=/home/refhi/backups | |
if [[ $EUID > 0 ]] | |
then echo "Please run as root" | |
exit | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var attempts = 1; | |
function createWebSocket () { | |
var connection = new WebSocket(); | |
connection.onopen = function () { | |
// reset the tries back to 1 since we have a new connection opened. | |
attempts = 1; | |
// ...Your app's logic... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Return a timestamp with the format "m/d/yy h:MM:ss TT" | |
* @type {Date} | |
*/ | |
function timeStamp() { | |
// Create a date object with the current time | |
var now = new Date(); | |
// Create an array with the current month, day and time |