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
#!/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 = {
# --- Update things to make sure we have the latest patches ---
# Add EPEL so we can get reasonably recent packages
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# --- Install all the packages --- #
yum -y install python-whisper python-carbon graphite-web graphite-web-selinux python-memcached python-ldap httpd memcached
yum -y groupinstall "Development Tools"
# ===== Firewall and Security =====
sed -i '/REJECT/ i\-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport http -j ACCEPT' /etc/sysconfig/iptables