Skip to content

Instantly share code, notes, and snippets.

View interbiznw's full-sized avatar
🎯
Focusing

J62 interbiznw

🎯
Focusing
View GitHub Profile
@interbiznw
interbiznw / backup_digitalocean.md
Created March 2, 2022 11:52 — forked from amalmurali47/backup_digitalocean.md
Backup DigitalOcean droplet locally

DigitalOcean does not provide a way to download a snapshot of your droplet locally. You can use rsync to accomplish this instead.

On your local machine, assuming you have added your-server in your SSH config:

rsync -aAXHv --append-verify --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} your-server:/
  • -a : archive mode (all files, with permissions, etc.)
  • -A : preserve ACLs/permissions (not included with -a)
@interbiznw
interbiznw / pirmqtt_v2.py
Created August 1, 2021 05:02 — forked from bphermansson/pirmqtt_v2.py
Python script to send Mqtt message when Gpio on Raspberry Pi changes, for example triggered by a motion sensor
#!/usr/bin/python
# Read a Pir-sensor and send a Mqtt message when motion detected
# Uses edge detection to limit the rate of Mqtt-messages
import paho.mqtt.client as paho
import time
import urlparse
import RPi.GPIO as GPIO
import datetime
# Mqtt
@interbiznw
interbiznw / low-battery-level-detection-notification-for-all-battery-sensors.yaml
Last active June 24, 2021 11:32 — forked from sbyx/low-battery-level-detection-notification-for-all-battery-sensors.yaml
Home Assistant Blueprint: Low battery level detection & notification for all battery sensors
blueprint:
name: Low battery level detection & notification for all battery sensors
description: Regularly test all sensors with 'battery' device-class for crossing
a certain battery level threshold and if so execute an action.
domain: automation
input:
threshold:
name: Battery warning level threshold
description: Battery sensors below threshold are assumed to be low-battery (as
well as binary battery sensors with value 'on').
@interbiznw
interbiznw / Wanhao_Cura_Profile16.ini
Created June 12, 2021 12:09 — forked from joshgerdes/Wanhao_Cura_Profile16.ini
Monoprice Maker Select Plus (Wanhao i3 Plus) Setup
[profile]
layer_height = 0.16
wall_thickness = 1.2
retraction_enable = True
solid_layer_thickness = 1.2
fill_density = 10
nozzle_size = 0.4
print_speed = 50
print_temperature = 200
print_temperature2 = 0
@interbiznw
interbiznw / index.js
Created January 6, 2021 08:55 — forked from jkasun/index.js
Uploading Files to S3 With Node.js
const fs = require('fs');
const AWS = require('aws-sdk');
// Enter copied or downloaded access id and secret here
const ID = '';
const SECRET = '';
// Enter the name of the bucket that you have created here
const BUCKET_NAME = 'test-bucket-1242tsr';;
@interbiznw
interbiznw / facebook-page-invite.js
Last active March 24, 2020 00:33 — forked from guiliredu/facebook-page-invite.js
Facebook - Script to auto invite people who liked a page post do like the page
var buttons;
buttons = document.getElementsByClassName('pam');
for (var i = 0; i < buttons.length; i++) {
buttons[i].click();
}
var buttons;
buttons = document.getElementsByClassName('_42ft');
for (var i = 0; i < buttons.length; i++) {
if(buttons[i].getAttribute('ajaxify') != null){
@interbiznw
interbiznw / transfer.fish
Last active January 15, 2020 14:30 — forked from nl5887/transfer.fish
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@interbiznw
interbiznw / cloudSettings
Created November 17, 2019 04:40 — forked from ch4ot1c/cloudSettings
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-11-17T04:02:28.845Z","extensionVersion":"v3.4.3"}
Testing Log: 13th Oct - branch: algochange192-7
Hardware: CPU i5 and Rig : 3x1070s
ChainParams:
============
consensus.nPowDifficultyBombHeight = 32;
consensus.nHeightDiffBombRemoved = 31;
// Equihash 192,7
@interbiznw
interbiznw / make-image-change-javascript.js
Created July 2, 2019 11:46 — forked from drabbytux/make-image-change-javascript.js
Make Image Change javascript (for theme.js file)
$(document).ready(function() {
thumbnails = $('img[src*="/products/"]').not(':first');
if (thumbnails.length) {
thumbnails.bind('click', function() {
var arrImage = $(this).attr('src').split('?')[0].split('.');
var strExtention = arrImage.pop();
var strRemaining = arrImage.pop().replace(/_[a-zA-Z0-9@]+$/,'');
var strNewImage = arrImage.join('.')+"."+strRemaining+"."+strExtention;
if (typeof variantImages[strNewImage] !== 'undefined') {
productOptions.forEach(function (value, i) {