Skip to content

Instantly share code, notes, and snippets.

@gardart
gardart / robocopy_powershell.ps1
Created August 2, 2018 14:32
Robocopy with Powershell
###
#
# This script runs robocopy jobs in parallel by increasing the number of outstanding i/o's to the VPSA. Even though you can
# change the number of threads using the "/mt:#" parameter, your backups will run faster by adding two or more jobs to your
# original set.
#
# To do this, you need to subdivide the work into directories. That is, each job will recurse the directory until completed.
# The ideal case is to have 100's of directories as the root of the backup. Simply change $src to get
# the list of folders to backup and the list is used to feed $ScriptBlock.
#
from lxml import html
import csv
import os
import requests
from exceptions import ValueError
from time import sleep
from random import randint
def parse(url):
headers = {
@gardart
gardart / amazon_reviews.py
Created January 17, 2019 22:36 — forked from scrapehero/amazon_reviews.py
Python 3 code to extract amazon reviews
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Written as part of https://www.scrapehero.com/how-to-scrape-amazon-product-reviews-using-python/
from lxml import html
from json import dump,loads
from requests import get
import json
from re import sub
from dateutil import parser as dateparser
from time import sleep
@gardart
gardart / amazon_bestseller.json
Created January 17, 2019 22:37 — forked from scrapehero/amazon_bestseller.json
JSON Sitemap to scrape amazon bestseller listings from Amazon using Web Scraper Chrome Extension
{
"_id":"amazon_pet",
"startUrl":[
"https://www.amazon.com/Best-Sellers-Pet-Supplies/zgbs/pet-supplies/ref=zg_bs_nav_0"
],
"selectors":[
{
"id":"product",
"type":"SelectorElement",
"parentSelectors":[
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Written as part of https://www.scrapehero.com/how-to-scrape-amazon-product-reviews-using-python/
from lxml import html
import json
import requests
import json,re
from dateutil import parser as dateparser
from time import sleep
@gardart
gardart / install_nrpe_pi.md
Last active February 7, 2019 22:20
Raspberry Pi - Install Nagios NRPE

# Debian | Raspbian

All steps on Debian require to run as root. To become root simply run:

Debian

su

Raspbian

@gardart
gardart / imo_reykjavik_3h.yml
Last active May 6, 2024 11:00
Home Assistant skynjari fyrir 3ja tíma mannaðar veðurathuganir frá Veðurstofu Íslands
#########################
# 5.4.2024 : Breytti ur apis.is yfir i xml thjonustu vedur.is
#
# Home Assistant skynjari fyrir 3ja tíma mannaðar veðurathuganir frá Veðurstofu Íslands.
# Mannaðar veðurstöðvar birta athuganir á 3 klst fresti.
# https://www.vedur.is/media/vedurstofan/XMLthjonusta.pdf
#
# Stöðvanúmerin má finna með því að fara á slóðina: https://www.vedur.is/vedur/stodvar
# Hér að neðan er Reykjavík valin (station=1)
#
@gardart
gardart / create-cloud-template.sh
Created January 30, 2022 20:57 — forked from ManuelSchmitzberger/create-cloud-template.sh
This script will download a cloud image of many Linux distros and create a Proxmox 6 KVM template from it.
#!/bin/bash
set -o errexit
clear
printf "\n*** This script will download a cloud image and create a Proxmox VM template from it. ***\n\n"
### HOW TO USE
### Pre-req:
### - run on a Proxmox 6 server
### - a dhcp server should be active on vmbr1