Skip to content

Instantly share code, notes, and snippets.

@dolcalmi
dolcalmi / mock.js
Created April 25, 2023 00:34 — forked from christianhaller3000/mock.js
Mock node dns resolver
jest.mock("dns", () => {
return {
promises: {
Resolver: function() {
return {
resolveTxt: () => {
return ["1.1.1.1","2.2.2.2/28"];
}
};
}
@dolcalmi
dolcalmi / install-nodejs-on-raspberrypi-armv6.md
Created June 14, 2021 19:40 — forked from davps/install-nodejs-on-raspberrypi-armv6.md
Steps to install nodejs on Raspberry Pi B+ (armv6)

Steps to install nodejs v6.2 on Raspberry Pi B+ (armv6)

cd ~
wget http://nodejs.org/dist/v6.2.1/node-v6.2.1-linux-armv6l.tar.gz
tar -xzf node-v6.2.1-linux-armv6l.tar.gz
node-v6.2.1-linux-armv6l/bin/node -v

The last command should print v6.2.1.

Now you can copy it to /usr/local

@dolcalmi
dolcalmi / clean.sh
Created July 18, 2020 15:32 — forked from Iman/clean.sh
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
@dolcalmi
dolcalmi / ember_examples.md
Created November 24, 2015 19:49 — forked from rwjblue/ember_examples.md
Ember Examples
#! /usr/bin/env bash
# Variables
APPENV=local
DBHOST=localhost
DBNAME=dbname
DBUSER=dbuser
DBPASSWD=test123
echo -e "\n--- Mkay, installing now... ---\n"