Skip to content

Instantly share code, notes, and snippets.

View shamil's full-sized avatar
🎯
Focusing

Alex Simenduev shamil

🎯
Focusing
View GitHub Profile

Installing from scratch

Starting from a fresh install of EL6.5, first install EPEL:

# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

Then install the Graphite dependencies:

# yum -y install python-whisper python-carbon graphite-web python-memcached python-ldap httpd memcached nodejs npm nc
@shamil
shamil / gist:3140541
Created July 19, 2012 03:20 — forked from iwinux/gist:1529093
config.assets.precompile
def compile_asset?(path)
# ignores any filename that begins with '_' (e.g. sass partials)
# all other css/js/sass/image files are processed
if File.basename(path) =~ /^[^_].*\.\w+$/
puts "Compiling: #{path}"
true
else
puts "Ignoring: #{path}"
false
end
@shamil
shamil / gist:3944357
Created October 24, 2012 06:24 — forked from mneedham/gist:3803604
Script to get upstart out of a start/killed state (http://heh.fi/tmp/workaround-upstart-snafu)
#!/usr/bin/env ruby1.8
class Workaround
def initialize target_pid
@target_pid = target_pid
first_child
end
def first_child
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
##################################################################
# /etc/elasticsearch/elasticsearch.yml
#
# Base configuration for a write heavy cluster
#
# Cluster / Node Basics
cluster.name: logng
# Node can have abritrary attributes we can use for routing
@shamil
shamil / gcr-tags.go
Last active August 22, 2016 20:29 — forked from rjeczalik/gcr-tags.go
Reads a tag list for Google Container Registry for the given image.
package main
import (
"encoding/base64"
"encoding/json"
"flag"
"fmt"
"net/url"
"os"
"os/user"
@shamil
shamil / setup-franz-ubuntu.sh
Created December 26, 2016 18:35 — forked from ruebenramirez/setup-franz-ubuntu.sh
setup franz on ubuntu
#!/bin/bash
sudo rm -fr /opt/franz
sudo rm -fr /usr/share/applications/franz.desktop
# create installation dir
sudo mkdir -p /opt/franz
#install franz
@shamil
shamil / .bashrc
Last active June 22, 2020 12:42 — forked from anonymous/.bashrc
Configure OSX shell to be like Debian/Ubuntu. Requires MacPorts.
# ~/.bashrc: executed by bash(1) for non-login shells.
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
@shamil
shamil / reroute.py
Last active July 7, 2021 08:24 — forked from FreeTymeKiyan/reroute.py
An example python script to reroute unassigned shards to NODE_NAME node thus recovering from the red cluster status
#!/usr/bin/env python3
#
# An example python script to reroute unassigned shards to NODE_NAME node,
# thus recovering from the red cluster status
#
# pip install requests before using requests
import requests
import json
@shamil
shamil / README.md
Last active January 23, 2023 18:30 — forked from notheotherben/README.md
Fix Postgres 9.x Sequences

PostgreSQL 9.x Sequence Fixing Script

This script is intended to automatically fix the sequence numbers for all tables in the current database.

This is accomplished through the use of the setval() command, which we provide with the next ID value we wish to make use of. We use the setval(sequence, number, is_called) overload and set is_called = false in conjunction with COALESCE(MAX + 1, 1) to ensure that, with an empty table, the next sequence value is 1 as expected.

Running