Skip to content

Instantly share code, notes, and snippets.

View undrash's full-sized avatar
🎧
Vibing

Andrei Gaspar undrash

🎧
Vibing
View GitHub Profile
@undrash
undrash / node-secret-santa.js
Last active December 5, 2019 21:02
Quick and dirty secret santa with nodemailer
const nodemailer = require( "nodemailer" );
const dotenv = require( "dotenv" );
dotenv.config();
@undrash
undrash / sshkeygen.txt
Created December 3, 2019 10:54
Quick generate SSH key
ssh-keygen -o -t rsa -b 4096 -C "user@email.com"
LINUX COPY CLIPBOARD
xclip -sel clip < ~/.ssh/id_rsa.pub
COPY MANUALLY
cat ~/.ssh/id_rsa.pub
@undrash
undrash / gist:e9252cf8e39f2c83e8880477f60fd619
Created November 5, 2019 10:10
docker letsencrypt live renewal
////////// default.conf that was working
server {
listen 80;
listen [::]:80;
server_name scrumbs.app *.scrumbs.app;
#for certbot challenges (renewal process)
location ~ /.well-known/acme-challenge {
allow all;
@undrash
undrash / count-lines-of-code
Created August 3, 2019 16:23
Count lines of code in a directory
WINDOWS
(for /r %f in (*.extension) do @type "%f") | find /c /v ""
UNIX
find . -name '*.extension' | xargs wc -l
@undrash
undrash / ubuntu-disk-spate-commands
Last active July 30, 2019 16:47
Ubuntu disk space commands
FIND TOTAL DISK SPACE
df -h --total
FIND WHAT IS USING UP SPACE
du -cha --max-depth=1 / | grep -E "M|G"
* this locates the foder - once you find the folder, execute the command against it
du -cha --max-depth=1 /<FOLDER_NAME> | grep -E "M|G"
@undrash
undrash / react-node-notes
Last active June 21, 2019 17:02
Full stack react with node
////////////////// Full stack react //////////////////
@undrash
undrash / docker-mongo-service-backup
Last active May 11, 2019 21:26
Shell script for backing up a mongo database running as a service in a swarm cluster.
#!/bin/bash
echo "***** Validating arguments *****"
if [ $# -eq 3 ]
then
echo "Number of arguments is valid."
else
echo "Invalid number of arguments provided!"
echo "Expected: 3"
const mongoURL = Database.URI || process.env.DATABASE_URI as string;
const mongoOPTIONS = {
useNewUrlParser: true,
autoReconnect: true,
reconnectTries: Number.MAX_VALUE,
bufferMaxEntries: 0
};
const tl = new TimelineLite({
onComplete: () => {
this.projectsContainer.style.display = "none";
this.addProjectBtn.style.display = "none";
this.projectsContainer.style.opacity = "1";
this.addProjectBtn.style.opacity = "1";
}
});
@undrash
undrash / jenkins-twitter-shell-script
Last active April 11, 2019 19:44
Commit triggered tweets
Dependencies:
-> http_post http://acme.com/software/http_post/
-> oauth_sign http://acme.com/software/oauth_sign/
Steps to install dependencies:
HTTP_POST
1. Download
wget http://acme.com/software/http_post/http_post_18May2018.tar.gz