Skip to content

Instantly share code, notes, and snippets.

{
"data": [
#timezone local#
#raw#
#jump -300#
#loop 100#
{
"#idx "%m/%d/%Y %H:%M"#": {
"TempOut": #temp_out "%.1f"#,
"FeelsLike": #calc "apparent_temp(data['temp_out'], data['hum_out'], data['wind_ave'])" "%.1f"#,
% lsof -p 11508 | grep shaper
proftpd 11508 nobody mem REG 253,0 77410 1402491 /usr/libexec/proftpd/mod_shaper.so
proftpd 11508 nobody 4w REG 253,0 4163 1402473 /var/log/ftpd/shaper.log
proftpd 11508 nobody 5u REG 253,0 120 1402472 /var/log/ftpd/shaper.tab
% cd /var/log/ftpd
% mv shaper.log shaper.log.old
% touch shaper.log
% cat /var/run/proftpd.pid
11508
% kill -HUP 11508
@rk295
rk295 / gist:2ae30c7c58499f9c6718
Created August 29, 2014 12:10
LogStash proftpd xferlog grok
input {
file {
path => "/var/log/xferlog"
type => "xferlog"
add_field => { "program" => "proftpd" }
}
}
filter {
if [type] == "xferlog" {
@rk295
rk295 / gist:0bd88d388683a328b9ce
Created August 29, 2014 16:05
xferlog grok
%{DAY} %{MONTH} %{MONTHDAY} %{TIME} %{YEAR} %{NUMBER:xferTime} %{IP:remoteHost} %{NUMBER:fileSize} %{PATH:fileName} %{WORD:transferType} %{WORD: specialActionFlag} %{WORD:direction} %{WORD:accessmode} %{WORD:username} %{WORD:serviceName} %{WORD:authenticationMethod} %{DATA:aut} %{WORD:completionStatus}
https://grokdebug.herokuapp.com/
Fri Aug 29 16:53:15 2014 4 173.220.95.58 873550 /u01/clients/globeph/source/live-feed/140828_Ariana_Grande-JBB/IMG_7240.jpg b _ i r globeph ftp 0 * c
@rk295
rk295 / gist:6fb03c65b49273548212
Last active June 9, 2021 11:45
Fortigate Firewall Logstash Grok filter
input {
syslog {
type => "fortigate"
port => 5001
}
}
filter {
if [type] == "fortigate" {
@rk295
rk295 / Allowed & Blocked-1409435838391
Created August 30, 2014 21:59
Couple of useful firewall dashboards for Logstash
{
"title": "Allowed & Blocked",
"services": {
"query": {
"list": {
"0": {
"query": "subtype:allowed",
"alias": "",
"color": "#7EB26D",
"id": 0,
@rk295
rk295 / gist:cd4244346a8c858c8318
Created October 10, 2014 12:25
bash variable foo
$ export foo=bar
$ export "baz"$foo=wibble
$ echo $bazbar
wibble
ssh-dss AAAAB3NzaC1kc3MAAACBAOUeDW4aXRBw0TxA2vDUsygaMFo/Ev1whZN1HWAfIJYex0Se5Q9L8AdkeVPylsYS+wn1QiGtq9ZuyICN5OLS0frsuD8ThdnaSk9KIxuDjMj64BD+Rl+/+ybAKhuGaYd2u/GZrVcjwTRBt+bydF48DzZ+zeLfZrub4aluY0/Jh82JAAAAFQC1T4ivsKR+jZAXp2fk7wbeoN1xAwAAAIEAsLWwH+5DRySyOWUYBOrWvrOuFFmuC+2CvBgMu6KT4gJYlE8QWT8rfJRQGDzIkgpekDC+7wk1pvOSv2vRnAcoM/kYg5F/xBY3eEkqNM2bYVjxQe2HEsJVzDO+xANznRs7FzqSyYR33wECRcTq+nxlhAum47K3vI3ywsbnBKt2gv8AAACAM/1ia7hF/Ods/ydjm23uAh7Tk7uY2AtTIDtLM6AC1l1IDEcbWv7KFGNtfVQJy3a+fY121HU5sVJ/S5H2fhtUCnapP7xBJxlutCl+syH+4VdLLh5AXv47TublO0W1mKEZWd2OO5DipoijenFXXGon9kTvKwoKMIZGWo3i8NO9SDo= robin@trillian
<table id="freq" border="0" cellspacing="0" cellpadding="0">
<tr nowrap bgcolor="#CCCCFF">
<th colspan="9" class="hdr">Table of Frequencies (percent)</th>
</tr>
<tr nowrap bgcolor="#CCCCFF">
<th class="freq">Direction</th>
<th class="freq">&lt; 0.5 m/s</th>
<th class="freq">0.5-2 m/s</th>
<th class="freq">2-4 m/s</th>
@rk295
rk295 / gist:25176f150c24f95df73e
Created January 18, 2015 09:34
Openvpn enable MD5 Centos 7 hack
Not advised, but until I can work out which keys are MD5...
[Unit]
Description=OpenVPN Robust And Highly Flexible Tunneling Application On %I
After=network.target
[Service]
PrivateTmp=true
Type=forking
PIDFile=/var/run/openvpn/%i.pid