Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
#http://blog.rubygems.org/2016/04/06/gem-replacement-vulnerability-and-mitigation.html
require 'rubygems' # for older rubies
require 'rest-client'
require 'bundler'
require 'time'
require 'json'
CHECK_GEMS_BEFORE = Time.parse("Feb 9, 2015")
@jeviolle
jeviolle / bb-openldap.pl
Last active August 29, 2015 14:10 — forked from fsultan/bb-openldap.pl
openldap monitoring script
#!/usr/bin/perl
# Buchan Milne <bgmilne@mandriva.org> 20051213
# Script to monitor OpenLDAP performance and sync-replication status via
# Hobbit (may also still work with BigBrother).
#
# 1)Install Net::LDAP (perl-ldap) and Date::Manip (perl-DateManip)
# 2)Run as task from hobbitserver.cfg (or BBEXT in bbdef.sh for BigBrother)
# 3)Use ncv in hobbit to collect data:
# -add "ol=ncv" to TEST2RRD, and "ncv" to GRAPHS in hobbitserver.cfg
import org.junit.Test
import static org.junit.Assert.assertEquals
// 31 - 62 exponents should fail due to type mismatch
class FooTest {
@Test void test30() {
assertEquals 1073741824, (2 ** 30)
}
@Test void test31() {
@jeviolle
jeviolle / gist:9698949
Last active June 3, 2017 04:34
Recover a deleted open file in linux
This is simple to test.
Step 1
Create a test file
$ echo "OMG Please dont delete me" > /tmp/myfile.text
Step 2