Skip to content

Instantly share code, notes, and snippets.

@tinti
tinti / auth.json
Created March 23, 2024 19:39 — forked from miguelmota/auth.json
AWS Cognito Identity authenticate using cURL
{
"AuthParameters" : {
"USERNAME" : "alice@example.com",
"PASSWORD" : "mysecret"
},
"AuthFlow" : "USER_PASSWORD_AUTH",
"ClientId" : "9..............."
}
@tinti
tinti / semantic-commit-messages.md
Created January 15, 2024 08:58 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@tinti
tinti / compile-ffmpeg-nvenc.sh
Created June 14, 2020 15:56
This bash script will compile a static Ffmpeg build with NVENC and VAAPI hardware-accelerated support on Ubuntu in your home directory. You can modify the script to customize the build options as you see fit.
#!/bin/bash
#This script will compile and install a static ffmpeg build with support for nvenc un ubuntu.
#See the prefix path and compile options if edits are needed to suit your needs.
#install required things from apt
installLibs(){
echo "Installing prerequisites"
sudo apt-get update
sudo apt-get -y --force-yes install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev \
@tinti
tinti / install_CUPS_all_defaults.sh
Created May 15, 2020 17:33 — forked from aweijnitz/install_CUPS_all_defaults.sh
Installing CUPS printer on Debian and add PDF printer
#!/bin/bash
sudo apt-get -y install cups
sudo apt-get -y install cups-pdf
# add pdf printer to cups
# - named files end up in ~/PDF/
# - unnamed files are stored in /var/spool/cups-pdf/ANONYMOUS/, such as PDF:s created by streaming bytes over an API
sudo lpadmin -p cups-pdf -v cups-pdf:/ -E -P /usr/share/ppd/cups-pdf/CUPS-PDF.ppd
@tinti
tinti / image64.sh
Created April 4, 2020 14:32 — forked from puppybits/image64.sh
Create data URI image from Terminal command
#!/bin/sh
# Examples:
# ./image64.sh myImage.png
# outputs: data:image/png;base64,xxxxx
# ./image64.sh myImage.png -img
# outputs: <img src="data:image/png;base64,xxxxx">
filename=$(basename $1)
xtype=${filename##*.}
append=""
@tinti
tinti / self-signed-certificate-with-custom-ca.md
Created January 16, 2020 00:09 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@tinti
tinti / InstallDebian-HOWTO.md
Created January 12, 2020 20:49 — forked from varqox/install_debian_with_debootstrap_howto.md
Instruction how to install Debian using debootstrap

Warning

This is a tutorial from 2016, originally for installing debian jessie, it may work for newer versions of debian, but I haven't check it (however, it should mostly work because not that much changed since then). You may want to change every occurrence of buster to a name of a new version of debian.

Install debootstrap

Make work directory:

mkdir work
cd work
@tinti
tinti / ubuntu-x11vnc.md
Created December 19, 2019 21:42 — forked from mgeeky/ubuntu-x11vnc.md
Quick and dirty Ubuntu x11vnc configuration

Ubuntu x11vnc setup with start upon interactive user login to the without-monitor box.

Quick intro

After much time wasted with struggling to get VNC working on Ubuntu that stands for without monitor box - I've compiled the below draft notes on how I finally managed to configure the damn VNC. This should be stated, that I've come a long journey from systemd/init.d configuration scripts, through various VNC daemons (tightvnc, tigervnc, xvnc) and experienced lot of issues (VNC starting before X, VNC not having Xauthority, VNC not being able to open display :0, and so on) .

Finally, this below setup got me working with VNC.

@tinti
tinti / ffmpeg.md
Created March 19, 2019 10:16 — forked from dvlden/ffmpeg.md
Convert video files to MP4 through FFMPEG

This is my personal list of functions that I wrote for converting mov files to mp4!

Command Flags

Flag Options Description
-codec:a libfaac, libfdk_aac, libvorbis Audio Codec
-quality best, good, realtime Video Quality
-b:a 128k, 192k, 256k, 320k Audio Bitrate
-codec:v mpeg4, libx264, libvpx-vp9 Video Codec
@tinti
tinti / Makefile
Created March 12, 2019 15:38
Makefile for Go Projects
GOPATH=$(shell pwd)/vendor:$(shell pwd)
GOBIN=$(shell pwd)/bin
GOFILES=$(wildcard *.go)
GONAME=$(shell basename "$(PWD)")
PID=/tmp/go-$(GONAME).pid
build:
@echo "Building $(GOFILES) to ./bin"
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go build -o bin/$(GONAME) $(GOFILES)