Skip to content

Instantly share code, notes, and snippets.

namespace CpuUsage
{
using System;
using System.Diagnostics;
public class CpuMeter : IDisposable
{
private CounterSample _startSample;
private readonly PerformanceCounter _cnt;
@zwned
zwned / CuckooMon.py
Created January 3, 2012 01:23
Monitor folder for malware, submit to cuckoobox
#!/usr/bin/env python
import sys, time, os, shelve, hashlib
from cuckoo.core.db import CuckooDatabase
MALWARE_DIR = "/Users/zwned/Dropbox/malware/"
SLEEP_TIME = 60
HISTORY_FILE = "cuckooMon_hist"
@creaktive
creaktive / 00-NaiveBayesEmPerlEMongoDB.pod
Created February 27, 2012 15:18
Naive Bayes em Perl e MongoDB

Naive Bayes usando Perl e MongoDB

Introdução

Um classificador naive Bayes é provavelmente o exemplo mais tradicional para ilustrar "Inteligência Artificial" na prática. É bastante utilizado na eterna tarefa de discernir entre spam e não-spam (ham).

@douglasmiranda
douglasmiranda / gist:2555156
Created April 30, 2012 03:07
Solução para instalar lxml no ubuntu com sucesso =] ( erro em pip install lxml )
#Se o erro for algo parecido com isto:
#building 'lxml.etree' extension
#gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w
#In file included from src/lxml/lxml.etree.c:239:0:
#src/lxml/etree_defs.h:9:31: erro fatal: libxml/xmlversion.h: Arquivo ou diretório não encontrado
#compilação terminada.
#error: command 'gcc' failed with exit status 1
#basta instalar libxml2-dev e libxslt-dev
@jbhardwaj
jbhardwaj / entrophygraph.html
Last active December 10, 2015 13:59
A Cuckoo Sandbox processing module to render an entropy graph of the sample.
<!-- cuckoo/data/html/sections/entrophygraph.html -->
<section id="entropygraph">
<div class="section-title">
<h3>Entropy Graph <small>of the binary.</small></h3>
</div>
{% if results.entropygraph %}
<a href="data:image/png;base64,{{results.entropygraph.data}}"><img class="fade" src="data:image/png;base64,{{results.entropygraph.data}}"/></a>
{% else %}
No entropy graph available.
{% endif %}
@sloria
sloria / bobp-python.md
Last active June 26, 2024 15:54
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@kanazux
kanazux / get_hardmob_promos.py
Last active August 29, 2015 14:01
threading on function and class
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import re
import sys
import time
import requests
import threading
import Tkinter
from BeautifulSoup import BeautifulSoup
@Rurik
Rurik / asm_find_math.py
Last active September 16, 2023 17:17
Detect subroutines that may have encryption/encoding routines by finding XOR and shift routines.
# Automatically find XOR/SHL/SHR routines from an executable
# Uses IDAW (text IDA)
# @bbaskin - brian @ thebaskins.com
# While other, more powerful scripts like FindCrypt find known
# algorithms this is used to find custom encoding or modified
# encryption routines
"""
Script results:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
@Neo23x0
Neo23x0 / yara_performance_guidelines.md
Last active April 30, 2024 10:39
YARA Performance Guidelines

This Gist has been transfered into a Github Repo. You'll find the most recent version here.

YARA Performance Guidelines

When creating your rules for YARA keep in mind the following guidelines in order to get the best performance from them. This guide is based on ideas and recommendations by Victor M. Alvarez and WXS.

  • Revision 1.4, October 2020, applies to all YARA versions higher than 3.7
@AArnott
AArnott / ConsoleApp.csproj
Last active March 9, 2023 11:10
Async named pipes example
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>exe</OutputType>
<TargetFrameworks>net472;net5.0-windows</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.IO.Pipes.AccessControl" Version="5.0.0" />
</ItemGroup>