Archive for 2016

InfluxDB: Bash script to launch and configure two nodes

I’ve just created a quick bash script because I”m working a little with InfluxDB at the moment. InfluxDB is a time series database written in GO. The script will setup two influxdb nodes, setup some users and download and load some sample data. It’s developed on a Mac but should work in Linux (not tested […]

mongodb_consistent_backup: A quick example

Just a quick post here to share some notes I made when using the mongodb_consistent_backup tool. This was performed on a installed of Red Hat Enterprise Linux Server release 7.2 (Maipo) running python 2.7.5. Install required packages and clone the tools repo; ?View Code BASHyum install python python-devel python-virtualenv gcc yum install mongodb-org-tools yum install git git clone […]

A quick mongofile demo

Here’s a few simple examples of using the mongofiles utility to use MongoDB GridFS to store, search and retrieve files. Upload a file into MongoDB into a database called gridfs ?View Code BASHmongofiles -u admin -padmin –authenticationDatabase admin –db gridfs put xfiles.504-amc.avi 2016-11-15T21:44:30.728+0100 connected to: localhost added file: xfiles.504-amc.avi Two collections will be created in the gridfs […]

Bash: Count the number of databases in a gzip compressed mysqldump

A simple bash one-liner! ?View Code BASHgunzip -c /path/to/backup/mysqldump.sql.gz | grep -E "^CREATE DATABASE" | wc -l Breaking this down.. This prints the contents of a gzip compressed mysqldump to the terminal ?View Code BASHgunzip -c /path/to/backup/mysqldump.sql.gz Grep for lines that start with CREATE DATABASES… ?View Code BASHgrep -E "^CREATE DATABASE" Count the number of […]

Getting started with osquery on CentOS

I recently stumbled across osquery which allows you to query your Linux, and OS X, servers for various bits of information. It’s very similar in concept to WQL for those in the Windows world. Here’s my quick getting started guide for CentOS 6.X… First download and install the latest rpm for your distro. You might want to […]