This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'rails', '3.2.9' | |
# Postgres Database | |
gem 'pg' | |
# Twitter API | |
gem 'twitter' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace ProcessWire; | |
// Using the Woocommerce/WP REST API and bootstrapping a processwire site from the script, | |
// build a csv (to be imported into a processwire link rewrite/redirect module) to ensure | |
// no dead links after site migrations from woocommerce to processwire. | |
require('/yourpwinstall/wire/core/ProcessWire.php'); | |
$st = new ProcessWire('/your/site/location/', 'https://yoururl.yours'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace ProcessWire; | |
// Uses a bootstrapped processwire site from a php script to read in | |
// both an xml export with images and talk to existing live wp site | |
// via Rest API (json output) to move all content and images over to new site. | |
require('/your/location/wire/core/ProcessWire.php'); | |
$bl = new ProcessWire('/your/location/', 'https://your-site.com/'); | |
// Read WP XML Export (with images from plugin) | |
$myposts = simplexml_load_file('your-wp-xml-dump.xml'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace ProcessWire { | |
// Processwire Store Management with Foxycart (from JSON webhook) and ShippingEasy (API). | |
// Manages order status and sends customer data to shipping easy for label printing via dashboard. | |
require_once('/your/pw-site.com/wire/core/ProcessWire.php'); | |
$st = new ProcessWire('/your/pw-site.com/', 'https://pw-site.com/'); | |
} // END PW namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | |
## Backup websites and related files along with databases with borg to a storage box on hetzner. | |
## borg variables | |
## Must use borg >1.1 on deb 9 $ apt -t stretch-backports install borg-backup | |
export BORG_RSH="ssh -i /your/key" | |
export BORG_PASSPHRASE="yourpassphrase" | |
LOG="/var/log/borg/backup.log" | |
BACKUP_USER="hetzneruser" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace ProcessWire; | |
require('/var/www/yourpw.com/wire/core/ProcessWire.php'); | |
$st = new ProcessWire('/var/www/yourpw.com/', 'https://yourpw.com/'); | |
// gmerchant header | |
//id title description link condition price availability image link gtin mpn brand google product category | |
//product_to_google is a pw field - if 1 send it to google, if 0 do not send | |
$myGmerchantProducts = $st->pages->find("template=page-general-product|page-other-product, product_to_google=1, sort=title"); | |
$howMany = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: mytargets | |
become: true | |
tasks: | |
- name: update apt repo and cache | |
apt: | |
upgrade=dist | |
update_cache=yes | |
force_apt_get=yes | |
cache_valid_time=3600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace ProcessWire; | |
// This is an example of the transfer of product data (could be anything) | |
// from a csv to their corresponding fields in a processwire template | |
// and creating the pages. This uses the processwire feature of instantiating | |
// an instance from a command line script to access global variables | |
// (https://processwire.com/blog/posts/multi-instance-pw3/). | |
require('/var/www/dev.dev.com/wire/core/ProcessWire.php'); | |
$st = new ProcessWire('/var/www/dev.dev.com/', 'https://dev.dev.com/'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# alias to provide readable directory listings when using mounted google drives on linux | |
alias lg='gio list -a "standard::display-name"' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from csv import DictReader | |
from django.core.files import File | |
import urllib.request | |
from urllib.request import urlopen | |
from tempfile import NamedTemporaryFile | |
from django.core.management.base import BaseCommand | |
import time | |
from PIL import Image | |
from io import BytesIO | |
from django.core.files.base import ContentFile |
OlderNewer