For symmetic encryption, you can use the following:
To encrypt:
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt
To decrypt:
namespace Samples | |
{ | |
using System; | |
using System.Collections.Generic; | |
public class CustomEnumerableDemoConsole | |
{ | |
public static void Main(params string[] args) | |
{ | |
CustomEnumerable enumerable = new CustomEnumerable("One", "Two", "Three"); |
Create file /etc/systemd/system/docker-compose@.service
. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin
, you should use paths specific for your environment.
[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
<# | |
.SYNOPSIS | |
Uses Win32_Fan class to return information about fans in a system. | |
.DESCRIPTION | |
This script first defines some functions to decode various | |
WMI attributed from binary to text. Then the script calls | |
Get-WmiObject to retrieve fan details, then formats that | |
information (using the functions defined at the top of the script. | |
.NOTES |
This is a PoC for running PM2 as a Windows Service under the Local Service account instead of the Local System account.
pm2
or pm2-windows-service
installed yet. (The Powershell script will run npm i
)
pm2-service-uninstall
before running this scriptnpm
and npm-cache
global folders should be somewhere accessible to NT AUTHORITY\LocalService
.
{ | |
"apps": [ | |
{ | |
"name": "web", | |
"script": "C:\\ws\\engineer\\titan-web\\app.js", | |
"args": [], | |
"cwd": "C:\\ws\\engineer\\titan-web", | |
"merge_logs": true, | |
"instances": 1, | |
"exec_mode": "cluster_mode", |
//Install express server | |
const express = require('express'); | |
const path = require('path'); | |
const app = express(); | |
// Serve only the static files form the dist directory | |
app.use(express.static(__dirname + '/dist/<appName>')); | |
app.get('/*', function(req,res) { |
# 1. Download and install go | |
https://golang.org/doc/install | |
# 2. Download and install VMware workstation player | |
https://www.vmware.com/products/workstation-player.html | |
# 3. Download and install vagrant | |
https://www.vagrantup.com/downloads | |
# 4. Download vagrant vmware utility |