This file contains hidden or 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/sh | |
| BACKUP_DIR=/server/data # Directory to backup | |
| BACKUP_DEST=/server/backups # Backup destination directory | |
| BACKUP_NAME=backup-$(date +%Y%m%d).tar.gz # Name of the backup file with date and compression | |
| LOGFILE=${BACKUP_DEST}/backup-script-$(date '+%Y%m%d').log # Logfile location in same directory but different extension | |
| echo "---------------------------------" >> $LOGFILE | |
| echo "Backup started on $(date)" | tee -a $LOGFILE |
This file contains hidden or 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
| version: '3.8' | |
| services: | |
| caddy: | |
| image: caddy:2.8.0 | |
| cap_add: | |
| - NET_ADMIN | |
| ports: | |
| - "80:80" | |
| - "443:443" |
This file contains hidden or 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 | |
| # Parse command-line arguments | |
| FORCE=false | |
| while [[ "$#" -gt 0 ]]; do | |
| case $1 in | |
| --force) FORCE=true ;; | |
| *) echo "Unknown parameter passed: $1"; exit 1 ;; | |
| esac | |
| shift |
This file contains hidden or 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
| ykman piv access change-pin | |
| ykman piv access change-puk | |
| ykman piv access change-management-key -g -p | |
| ykman piv keys generate 9a key.pem | |
| ykman piv certificates generate -s "CN=SSH-key" 9a key.pem | |
| ssh-keygen -D /usr/local/Cellar/opensc/0.25.1/lib/opensc-pkcs11.so -e > key_ssh.pub |
This file contains hidden or 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
| const puppeteer = require('puppeteer'); | |
| require('dotenv').config() | |
| const Sentry = require('@sentry/node'); | |
| Sentry.init({ dsn: process.env.SENTRY_DSN }); | |
| var cron = require('node-cron'); | |
| var http = require('http'); | |
| var HOUSES_FOR_DATE = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] | |
| var EVERY_MINUTES = 3 | |
| cron.schedule('*/' + EVERY_MINUTES + ' * * * *', async () => { |
This file contains hidden or 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
| //SPDX-License-Identifier: UNLICENSED | |
| pragma solidity ^0.7.4; | |
| contract Incrementer { | |
| uint256 public number; | |
| constructor(uint256 _initialNumber) { | |
| number = _initialNumber; | |
| } |
This file contains hidden or 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
| docker pull neo4j | |
| docker run --publish=7474:7474 --publish=7687:7687 --volume=path/from/pc:/data neo4j |
This file contains hidden or 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
| # See list of docker virtual machines on the local box | |
| $ docker-machine ls | |
| NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS | |
| default * virtualbox Running tcp://192.168.99.100:2376 v1.9.1 | |
| # Note the host URL 192.168.99.100 - it will be used later! | |
| # Build an image from current folder under given image name | |
| $ docker build -t gleb/demo-app . |
This file contains hidden or 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
| // Node.js CheatSheet. | |
| // Download the Node.js source code or a pre-built installer for your platform, and start developing today. | |
| // Download: http://nodejs.org/download/ | |
| // More: http://nodejs.org/api/all.html | |
| // 0. Synopsis. | |
| // http://nodejs.org/api/synopsis.html |