Skip to content

Instantly share code, notes, and snippets.

View omame's full-sized avatar
🤌

Daniele Valeriani omame

🤌
View GitHub Profile
2017/12/08 21:58:35 [DEBUG] Starting graph walk: walkApply
2017-12-08T21:58:35.017+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.0.1_x4: 2017/12/08 21:58:35 [INFO] Successfully loaded config file (/Users/omame/.kube/config; default context)
2017/12/08 21:58:35 [DEBUG] apply: kubernetes_persistent_volume.consul.2: executing Apply
module.consul.kubernetes_persistent_volume.consul[2]: Creating...
metadata.#: "" => "1"
metadata.0.generation: "" => "<computed>"
metadata.0.name: "" => "consul-03-disposable-envs-01-pv"
metadata.0.resource_version: "" => "<computed>"
2017/12/08 21:58:35 [DEBUG] apply: kubernetes_persistent_volume.consul.0: executing Apply
metadata.0.self_link: "" => "<computed>"
@omame
omame / zfs-arc-statsd.sh
Created April 1, 2015 16:44
Send ZFS Linux metrics to statsd
#!/bin/bash
# A port of ZFS stats for FreeBSD plugin to Linux, adapted to send metrics to statsd.
#
# Author: Daniele Valeriani <daniele@valeriani.co.uk>
# Author of the original munin plugin: David Bjornsson <dabb@lolnet.is>
# Author of the Linux port: Alex Chistyakov <alexclear@gmail.com>
PREFIX="servers.`hostname`.zfs"
STATSD_ADDR="YOUR STATSD SERVER"

Keybase proof

I hereby claim:

  • I am omame on github.
  • I am omame (https://keybase.io/omame) on keybase.
  • I have a public key ASBRlINsOAxEMRTzkD2KyviE6olnadCIYOQm7X-0sWbv3Qo

To claim this, I am signing this object:

@omame
omame / check_partition_alignment.sh
Last active January 1, 2016 18:28
Check if partitions on 512e drives are aligned with the 4K sector size
for controller in `/opt/dell/srvadmin/bin/omreport storage controller | grep '^ID' | awk '{print $NF}' | grep -v '^0'`
do
for unit in {0..44}
do
echo -n "c${controller}u${unit}: "
/opt/dell/srvadmin/bin/omreport storage pdisk controller=$controller vdisk=$unit | grep -q "TOSHIBA DT01ACA300"
if [ $? -eq 0 ]
then
device=`/opt/dell/srvadmin/bin/omreport storage vdisk controller=$controller vdisk=$unit | grep '^Device Name' | awk '{print $NF}'`
start_sector=`sudo parted -s $device u s p | grep 'primary$' | awk '{print $2}' | tr -d s`
@omame
omame / .bashrc-coloured-prompt
Created December 5, 2013 18:41
My PS1. Yellow when working on my pc. Blue when working on a remote server. Last $ is red when previous command failed, otherwise is green.
# Check if we're on a ssh connection
if [ ! -z "$SSH_TTY" ]; then
pscolor=94 # Yellow
else
pscolor=33 # Blue
fi
function exitstatus {
# Manage exit status within the coloured prompt
if [ $? -ne 0 ]; then
@omame
omame / align-partitions.sh
Last active December 28, 2015 23:59
The partitions on 512e Advanced Format drives need to start on a sector which is a multiple of 8 (4KB / 512B = 8) otherwise the drive performance will be quite poor. The first 33 bytes are reserved for the GPT label, same goes for the last 33 bytes, which are reserved too. This script scans for Toshiba DT01ACA300 drives on a perc800/810 controll…
pgrep -cf swift-object-server &>/dev/null && exit 1
for controller in `omreport storage controller | grep '^ID' | awk '{print $NF}' | grep -v '^0'`
do
for unit in {0..44}
do
/opt/dell/srvadmin/bin/omreport storage pdisk controller=${controller} vdisk=${unit} | grep -q "TOSHIBA DT01ACA300" && grep "c${controller}u${unit} " /etc/fstab | grep -vq inode64
if [ $? -eq 0 ]
then
echo "Starting to re-align c${controller}u${unit}"
sudo umount /srv/node/c${controller}u${unit}