Skip to content

Instantly share code, notes, and snippets.

View vector-man's full-sized avatar

Michael Corbett vector-man

View GitHub Profile
@markscottwright
markscottwright / gist:d3330f76e89ee5cc0e51c155920285ff
Last active April 16, 2024 20:41
How to verify a detached pkcs7 signature
# how to verify the signature if you have the CAs certificate. This doesn't seem to work if you specify
# a subordinate CA, even if that CA is the one that issued the cert that created the signature.
openssl smime -verify -inform der -in signature-file -content signed-file -CAfile ca-certificate-in-pem-format
# how to verify everything except the certificate - so the signatures are checked, but no attempt is made
# to verify that the CAs certificate is trusted
openssl smime -verify -noverify -inform der -in signature-file -content signed-file
@sujaykundu777
sujaykundu777 / rle.cs
Created July 13, 2017 16:05
Run Length Encoding in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//Write a C# program to implement the below compress the given string using Run Length Algorithm
namespace RunLengthEncoder
{
class Program
private abstract class CompressionService : ICompressionService
{
public abstract string EncodingType { get; }
protected abstract Stream CreateCompressionStream(Stream output);
protected abstract Stream CreateDecompressionStream(Stream input);
public Task Compress(Stream source, Stream destination)
{
@aaronshaf
aaronshaf / paas.txt
Created December 4, 2015 17:05
Docker-Based Micro-PaaS
otto
https://ottoproject.io/
https://github.com/hashicorp/otto
deis
https://deis.com/
https://github.com/deis/deis
has 5 full-time devs
flynn
@massahud
massahud / Portable Node.js andNPM on windows.md
Last active May 24, 2024 14:51
Portable Node.js and NPM on windows
  1. Get node binary (node.exe) from http://nodejs.org/download/
  2. Create the folder where node will reside and move node.exe to it
  3. Download the last zip version of npm from http://nodejs.org/dist/npm
  4. Unpack the zip inside the node folder
  5. Download the last tgz version of npm from http://nodejs.org/dist/npm
  6. Open the tgz file and unpack only the file bin/npm (without extension) directly on the node folder.
  7. Add the the node folder and the packages/bin folder to PATH
  8. On a command prompt execute npm install -g npm to update npm to the latest version

Now you can use npm and node from windows cmd or from bash shell like Git Bash of msysgit.

@JulienBlancher
JulienBlancher / filter.d_nginx-auth.conf
Last active July 14, 2024 19:32
Fail2ban Config with Nginx and SSH
#
# Auth filter /etc/fail2ban/filter.d/nginx-auth.conf:
#
# Blocks IPs that makes too much accesses to the server
#
[Definition]
failregex = ^<HOST> -.*"(GET|POST).*HTTP.*"
ignoreregex =
@richardkundl
richardkundl / BloomFilter.cs
Created January 7, 2014 14:29
Bloom filter implementation in c#.
namespace BloomFilter
{
using System;
using System.Collections;
/// <summary>
/// Bloom filter.
/// </summary>
/// <typeparam name="T">Item type </typeparam>
public class Filter<T>
var tv4 = require('tv4');
var schema = {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"id": "#",
"required": ["events"],
"properties": {
"events": {
"type": "array",
anonymous
anonymous / contains-v4-schema.json
Created November 7, 2013 17:59
{
"description": "\"contains\" hack for v4 JSON Schema. The array must contain at least one \"A\", specified by saying that if all the entries are *not* \"A\", then it fails.",
"type": "array",
"not": {
"items": {
"not": {
"enum": ["A"]
}
}
}
@chilts
chilts / alexa.js
Created October 30, 2013 09:27
Getting the Alexa top 1 million sites directly from the server, unzipping it, parsing the csv and getting each line as an array.
var request = require('request');
var unzip = require('unzip');
var csv2 = require('csv2');
request.get('http://s3.amazonaws.com/alexa-static/top-1m.csv.zip')
.pipe(unzip.Parse())
.on('entry', function (entry) {
entry.pipe(csv2()).on('data', console.log);
})
;