Skip to content

Instantly share code, notes, and snippets.

View shamil's full-sized avatar
🎯
Focusing

Alex Simenduev shamil

🎯
Focusing
View GitHub Profile
@shamil
shamil / gist:2165160
Created March 22, 2012 22:35 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -out ca.key 2048
openssl req -new -x509 -days 365 -key ca.key -out ca.crt

Create the Client Key and CSR

@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
@shamil
shamil / uuid.js
Created November 26, 2012 15:52 — forked from jcxplorer/uuid.js
UUID v4 generator in JavaScript (RFC4122 compliant)
function uuid() {
var uuid = "", i, random;
for (i = 0; i < 32; i++) {
random = Math.random() * 16 | 0;
if (i == 8 || i == 12 || i == 16 || i == 20) {
uuid += "-"
}
uuid += (i == 12 ? 4 : (i == 16 ? (random & 3 | 8) : random)).toString(16);
}
@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
#!/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

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 / 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