Skip to content

Instantly share code, notes, and snippets.

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

Federico Márquez fedemzcor

🏠
Working from home
View GitHub Profile
@fedemzcor
fedemzcor / LXD-cheat-sheet.md
Created February 23, 2024 05:44 — forked from berndbausch/LXD-cheat-sheet.md
LXD cheat sheet

Useful LXD commands

Summarized from https://stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/.

Interestingly, the LXD command line client is named.... lxc!

List available containers

lxc image list ubuntu:        # ubuntu: is officially supported image source
lxc image list images:        # images: is an unsupported source
lxc image alias list images:  # lists user-friendly names
@fedemzcor
fedemzcor / extract_frames.cpp
Created February 25, 2022 01:12 — forked from itsrifat/extract_frames.cpp
simple c++ functions to extract frames of a video file into a vector of Mat and saving the vector as jpg images using OpenCV 2.4.9
/*
This functions opens a video file and extracts the frames and put them into a vector of Mat(its the class for representing an img)
*/
void extract_frames(const string &videoFilePath,vector<Mat>& frames){
try{
//open the video file
VideoCapture cap(videoFilePath); // open the video file
if(!cap.isOpened()) // check if we succeeded
CV_Error(CV_StsError, "Can not open Video file");
/opt/netdata/usr/sbin/netdata-claim.sh
AWSTemplateFormatVersion: 2010-09-09
Description: Cloudformation to forward SES email to another address
Parameters:
FromAddress:
Description: Email forwarded from address
Type: String
ToAddress:
Description: Email forwarded to address
Type: String
Resources:
@fedemzcor
fedemzcor / ssh.sh
Created May 27, 2020 08:38 — forked from zircote/ssh.sh
Convert a AWS PEM into a ssh pub key
ssh-keygen -y -f private_key1.pem > public_key1.pub
@fedemzcor
fedemzcor / packer_setup.sh
Created May 18, 2020 09:41 — forked from ishu3101/packer_setup.sh
Install Packer on Ubuntu 16.04
curl -SL https://releases.hashicorp.com/packer/1.3.2/packer_1.3.2_linux_amd64.zip -o packer_1.3.2_linux_amd64.zip
unzip packer_1.3.2_linux_amd64.zip
sudo mv packer /usr/bin/packer

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@fedemzcor
fedemzcor / AesUtil.js
Created March 12, 2019 02:36 — forked from AndiDittrich/AesUtil.js
Node.js - AES Encryption/Decryption with AES-256-GCM using random Initialization Vector + Salt
// AES Encryption/Decryption with AES-256-GCM using random Initialization Vector + Salt
// ----------------------------------------------------------------------------------------
// the encrypted datablock is base64 encoded for easy data exchange.
// if you have the option to store data binary save consider to remove the encoding to reduce storage size
// ----------------------------------------------------------------------------------------
// format of encrypted data - used by this example. not an official format
//
// +--------------------+-----------------------+----------------+----------------+
// | SALT | Initialization Vector | Auth Tag | Payload |
// | Used to derive key | AES GCM XOR Init | Data Integrity | Encrypted Data |
@fedemzcor
fedemzcor / gist:22a981d1390227d9693eb2cc0175e57d
Created February 26, 2019 08:19 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@fedemzcor
fedemzcor / config
Created February 20, 2019 23:09 — forked from justinpawela/config
AWS CodeCommit Multiple Account Config
# This file is: ~/.ssh/config
# You may have other (non-CodeCommit) SSH credentials stored in this
# config file – in addition to the CodeCommit settings shown below.
# NOTE: Make sure to run [ chmod 600 ~/.ssh/config ] after creating this file!
# Credentials for Account1
Host awscc-account1 # 'awscc-account1' is a name you pick
Hostname git-codecommit.us-east-1.amazonaws.com # This points to CodeCommit in the 'US East' region