Skip to content

Instantly share code, notes, and snippets.

@DagW
DagW / bricklinkser.py
Created March 4, 2021 18:15
Bricklinks store optimizer
#!/bin/python
import json
import os
import requests
# For a list of bricks and their colors
# Find the fewest sellers that you can get your bricks from
# So you dont have to deal with tons of orders from tons of sellers :-)
@DagW
DagW / archive_files_to_zip.py
Last active June 1, 2017 19:22
Archive files in fast growing directories, group a days file to a zip etc. Run via cron or taskscheduler
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import with_statement
from contextlib import closing
from zipfile import ZipFile, ZIP_DEFLATED
import os
import datetime
import shutil
def zipdir(basedir, archivename):
#!/bin/bash
TMPPATH=/tmp/site/
BUCKET=s3://wullt.net/
rm -rf $TMPPATH
wget \
--recursive \
--no-clobber \
#!/bin/bash
IP=$( /usr/bin/curl ipinfo.io/ip )
USAGE=$(cat <<-END
{
"Comment": "Update record to reflect new IP address of this RPI",
"Changes": [
{
"Action": "UPSERT",
#!/bin/bash
/usr/bin/zip -r /tmp/repositories.zip /home/git
/usr/local/bin/aws s3 cp /tmp/repositories.zip s3://wulltnet/rpi/
rm /tmp/repositories.zip
@DagW
DagW / camera_sync_android.sh
Last active March 2, 2018 19:04
Sync *lots* of camera photos from your android phone to a local folder. Can be resumed!
#!/bin/sh
rfolder=/sdcard/DCIM/Camera
lfolder=Images
adb shell ls "$rfolder" > android.files
ls "$lfolder" -1 > local.files
rm -f update.files