Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
SCRIPT_DIR="$(cd $(dirname "$0") && pwd -P)"
LOGSEQ_DIR="$(dirname "$SCRIPT_DIR")"
PY_SCRIPT="clear_unref_images.py"
"$SCRIPT_DIR/$PY_SCRIPT" "$LOGSEQ_DIR" -b
echo 'DONE'
read
@loveshizuka
loveshizuka / _vultr-snapshot.md
Created December 18, 2017 23:04
Automatic snapshots using Vultr API

Automated Snapshots / Backups via Vultr API

A more customizable alternative to Vultr's backup feature using Vultr API v1. Tested on Ubuntu 16.04. Run this php script on a Vultr instance to create a snapshot of itself and rotate out the oldest snapshot(s). Use the $backup_tag field to uniquely id a set of snapshots.

  1. Set $api_key to your Vultr API key.
  2. Set $num_of_backups to specify how many snapshots to keep.
  3. Set chmod +x vultr-snapshot.php.
  4. Add vultr-snapshot.php to your cron tab.
  5. Epic winning at life.
@loveshizuka
loveshizuka / nginx 反向代理 blog.conf
Created March 3, 2017 16:45 — forked from shellexy/nginx 反向代理 blog.conf
在 vps 用 nginx 反向代理 wordpress/blogger
# /etc/nginx/sites-available/blog.shellexy.info
server {
resolver 8.8.8.8;
listen 80;
server_name blog.shellexy.info;
#access_log off;
access_log /var/log/nginx/blog.shellexy.info.access.log;
location / {
#避免远方启用压缩导致无法替换纯文本
proxy_set_header Accept-Encoding "";