Skip to content

Instantly share code, notes, and snippets.

README

This is a CentOS-themed /etc/issue w/ hooks to update IP address and OS release upon ifup/ifdown. My motivation was that I was tired of logging into an otherwise headless box just to find the IP of the system so I can SSH to it.

Note
The issue.in file actually contains control characters to do the color in the text. The easiest way to preserve that is to clone this gist and run the install.sh script w/ sudo, which will copy the file and set the SELinux
@dcode
dcode / stenographer.service
Last active June 30, 2023 03:00
This is a hack that I put together to pull PCAP from multiple instances of stenographer, each with a different configuration file. It adds `mergecap` as a dependency, which is used to produce the final PCAP, which is then filtered through `tcpdump` as before.
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@dcode
dcode / group_cpuinfo_by_socket-core-ids.sh
Last active September 27, 2016 21:07
Get top-level physical processor numbers grouped by socket and core id's
egrep -e "processor" -e "core id" -e ^physical /proc/cpuinfo | \
xargs -l3 echo | \
awk -vOFS='\t' '{ print "{\"socket\": "$7", \"core\": " $11 ", \"proc\":" $3 "}" }' | \
jq -sc '
[.[] | {sock_core:"\(.socket)-\(.core)", proc, core, socket } ]
| group_by(.sock_core) | .[] | .[0] ' | \
sort -V
@dcode
dcode / GitHub Flavored Asciidoc (GFA).adoc
Last active May 11, 2025 08:40
Demo of some useful tips for using Asciidoc on GitHub

GitHub Flavored Asciidoc (GFA)

@dcode
dcode / 01-migrate-bro-data.sh
Last active October 7, 2016 17:10
Attempt to migrate data to old indexes. I need to do this because data types changed, but I don't want to lose the old data.
# Move index names from bro-YYYY.MM.DD to bro-v1-YYYY.MM.DD
for item in $(curl -s -n -XGET localhost:9200/_cat/indices | awk '/bro-/ { split($3,a,"-"); print a[2] }'); do
cat <<EOF | curl -s -n -XPOST localhost:9200/_reindex -d @- >/dev/null
{ "source": {"index": "bro-${item}"}, "dest": {"index": "bro.v1-${item}"} }
EOF
echo -e "\nCloned data from bro-${item} to bro.v1-${item}"
done
anonymous
anonymous / wifi-setup-c7-rpi3.sh
Created October 21, 2016 14:25
#!/bin/bash
#
# Raspberry Pi3 - CentOS 7 - Wi-Fi configuration
#
# Usage: ./wifi-setup.sh [SSID] [PSK]
if [ -z "$1" ]; then
echo "Enter WAP SSID:";

ROCK NSM Beta 0 Notes

Grab the main page with all the links:
curl https://slackmojis.com/ > emoji

Open file in vim and run the following commands:

v/src=/d
%s/^.*https:/https:/g"
%s/?.*$//g

#petya #petrWrap #notPetya

Win32/Diskcoder.Petya.C

Ransomware attack.

About

This gist was built by the community of the researchers and was scribed by Kir and Igor from the QIWI/Vulners. We are grateful for the help of all those who sent us the data, links and information. Together we can make this world a better place!

Gist updates

ROCK Sensor Parts List

Below is the hardware I use for development and home use of my ROCK sensor. It’s an extremely powerful system in a small form factor, under $1000. The most important aspects to me were that I wanted IPMI for baremetal remote management, dual Intel NICs, quiet, and relatively low-power. I sit by this thing and work everyday and don’t want to wear hearing protection while I write code.

The prices reflect what I paid for them in March 2016. No doubt the prices will have changed and newer, better stuff is probably available. Things like RAM and SSDs go on sale all the time, so look for that if you’re a bargain shopper.