Skip to content

Instantly share code, notes, and snippets.

View Inversion-des's full-sized avatar
:octocat:
Developing

Yuriy Babak Inversion-des

:octocat:
Developing
View GitHub Profile
@aishfenton
aishfenton / serializer_benchmarks.rb
Created July 18, 2010 02:32 — forked from visfleet/performance_of_yaml_vs_marshal.rb
Performance comparison of different ruby serializer methods
# sudo gem install bson
# sudo gem install bson_ext
# sudo gem install yajl-ruby
# sudo gem install json
# sudo gem install msgpack
require 'rubygems'
require 'benchmark'
require 'yaml'
require 'bson'
@dmytro
dmytro / gist:7887843
Last active November 8, 2018 11:14
Shell script for SYN flood DOS attacks prevention. Use sqlite3 to filter IP's
#!/bin/bash
SLEEP=120
MAX_CONN=20
MY_IP=0.0.0.0 # Configure your IP here
while true; do
(
echo "create table ips (ip string);"
echo 'begin transaction;'
netstat -an | grep -v ESTABLISHED | grep ${MY_IP}:80 | awk '{print $5}' | cut -f4 -d: | while read IP; do
@fabriciofreitag
fabriciofreitag / detailed_hash_diff.rb
Last active December 21, 2021 03:13
Custom RSPec matcher for detailed hash compasion and diff
RSpec::Matchers.define :be_a_hash_like do |expected_hash|
match do |actual_hash|
matching_results = actual_hash == expected_hash
unless matching_results
system(
"git --no-pager diff $(echo '#{JSON.pretty_generate(expected_hash)}' | git hash-object -w --stdin) " +
"$(echo '#{JSON.pretty_generate(actual_hash)}' | git hash-object -w --stdin) --word-diff",
out: $stdout,
err: :out
)
@amirrajan
amirrajan / demo.md
Last active October 30, 2022 22:22
DragonRuby Game Toolkit - Tech Demo Source Code
the-keeper-iteration-2.mp4