Skip to content

Instantly share code, notes, and snippets.

View roycewilliams's full-sized avatar
💭
:cheeeeeese:

Royce Williams roycewilliams

💭
:cheeeeeese:
View GitHub Profile
@Wolf480pl
Wolf480pl / README.md
Last active February 21, 2018 18:27
Tools for parsing and pretty-printing slack json logs

slack2dsv.sh

  • converts slack .json log to tab-separated DSV format
  • requires [jq] and awk
  • takes slack .json log as first argument
  • reads users.json from parent directory (adjustable by USERFILE env var)
  • if a user in the USERFILE has a dispname attribute, it is used instead of name (useful in conjunction with slack-colorize-nicks.sh)

chat-prettify.sh

  • reads chat log in tab-separated DSV format from stdin (eg. from slack2dsv.sh), formats the timestamps and aligns the nicknames
  • requires awk
@dfirfpi
dfirfpi / wanna_sink_check.py
Last active March 20, 2018 13:50
Check if WannaCry SinkHole is reachable, as per its code.
from __future__ import print_function
import ctypes
DLL_KERNEL32 = ctypes.windll.kernel32
DLL_WININET = ctypes.windll.wininet
handle_inet = DLL_WININET.InternetOpenA(None, 1, None, None, None)
response = DLL_WININET.InternetOpenUrlA(
handle_inet,
@LebedevRI
LebedevRI / gpsControl.c
Created March 15, 2016 13:40
./gpsControl -s -d /dev/ttyAMA0 = Stationary Mode
#include <stdio.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
void usage( void )
{
#/bin/env python3
## Evan Widloski - 2017-01-06
## Asynchronous magstripe reader example
## Requires root and >= python 3.5
# Much taken from: http://python-evdev.readthedocs.io/en/latest/tutorial.html#reading-events-from-multiple-devices-using-asyncio
import asyncio, evdev
# MSR100 reader vendor/product ids
@kinichiro
kinichiro / ocsptest.sh
Created June 25, 2016 04:14
OCSP test script
#!/bin/sh
#
# ocsptest.sh - test script
#
openssl_bin=/usr/local/bin/openssl
function section_message {
echo ""
echo "#---------#---------#---------#---------#---------#---------#---------#--------"
@gavinlaking
gavinlaking / stretches
Created July 3, 2013 20:24
Devise "stretches" benchmarked.
require "bcrypt"
require "benchmark"
password = "My_Rea11y-B1G_S3cr3t"
salt = "2d3ec54c5fa27b9e9d8a3e7f1ed9f7f7c4b1c7e2f7da5c"
stretches = [1, 2, 3, 4, 5, 6, 7 ,8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
stretches.each do |cost|
puts "\n\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
puts "Cost = #{cost}"
@matlink
matlink / hcstat.sh
Created February 16, 2018 13:48
create hcstat2 file
hcstat2gen < inputfile 2>/dev/null | xz --compress --format=raw --stdout -9e 2>/dev/null > output.hcstat2
@mattifestation
mattifestation / CertificateSubjectToPEGrouping.ps1
Created December 25, 2016 16:04
Can you trust everything that's signed on your host? This might help you begin to answer that question.
# Get-SystemDriver requires the ConfigCI module on Win10 Enterprise
# This will collect all signer information for all PEs in C:\
# This will take a while!!!
$Signers = Get-SystemDriver -ScanPath C:\ -UserPEs
# Associate the subject name of each certificate to the file/signer info
# so we can correlate the two.
$CertSubjectMapping = $Signers | % {
$Signer = $_
@chokepoint
chokepoint / clipboard.ps1
Created August 19, 2017 12:28
Clipboard Stealing
function Get-Clipboard([switch] $Lines) {
if($Lines) {
$cmd = {
Add-Type -Assembly PresentationCore
[Windows.Clipboard]::GetText() -replace "`r", '' -split "`n"
}
} else {
$cmd = {
Add-Type -Assembly PresentationCore
[Windows.Clipboard]::GetText()
@evandrix
evandrix / gist:1076041
Created July 11, 2011 15:03
Using bcrypt to secure passwords in a Perl application
#!/usr/bin/perl
use Crypt::Eksblowfish::Bcrypt;
use Crypt::Random;
$password = 'bigtest';
$encrypted = encrypt_password($password);
print "$password is encrypted as $encrypted\n";
print "Yes the password is $password\n" if check_password($password, $encrypted);
print "No the password is not smalltest\n" if !check_password('smalltest', $encrypted);