Skip to content

Instantly share code, notes, and snippets.

View mariogarcia-ar's full-sized avatar
🎯
Focusing

Mario Garcia mariogarcia-ar

🎯
Focusing
  • https://wizefin.tech/
  • Rosario, Santa Fe, Argentina
  • 00:19 (UTC -03:00)
  • LinkedIn in/mariogarciaar
View GitHub Profile
@mariogarcia-ar
mariogarcia-ar / Update-branch.md
Created September 10, 2023 16:49 — forked from santisbon/Update-branch.md
Deploying from #Git branches adds flexibility. Bring your feature branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master.

@mariogarcia-ar
mariogarcia-ar / imageCompression.sh
Created August 29, 2023 21:49 — forked from caubry/imageCompression.sh
Bash script using pngquant and jpegoptim library to compress PNG, JPG and JPEG, with batch compression as an option.
#!bin/bash
pwd=`pwd`
# Set the quality factor to 80
qualityCompression=80;
# Set a minimum quality factor to 20
qualityLimit=20;
# To run a new compression
second_run_compression=false;
# For batch compression
@mariogarcia-ar
mariogarcia-ar / imageresizing.php
Created August 25, 2023 07:11 — forked from georgymh/imageresizing.php
PHP Image resizing and cropping methods.
<?php
/*
Creates a thumbnail keeping the aspect ratio of the source image, and
saves it to a destination $dest.
Credits: http://davidwalsh.name/create-image-thumbnail-php
*/
function make_thumb($src, $dest, $desired_width) {
$info = getimagesize($src);
# invocamos el canister a traves de lineas de comandos
dfx canister call hello_backend greet everyone
# nos retorna
# ("Hello, everyone!")
# creamos el proyecto
dfx new hello
cd hello
# iniciamos el servicio
dfx start --background
# desplegamos la solucion
dfx deploy
# instalamos el sdk, anexo un hotfix por certificado
sh -ci "$(curl -fsSLk https://internetcomputer.org/install.sh)"
# add to .bashrc
export PATH=${HOME}/bin:${PATH}
# Instalar Node
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
source ~/.bashrc
nvm --version
nvm install node npm
# La version actual es 20 pero el SDK soporta el 18
nvm ls-remote
nvm install v18.17.0
nvm use v18.17.0
# ------------------------------------------------------------------------------
# UBUNTU 22
# ------------------------------------------------------------------------------
# https://webmin.com/download/
curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh
sh setup-repos.sh
# apt-get install webmin
apt-get install --install-recommends webmin
add firewall rules to digitalocean
#source: https://computingforgeeks.com/install-virtualmin-on-centos-rhel-linux/
# Step 1: Update CentOS / RHEL system
sudo dnf update -y
sudo hostnamectl set-hostname <your-hostname>
# Step 2: Download Virtualmin install script
sudo dnf -y install wget
wget http://software.virtualmin.com/gpl/scripts/install.sh
#!/bin/bash
# ---------------------------------------------------------------------
# Near: restore.sh
# ---------------------------------------------------------------------
DATE=$(date +%Y-%m-%d-%H-%M)
DATADIR=/home/ohroot/.near/data2
RESTOREDIR=$(ls -td /home/ohroot/backups/*/ | head -1)