Skip to content

Instantly share code, notes, and snippets.

View matinrco's full-sized avatar
🤔

Matin matinrco

🤔
View GitHub Profile
@matinrco
matinrco / toBase64.js
Last active February 26, 2026 02:32
Convert any file to base64 in javascript
var toBase64=function (file , callBack) {
file=file.files[0];
var reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function () {
callBack(file,reader.result);
};
reader.onerror = function (error) {
console.log('Error: ', error);
};
@matinrco
matinrco / letsencryptHowTo.sh
Last active January 25, 2018 17:06
Let’s Encrypt - issue certificates with certbot-auto and renew how to
#this file is not ready for execution
#go to /opt to download certbot-auto
cd /opt
wget https://dl.eff.org/certbot-auto
#correct permissions
chmod a+x certbot-auto
@matinrco
matinrco / deleteOldLogFiles.sh
Created August 30, 2017 10:00
Delete old log files in /var/log
sudo find /var/log -type f -regex ".*\.gz$" -delete
sudo find /var/log -type f -regex ".*\.[0-9]$" -delete