Skip to content

Instantly share code, notes, and snippets.

View alxschwarz's full-sized avatar

Alexander Feller alxschwarz

View GitHub Profile
@alxschwarz
alxschwarz / consul.service
Created May 19, 2017 14:04 — forked from Manc/consul.service
/etc/systemd/system/consul.service
[Unit]
Description=Consul service discovery agent
Requires=network-online.target
After=network.target
[Service]
User=consul
Group=consul
PIDFile=/run/consul/consul.pid
Restart=on-failure
@alxschwarz
alxschwarz / gcsfuse.service
Created April 5, 2017 10:46 — forked from jaynzr/gcsfuse.service
GCSFuse systemd service /etc/systemd/system/gcsfuse.service /etc/systemd/system/gcsfuse.service.d/settings.conf
[Unit]
Description=GCS Fuse
After=network.target
[Service]
User=www-data
Group=www-data
WorkingDirectory=/bin
Type=oneshot
RemainAfterExit=yes
@alxschwarz
alxschwarz / ansible_command_line
Created February 23, 2017 12:17
Using ansible in command line
ansible -i hosts '192.168.1.10*' -m setup | sed 's/.*|.*=>.*/{/g' | jq -r '.ansible_facts.ansible_hostname'
@alxschwarz
alxschwarz / gcs.go
Created February 17, 2017 12:57 — forked from techjanitor/gcs.go
Upload a file to Google Cloud Storage
package main
import (
"errors"
"fmt"
"golang.org/x/oauth2"
"golang.org/x/oauth2/jwt"
storage "google.golang.org/api/storage/v1"
"os"
)
@alxschwarz
alxschwarz / redis-backup.sh
Created November 3, 2016 10:08 — forked from acenqiu/redis-backup.sh
redis rdb backup script
#!/bin/bash
#
## redis backup script
## usage
## redis-backup.sh port backup.dir
port=${1:-6379}
backup_dir=${2:-"/data/backup/redis"}
cli="/usr/local/bin/redis-cli -p $port"
@alxschwarz
alxschwarz / redis_backup.sh
Created November 3, 2016 10:07
A Backup Script To Move Redis RDBs and AOF to S3.
#!/bin/bash
#################################################################
## AUTHOR: allan parsons ([email protected])
## DATE: 2013-July-24
## PURPOSE:
## We currently have multiple redis processes running on a
## single box, and we're wanting to backup all of the rdb
## files and aof files to S3 on a semi-regular basis.
## This loops through all the configs to find the appropriate
## AOF, RDB, and instance names.