Skip to content

Instantly share code, notes, and snippets.

@ezimuel
ezimuel / sign.sh
Created March 14, 2016 15:50
Sign and verify a file using OpenSSL command line tool. It exports the digital signature in Base64 format.
#!/bin/bash
# Sign a file with a private key using OpenSSL
# Encode the signature in Base64 format
#
# Usage: sign <file> <private_key>
#
# NOTE: to generate a public/private key use the following commands:
#
# openssl genrsa -aes128 -passout pass:<passphrase> -out private.pem 2048
# openssl rsa -in private.pem -passin pass:<passphrase> -pubout -out public.pem
@felipec
felipec / autogroups
Last active November 22, 2020 04:02
Display a list of all the processes listed by their autogroup (CONFIG_SCHED_AUTOGROUP)
#!/usr/bin/env ruby
$autogroups = Hash.new { |h,k| h[k] = [] }
Dir.glob('/proc/*').each do |e|
pid = File.basename(e).to_i
next if pid == 0
begin
cmdline = File.read(e + '/cmdline').split("\0").join(" ")
next if cmdline.empty?
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google