Skip to content

Instantly share code, notes, and snippets.

@nanusdad
nanusdad / simple-expressjs-api-to-use-local-sendmail.md
Last active March 25, 2024 07:34
Simple ExpressJS API to use local sendmail

Simple ExpressJS API to use local sendmail

API code

const express = require('express');
const nodemailer = require('nodemailer');
const app = express();

app.use(express.json());

// Configure Nodemailer to use the local sendmail service
@nanusdad
nanusdad / setting-up-ssl-cert-with-nginx.md
Created March 14, 2024 09:05
Setting up SSL cert with nginx

Setting up SSL cert with nginx

  1. Copy the .crt file and encrypted .key file to nginx server
  2. Decrypt the .key file
openssl rsa -in encrypted.key -out decrypted.key
  1. Concatenate the .crt and and encrypted .key file
cat domain.crt encrypted.key > domain.pem
@nanusdad
nanusdad / sendmail-relay-ubuntu-2204-with-php.md
Created March 12, 2024 11:56
Setting up sendmail relay on Ubuntu 22.04 (with PHP)

Setting up sendmail relay on Ubuntu 22.04 (with PHP)

Test relay, needs host and port

One can use telnet to test; output will be similar to below. (use your email instead of joe@doe.com)

telnet 172.16.10.100 8081
Trying 172.16.10.100...
Connected to 172.16.10.100.
Escape character is '^]'.
220 mailagent.test.com ESMTP Postfix (Ubuntu)
@nanusdad
nanusdad / docker-behind-http-https-proxy.md
Last active December 12, 2023 06:59
Docker configuration behind HTTP or HTTPS proxy

Docker configuration behind HTTP or HTTPS proxy

Create http-proxy configuration file

sudo mkdir -p /etc/systemd/system/docker.service.d
sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf

Add lines similar to the ones below and save file

[Service]
Environment="HTTP_PROXY=http://proxy.example.com:3128"
@nanusdad
nanusdad / raspberry-pi-getting-hardware-info.md
Created November 24, 2023 03:53
Raspberry Pi - Getting hardware information

Raspberry Pi - Getting hardware information

cat /proc/cpuinfo                             # CPU info
cat /sys/firmware/devicetree/model            # Model info
cat /proc/version                             # Software info
free -h                                       # RAM Details
@nanusdad
nanusdad / alfresco-on-docker-cheatsheet.md
Last active December 22, 2023 05:07
Alfresco on Docker cheatsheet

Alfresco on Docker cheatsheet

Create PostgreSQL dump

# find postgresql container ID
sudo  docker ps | grep postgres | awk '{ print $1 }'

# open shell on container (replace container id)
sudo docker exec -it cb96ca00911e /bin/bash
@nanusdad
nanusdad / adding-more-than-2TB-disk-to-Windows.md
Last active May 20, 2023 05:37
Adding more than 2TB disk to Windows

Adding more than 2TB disk to Windows

Maximum capacity of MBR partition tables is only about 2 terabytes. One can use a drive that's larger than 2 terabytes with MBR, but only the first 2 terabytes of the drive will be used. The rest of the storage on the drive will be wasted.

GPT partition tables offer a maximum capacity of 9.7 zetabytes.

If a new large disk has been added - Use Disk Management or diskpart to initialize disk with GPT and then create a volume.

If disk already has MBR partition tables then follow tests below -

@nanusdad
nanusdad / adding-new-disk-ubuntu-20.04.md
Last active May 18, 2023 03:58
Adding additional disk in Ubuntu 20.04

Adding additional disk in Ubuntu 20.04

Check if disk is physically / virtually added to the system

lshw -C disk

Look for the logical name

e.g.

  *-disk:1
 description: SCSI Disk
@nanusdad
nanusdad / alfresco-acs-deployment-community.md
Last active May 17, 2023 10:50
Alfresco ACS deployment (Community) with docker-compose

Alfresco ACS deployment (Community) with docker-compose

Getting started

git clone https://github.com/Alfresco/acs-deployment
cd acs-deployment/docker-compose
cp docker-compose.yml docker-compose.yml-orig # save original
cp community-docker-compose.yml docker-compose.yml
docker compose up 
# OR