Create user (useradd)
sudo useradd <username>
This command adds an entry to these files:
/etc/passwd/etc/group/etc/shadow/etc/gshadow
| -------------------------------------------- | |
| Xrdp Server (Remote Desktop) Installation: | |
| -------------------------------------------- | |
| Tested in Ubuntu 22.04.03 LTS | |
| 1. Update Environment | |
| $ sudo apt-get update | |
| $ sudo apt-get upgrade |
| // UPDATED for Node 20.x + and aws-sdk v3 | |
| import { DynamoDBClient, PutItemCommand } from "@aws-sdk/client-dynamodb"; | |
| const REGION = process.env.REGION; | |
| const USERTABLE = process.env.USERTABLE; | |
| const ddbClient = new DynamoDBClient({ region: REGION }); | |
| export const handler = async (event, context) => { |
| PORT=xxx | |
| COGNITO_USER_POOL_ID=xxx | |
| COGNITO_CLIENT_ID=xxx | |
| COOKIE_SESSION_SECRET=xxx | |
| COOKIE_SESSION_NAME=xxx | |
| AWS_REGION=xxx | |
| AWS_ACCESS_KEY_ID=xxx | |
| AWS_SECRET_ACCESS_KEY=xxx |
| import React, { useState } from "react"; | |
| import { HiChevronDown } from "react-icons/hi"; | |
| export default function FAQItem({ item, isOpen }: any) { | |
| const [open, setOpen] = useState(isOpen); | |
| return ( | |
| <div | |
| itemScope | |
| itemProp="mainEntity" |
| ## This code example is optimized for Node 16.x runtime. | |
| ## Don't forget to add AWS_REGION and BUCKET_NAME as env variables in Lambda Configuration. | |
| ## Give the Lambda required permission to edit the Bucket. | |
| const AWS = require('aws-sdk'); | |
| AWS.config.update({ region: process.env.AWS_REGION }); | |
| const s3 = new AWS.S3({ | |
| signatureVersion: "v4", | |
| }); |
Create user (useradd)
sudo useradd <username>
This command adds an entry to these files:
/etc/passwd/etc/group/etc/shadow/etc/gshadow| { | |
| "version": "2017-02-28", | |
| "operation": "PutItem", | |
| "key": { | |
| "id": $util.dynamodb.toDynamoDBJson($util.autoId()), | |
| }, | |
| #set($vals = $util.dynamodb.toMapValues($ctx.args.input)) | |
| #set($vals.createdAt = $util.dynamodb.toDynamoDB($util.time.nowISO8601())) | |
| #set($vals.updatedAt = $util.dynamodb.toDynamoDB($util.time.nowISO8601())) |
| // Don't forget to include node_modules with "@mux/mux-node" installed in the Lambda | |
| // Mux reads two environment variables MUX_TOKEN_ID and MUX_TOKEN_SECRET by default. Set them in the Lambda configuration. | |
| import Mux from "@mux/mux-node"; | |
| const { Video, Data } = new Mux(); | |
| export const handler = async (event) => { | |
| // Send id in the request body | |
| // req.body = {id: <id-of-livestream-to-delete>} | |
| const deletedLivestream = await Video.LiveStreams.del(event.id); |
| // Don't forget to include node_modules with "@mux/mux-node" installed in the Lambda | |
| // Mux reads two environment variables MUX_TOKEN_ID and MUX_TOKEN_SECRET by default. Set them in the Lambda configuration. | |
| import Mux from "@mux/mux-node"; | |
| const { Video, Data } = new Mux(); | |
| export const handler = async (event) => { | |
| const livestreams = await Video.LiveStreams.list(); | |
| const response = { |