Skip to content

Instantly share code, notes, and snippets.

View shadowbq's full-sized avatar
👔
Doing Things

shadowbq shadowbq

👔
Doing Things
View GitHub Profile
@shadowbq
shadowbq / Guard Celluloid - Gem list
Last active August 29, 2015 14:07
Celluloid rb-kqueue on freebsd test
*** LOCAL GEMS ***
benchmark-ips (1.2.0)
benchmark_suite (1.0.0)
bundler (1.3.5, 1.3.1)
celluloid (0.15.2, 0.15.0)
coderay (1.1.0)
coveralls (0.7.0)
diff-lcs (1.2.5)
docile (1.1.1)
@shadowbq
shadowbq / mysql-proxy.conf
Created October 1, 2014 04:00
ubuntu 14.04 upstart mysql-proxy service configuration
# mysql-proxy.conf (Ubuntu 14.04.1) Upstart proxy configuration file for AWS RDS
# mysql-proxy - mysql-proxy job file
description "mysql-proxy upstart script"
author "shadowbq <shadowbq@gmail.com>"
# Stanzas
#
# Stanzas control when and how a process is started and stopped
# See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas#respawn
@shadowbq
shadowbq / PeID.yara
Created October 23, 2014 04:13
PeID.yara
rule MSLRHv032afakePCGuard4xxemadicius
{
strings:
$a0 = { FC 55 50 E8 00 00 00 00 5D EB 01 E3 60 E8 03 00 00 00 D2 EB 0B 58 EB 01 48 40 EB 01 35 FF E0 E7 61 58 5D EB 05 E8 EB 04 40 00 EB FA E8 0A 00 00 00 E8 EB 0C 00 00 E8 F6 FF FF FF E8 F2 FF FF FF 83 C4 08 74 04 75 02 EB 02 EB 01 81 50 E8 02 00 00 00 29 5A 58 6B C0 03 E8 02 00 00 00 29 5A 83 C4 04 58 74 04 75 02 EB 02 EB 01 81 0F 31 50 0F 31 E8 0A 00 00 00 E8 EB 0C 00 00 E8 F6 FF FF FF E8 F2 FF FF FF }
condition:
$a0 at entrypoint
}
@shadowbq
shadowbq / test-deps-barnyard2-mysql-freebsd-9.3.rb
Created January 26, 2015 16:42
Dependency test for Barnyard2 compiled on FreeBSD 9.3 with MySQL
#!/usr/bin/env ruby
## Barnyard2 compiled on FreeBSD 9.3 with MySQL
filelist = %w{ /usr/local/lib/mysql/libmysqlclient.so.18 /lib/libz.so.6 /lib/libpcap.so.8 /lib/libm.so.5 /lib/libc.so.7 /usr/lib/libstdc++.so.6 /lib/libgcc_s.so.1 /lib/libthr.so.3}
require 'fileutils'
filelist.each do |libso|
puts "Missing: #{libso}" unless File.file?(libso)
end
puts "done."
@shadowbq
shadowbq / .gitignore
Last active August 29, 2015 14:14 — forked from cehoffman/.gitignore
SSHGuard => sshguard-dump sshguard-reprieve
build/
Makefile
sshguard-prefix/
CMakeFiles
CMakeCache.txt
cmake_install.cmake
@shadowbq
shadowbq / CheckExif.sh
Last active August 29, 2015 14:14
Zenity (Gnome) Shell popup to show Exif data or Hash files
#!/bin/bash
AppVer="1.0.1-shadowbq"
if [ "$1" = "" ]; then
SelectedFile=`zenity --title="Choose a file to check" --file-selection`
fi
if [ "$SelectedFile" = "" ]; then
if [ $# -gt 1 ]; then
@shadowbq
shadowbq / barnyard_waldo.rb
Created May 14, 2015 20:23
Print the struct data from the barnyard waldo file
#!/usr/bin/env ruby
#
# $> ./barnyard_waldo.rb
# Barnyard spool: /var/log/snort/merged.log.1431634445
# 2015-05-14 20:14:05 +0000
# Notes:
# Ruby String #unpack
# V | Integer | 32-bit unsigned, VAX (little-endian) byte order
@shadowbq
shadowbq / gem_hunt.sh
Created May 23, 2015 15:54
find shebangs that are explict .. and likely wrong.
#!/usr/bin/env bash
#
# Find FreeBSD gems that are hardcoded to a ruby minor version
# example: /usr/local/bin/ruby20
find /usr/local/bin/ -type f | xargs file | grep Ruby | awk 'BEGIN { FS = ":" }; { print $1 }' |xargs head -1
@shadowbq
shadowbq / restart_worker.rb
Last active August 29, 2015 14:24
find and kill all old worker.rb and restart in context
#!/bin/sh
# Ubuntu tested 14.04.2
# root@downloader:/usr/local/www/ydl# ps -U www-data -u www-data ajf |grep 'worker.rb' |grep -v 'grep'
# 1 10193 10185 1320 pts/0 10440 Sl 33 0:00 ruby ./worker.rb
# 1 10163 10155 1320 pts/0 10440 Sl 33 0:00 ruby ./worker.rb
echo 'killing old proc'
ps -U www-data -u www-data ajf |grep 'worker.rb' |grep -v grep | awk -F ' ' '{print $3}'| xargs -I {} kill -9 -{}
echo 'starting worker'
sudo -u www-data sh -c 'nohup ./worker.rb >> logs/worker.log &'
@shadowbq
shadowbq / GITHUB-SUBMODULE-PR-README.md
Created July 16, 2015 15:25
Adding a submodule to existing 3rd party repo via pull request

Fork the hack-night (https://github.com/rubyloco/hack-night.git) on github to your account (ala https://github.com/shadowbq/hack-night.git)

Using the shell download your clone, create/switch to your topic branch, add your submodule, commit it, push it to your account.

git clone https://github.com/shadowbq/hack-night.git
cd hack-night/
git remote add upstream https://github.com/rubyloco/hack-night.git
git fetch upstream
git checkout -b shadowbq-loco-flag upstream/master