Skip to content

Instantly share code, notes, and snippets.

View thiagosanches's full-sized avatar
🏠
Working from home

Thiago Sanches thiagosanches

🏠
Working from home
View GitHub Profile
@thiagosanches
thiagosanches / main.tf
Last active March 30, 2022 11:21
Terraform recipe that creates loadbalancer and backend bucket
provider "google" {
project = "your-project-name"
}
# Create new storage bucket in the US region
# with coldline storage
resource "google_storage_bucket" "static_bucket" {
name = "${var.project}-${var.bucket_name}"
location = var.bucket_region
storage_class = "COLDLINE"
$0 = 10 (Step pulse time, microseconds)
$1 = 200 (Step idle delay, milliseconds)
$2 = 0 (Step pulse invert, mask)
$3 = 0 (Step direction invert, mask)
$4 = 0 (Invert step enable pin, boolean)
$5 = 0 (Invert limit pins, boolean)
$6 = 0 (Invert probe pin, boolean)
$10 = 3 (Status report options, mask)
$11 = 0.020 (Junction deviation, millimeters)
$12 = 0.002 (Arc tolerance, millimeters)
FROM ubuntu:20.04
RUN apt-get update && apt-get -y install sudo
RUN DEBIAN_FRONTEND=noninteractive apt install -y tzdata
RUN adduser --disabled-password --gecos '' guest
RUN adduser guest sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER guest
WORKDIR /home/guest
@thiagosanches
thiagosanches / createMarkdownFromTelegramExportedChat.js
Last active February 5, 2023 12:35
A little nodejs script that load a JSON exported chat from Telegram, in order to get the links and create a markdown with them, so I can use them in LogSeq.
const fs = require('fs')
const axios = require('axios')
const myData = require('./result.json');
const regexTitleTag = /<title>(.*)<\/title>/g;
const regexRedditPost = /<meta property="og:title" content\=\"(.*?")/gm;
async function getContentFromURL(url) {
let html = null
try {