Skip to content

Instantly share code, notes, and snippets.

@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
@gardart
gardart / imo_reykjavik_3h.yml
Last active April 7, 2024 08:49
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 / 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

#!/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 / 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":[
@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
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 / 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.
#
@gardart
gardart / install-nagios4-thruk-adagios-RHEL7.txt
Created October 7, 2017 20:51
install-nagios4-thruk-adagios-RHEL7.txt
yum update -y
yum install -y epel-release
yum clean all
# Add repos
rpm -Uvh "https://labs.consol.de/repo/stable/rhel7/i386/labs-consol-stable.rhel7.noarch.rpm"
rpm -ihv http://opensource.is/repo/ok-release.rpm
yum update -y ok-release
#
@gardart
gardart / VMM-Performance-Status.ps1
Created September 8, 2017 12:27
VMM-Performance-Status
# Export TOP X Performance statistics from VMM into a HTML table
$htmlfile = "c:\temp\status.html"
$firstx=10; # Select number of objects to list in the tables
# CSS style
$a = "<style>"
$a = $a + "BODY{background-color:peachpuff;}"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:thistle}"
$a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:PaleGoldenrod}"