Skip to content

Instantly share code, notes, and snippets.

View traut's full-sized avatar

Sergey Polzunov traut

View GitHub Profile
local gpgGroup = vim.api.nvim_create_augroup('customGpg', { clear = true })
-- autocmds execute in the order in which they were defined.
-- https://neovim.io/doc/user/autocmd.html#autocmd-define
vim.api.nvim_create_autocmd({ 'BufReadPre', 'FileReadPre' }, {
pattern = '*.gpg',
group = gpgGroup,
callback = function ()
-- Make sure nothing is written to shada file while editing an encrypted file.
@traut
traut / hypothesis-STIX2.json
Created February 29, 2024 14:50 — forked from CaitlinHuey/hypothesis-STIX2.json
Representing a structured Hypothesis (STIX2) - co-authored by Sergey Polzunov
{
"objects": [
{
"labels": [
"source--eiq-fusion"
],
"name": "EclecticIQ Fusion Center",
"external_references": [
{
"source_name": "external-url",
@traut
traut / execution.log
Last active June 10, 2022 20:09
tmpprj to test ghost agents
$ date && LEIN_JVM_OPTS= LEIN_FAST_TRAMPOLINE=1 lein trampoline run -m tmpproj && date
Fri Jun 10 21:57:11 CEST 2022
WARNING: update-keys already refers to: #'clojure.core/update-keys in namespace: io.aviso.exception, being replaced by: #'io.aviso.exception/update-keys
Hello
Fri Jun 10 21:58:12 CEST 2022
$
{
"type": "bundle",
"id": "bundle--a6fb81b8-46c7-40de-85be-bee510f08d1b",
"objects": [
{
"type": "campaign",
"spec_version": "2.1",
"id": "campaign--12a111f0-b824-4baf-a224-83b80237a094",
"lang": "en",
"created": "2017-02-08T21:31:22.007Z",
{
"type": "bundle",
"id": "bundle--a6fb81b8-46c7-40de-85be-bee510f08d1b",
"objects": [
{
"type": "campaign",
"spec_version": "2.1",
"id": "campaign--12a111f0-b824-4baf-a224-83b80237a094",
"lang": "en",
"created": "2017-02-08T21:31:22.007Z",
@traut
traut / static-http-receiver.py
Created May 20, 2020 07:49
Static HTTP server in Python that saves all POST requests as files in the current directory
import os
from http.server import HTTPServer, BaseHTTPRequestHandler, SimpleHTTPRequestHandler
class CustomHTTPRequestHandler(SimpleHTTPRequestHandler):
def do_POST(self):
filename = os.path.basename(self.path)
file_length = int(self.headers['Content-Length'])
with open(filename, 'wb') as output_file:
{
"id": "bundle--f39d5a20-939b-44d8-ab7b-42edff352317",
"objects": [
{
"type": "identity",
"id": "identity--18d1436d-9d9d-4c05-8d88-bc4a39ff6bce",
"created": "2019-01-01T01:00:00.123Z",
"modified": "2019-01-01T01:00:00.123Z",
"name": "EclecticIQ",
"identity_class": "organization",
# This code is an example of how STIX1.2 ids to STIX2 ids conversion
# would work with UUID5 allowed in identifiers by STIX2 spec
#
# by sergey@eclecticiq.com
import uuid
stix12_to_stix2_obj_type_mappings = {
'indicator': ['indicator'],
@traut
traut / udp-echo-server.ros
Last active November 22, 2020 18:15
Simple echo UDP server in Common Lisp, running in a separate thread (usocket and SBCL threads)
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
(progn ;;init forms
(ros:ensure-asdf)
#+quicklisp (ql:quickload '(usocket flexi-streams) :silent t)
)
@traut
traut / tcp-echo-server.ros
Last active September 21, 2021 18:40
Simple echo TCP server in Common Lisp, running in a separate thread (usocket and SBCL threads)
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
(progn ;;init forms
(ros:ensure-asdf)
#+quicklisp (ql:quickload '(usocket) :silent t)
)