Skip to content

Instantly share code, notes, and snippets.

View abraverm's full-sized avatar

Alexander Braverman Masis abraverm

  • Red Hat
  • Canada
  • 03:34 (UTC -05:00)
View GitHub Profile
@abraverm
abraverm / CentOS-SCLo-scl-rh.repo
Created July 18, 2017 09:01
Development-toolkit
# CentOS-SCLo-rh.repo
#
# Please see http://wiki.centos.org/SpecialInterestGroup/SCLo for more
# information
[centos-sclo-rh]
name=CentOS-7 - SCLo rh
baseurl=http://mirror.centos.org/centos/7/sclo/$basearch/rh/
gpgcheck=1
enabled=1
@abraverm
abraverm / keyring.js
Created May 26, 2017 18:25
Vimperator plugin for pass (based on keyring plugin)
/**
* Copyright (c) 2010 - 2016 by Eric Van Dewoestine
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
@abraverm
abraverm / vpn_status.sh
Created August 28, 2016 19:44
OpenVPN server status auto shutdown container crontab
#!/bin/bash
CLIENT_LIST_START=$(docker exec -i vpn-server grep -m 1 -n "Connected Since" /tmp/openvpn-status.log | cut -d ":" -f 1)
CLIENT_LIST_END=$(docker exec -i vpn-server grep -m 1 -n "ROUTING[ _]TABLE" /tmp/openvpn-status.log | cut -d ":" -f 1)
CLIENT_COUNT=$((${CLIENT_LIST_END} - ${CLIENT_LIST_START} - 1))
if [ ! -e "/tmp/vpn_check" ]; then
echo 1 > "/tmp/vpn_check"
fi
NUM_CHECK=$(cat "/tmp/vpn_check")
if [ ! $CLIENT_COUNT -gt "0" ]; then
@abraverm
abraverm / main.js
Created May 7, 2015 11:13
elasticsearch dashboard
/**
*
* Created by shelbysturgis on 1/23/14.
*/
define(['scripts/d3.v3', 'scripts/elasticsearch', 'scripts/c3/c3'], function (d3, elasticsearch) {
"use strict";
var client = new elasticsearch.Client({
host: 'http://elasticsearch-abraverm.rhcloud.com/elasticsearch',
#
# Installs NRPE and asks puppet managed Nagios to create required
# configurations using exported resources feature.
# The exported resourcs relays on PuppetDB, make sure Puppet Master using it.
#
# === Parameters
#
# [*nagios_servers*]
# FQDN of Nagios server.
# The parameter used as a list of allows servers in nrpe.cfg
@abraverm
abraverm / Couldn't find Host::Managed without an ID
Created March 15, 2015 07:57
Couldn't find Host::Managed without an ID
---
- /opt/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/relation/finder_methods.rb:313:in
`find_with_ids'
- /opt/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/relation/finder_methods.rb:107:in
`find'
- /opt/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/querying.rb:5:in
`find'
- /opt/foreman/app/models/host.rb:16:in `method_missing'
- /opt/foreman/vendor/ruby/1.9.1/gems/foreman_snapshot-0.1.0/app/models/hostgroup_extensions.rb:16:in
`block in snapshot!'
@abraverm
abraverm / cmd_docker
Created February 17, 2015 10:31
Run commands and enter Docker conatiner without using SSH: $ cmd_docker <CONTAINER NAME> /bin/bash
#!/bin/bash
CONTAINER=$1
COMMAND=$2
ID=`docker inspect --format '{{ .State.Pid }}' $CONTAINER`
sudo nsenter -m -u -n -i -p -t $ID $COMMAND