Skip to content

Instantly share code, notes, and snippets.

View kanazux's full-sized avatar
🏠
Working from home

Silvio Giunge a.k.a kanazuchi kanazux

🏠
Working from home
View GitHub Profile
@kanazux
kanazux / spl_pd_alert.py
Created May 10, 2019 16:12
spl pd alert for splunk
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import sys
import json
import time
import base64
import requests
from datetime import datetime
@kanazux
kanazux / dict_pkt.py
Last active January 25, 2019 15:12
Return a dict from packet in pcap file
#!/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
from collections import defaultdict
from scapy.all import IP, Raw, rdpcap
class get_dump_data(object):
[Console]::TreatControlCAsInput = $true
function Rotate-files
{
Param ([int]$processNumber)
while ((Get-ChildItem -Recurse -Include capture_*.pcap -Path C:\lapi_logs\).Count -gt 5)
{
(Get-ChildItem -Recurse -Include capture_*.pcap -Path C:\lapi_logs\ | Select-Object -First 1).Delete()
}
{
"__inputs": [
{
"name": "ds_caterpy",
"label": "prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
{
"__inputs": [
{
"name": "ds_caterpy",
"label": "prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
# $FreeBSD$
PORTNAME= google-cloud-translate
PORTVERSION= 1.3.1
CATEGORIES= www python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= contato@kanazuchi.com
COMMENT= Google Translate API
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from subprocess import call, check_output
files = check_output(['find . -type f -maxdepth 1'], shell=True).split('\n')
for f in files:
# $FreeBSD$
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2018-08-12 23:29+0000\n"
"PO-Revision-Date: 2018-08-17 16:32-0300\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
# $FreeBSD$
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2018-08-12 23:29+0000\n"
"PO-Revision-Date: 2018-08-17 16:32-0300\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Create a defultdict from pofile
Translate strings from google nltk and put po data with translted strings
on a new po file.
"""