Skip to content

Instantly share code, notes, and snippets.

View dcode's full-sized avatar
💭
Hack the 🌎!

Derek Ditch dcode

💭
Hack the 🌎!
View GitHub Profile
# btest on expiring entries:
https://github.com/bro/bro/blob/master/testing/btest/language/expire_func.test
# example of table usage with global table lookup
https://github.com/broala/bro-snippets/blob/master/intel-dns.bro
@dcode
dcode / enable_tether.sh
Last active September 7, 2024 23:39
Enable tethering on Nexus 6 Marshmallow stock and w/o root
# Download latest TWRP from https://dl.twrp.me/shamu
#curl -L -J -O https://dl.twrp.me/shamu/twrp-2.8.7.1-shamu.img
curl -L -J -O https://dl.twrp.me/shamu/twrp-3.0.0-1-shamu.img
# Install the Android SDK tools (need fastboot and adb)
# Boot to bootloader using key combo or adb
adb reboot bootloader
# Ensure bootloader is unlocked in 'Developer Options'
# If you flashed Marshmallow, this should already be set
@dcode
dcode / Measure Linux IOPS
Created August 20, 2015 20:20
Measure disk IOPS on Linux
So you have purchased a new VPS (whether it is with Binary Lane or another provider), logged in with
SSH and are now staring at your root shell. For many of us, the first question that comes to mind is
How fast is my server?; followed quickly by How do I measure its performance?
In this article I will look at some specific methods of measuring the disk performance of your VPS.
https://www.binarylane.com.au/support/solutions/articles/1000055889-how-to-benchmark-disk-i-o
@dcode
dcode / node.cfg
Created August 19, 2015 22:45
Bro node config w/ pf_ring - simple config
[manager]
type=manager
host=127.0.0.1
[proxy-1]
type=proxy
host=127.0.0.1
[worker-1]
type=worker
@dcode
dcode / gist:31b0350c8ad2ffd90fe9
Created August 19, 2015 22:39
Elasticsearch tuning tips
# /etc/sysconfig/elasticsearch
# Heap size defaults to 256m min, 1g max
# Set ES_HEAP_SIZE to 50% of available RAM, but no more than 31g
ES_HEAP_SIZE=2g
# /etc/elasticsearch/elasticsearch.yml
cluster.name: <something other than elasticsearch>
bootstrap.mlockall: true
zen.discovery.multicast.enabled: false
@dcode
dcode / Vagrantfile
Last active August 29, 2015 14:27
Let's Chat on EL7. Uses upstream binaries of Node.js. I'd like to get the EPEL packages to work, but haven't gotten that yet.
# vi: set ft=ruby :
# Lets Chat Vagrantfile for EL7
# Set LCB_BRANCH to pick what git checkout to use when spinning up the
# application. For example:
#
# $ LCB_BRANCH="feature-branch" vagrant up.
#
LCB_BRANCH = ENV['LCB_BRANCH'] || 'master'
@dcode
dcode / keybase.md
Created August 18, 2015 15:48
keybase.md

Keybase proof

I hereby claim:

  • I am dcode on github.
  • I am dcode (https://keybase.io/dcode) on keybase.
  • I have a public key whose fingerprint is 8538 13A8 B017 EF82 ED57 BE4A 5358 6C33 2543 A3B5

To claim this, I am signing this object:

@dcode
dcode / configure_bro_json-logs.sh
Last active April 10, 2020 20:28
This snippet configures bro to write logs out in JSON instead of the tab-delimited format. It also configures it to use ISO8601 timestamps instead of unix epoch time.
## Configure bro to write JSON logs
mkdir -p /opt/bro/share/bro/site/scripts
sudo tee /opt/bro/share/bro/site/scripts/json-logs.bro << EOF
@load tuning/json-logs
redef LogAscii::json_timestamps = JSON::TS_ISO8601;
redef LogAscii::use_json = T;
EOF
sudo tee -a /opt/bro/share/bro/site/local.bro << EOF
@dcode
dcode / ifcfg-ens1f0
Last active November 12, 2015 16:36
Interface tuning for capture interfaces on EL7 hosts
Type=Ethernet
BOOTPROTO=none
IPV4_FAILURE_FATAL=no
IPV6_AUTOCONF=no
NAME=ens1f0
ONBOOT=yes
NM_CONTROLLED=no
@dcode
dcode / ol7_addons.repo.sh
Last active May 18, 2020 20:01
Enable the OL7 Add-ons repo. Includes virtualbox, docker, R, and others.
cat << EOF | sudo tee /etc/yum.repos.d/ol7_addons.repo
[ol7_addons]
name=Oracle Linux $releasever Add ons (\$basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/addons/\$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
EOF
# Verify this manually if you're paranoid like me