Skip to content

Instantly share code, notes, and snippets.

View pablanco's full-sized avatar

Pablo Blanco pablanco

View GitHub Profile
@pablanco
pablanco / gist:0f299835b207db93b39f108bbb4fe87e
Created June 28, 2020 01:59
An example of a redirection without HSTS or CSP
#!/bin/sh
$> curl --head https://www.not-hsts-header.com
HTTP/1.1 301 Moved Permanently
Content-length: 0
---
$> nmap -p 443 --script http-security-headers not-hsts-header.com
....
$> curl --head https://www.hsts-heade-enabled.com
HTTP/2 200
strict-transport-security: max-age=15552000; preload
---
$> nmap -p 443 --script http-security-headers hsts-heade-enabled.com
....
PORT STATE SERVICE
443/tcp open https
$> curl --head https://www.hsts-header-enabled.com
HTTP/2 200
strict-transport-security: max-age=15552000; preload
---
$> nmap -p 443 --script http-security-headers hsts-header-enabled.com
....
PORT STATE SERVICE
443/tcp open https
mkdir gemini-nodejs
cd gemini-nodejs
npm install express body-parser @google/generative-ai dotenv @types/node @types/express @types/body-parser
import { Request, Response } from "express";
import { GoogleGenerativeAI } from '@google/generative-ai';
import dotenv from "dotenv";
dotenv.config();
// GoogleGenerativeAI required config
const configuration = new GoogleGenerativeAI(process.env.API_KEY);
npm run build && npm run start