Skip to content

Instantly share code, notes, and snippets.

View gsandie's full-sized avatar

gsandie

View GitHub Profile
@mtigas
mtigas / onion-svc-v3-client-auth.sh
Last active April 22, 2024 07:31
experiments with using v3 onions with client auth (as of tor 0.3.5.X)
#!/bin/bash
# needs openssl 1.1+
# needs `basez` https://manpages.debian.org/testing/basez/base32hex.1.en.html
# (but something else that decodes the base64 and re-encodes the raw key bytes
# to base32 is probably fine too)
##### generate a key
openssl genpkey -algorithm x25519 -out /tmp/k1.prv.pem
@morfikov
morfikov / android_phone_as_a_LUKS_token.md
Last active December 31, 2023 13:59
How to use your Android phone as a key to your encrypted linux desktop/laptop system (LUKS/LUKS2 based)

About this HowTo

Encrypted systems (desktops/laptops) have one major problem when it comes to providing security over protected files. When you sit in front of your machine, you can feel safe because no one can break into the system without your knowledge. Moreover, if they try to do some bad actions, you can detect them and avoid the imminent danger. But what if you leave your laptop alone? Even if you think that you can lock it, turn it off or hibernate it, the machine still isn't secure as you would have thought. The problem lays in the physical access that people can get when you're not around and hence set some traps for you when you're not looking. To avoid the danger that comes

Prerequisites

You'll need to have a system running that is accessible through a DNS record. It should have access to the public Habitat depot, https://app.habitat.sh so it can download the required packages.

You'll need to register an OAuth application for GitHub. You need the client ID and client secret that are created for the application later in this guide. Your system needs to have access to https://github.com so that it can authenticate.

Your system also needs to have an FQDN that can be resolved, for example depot.example.com. This will be used in your OAuth application's "Authorization Callback URL." For this example, use http://depot.example.com/#/sign-in. The /#/sign-in is required.

Operating System

@acolyer
acolyer / service-checklist.md
Last active January 30, 2024 17:39
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@bhundven
bhundven / nineteen.sh
Last active November 22, 2023 17:06
Enlightenment 19 build script for Ubuntu/Debian
#!/bin/bash
# vi: ts=4:sw=4:et
#
# NINETEEN.SH
# This script allows you to install/update Enlightenment 19 git version on
# Ubuntu 14.04 LTS or Debian wheezy/sid, or remove E19 git from your system.
# Originally from: http://ubuntuforums.org/showthread.php?t=2203190
# By: Philippe J. Guillaumie (batden AT sfr DOT fr).
# Additional updates by: Bryan Hundven (bryanhundven AT gmail DOT com).
#
@mikebroberts
mikebroberts / slack.clj
Created March 17, 2014 18:02
Send a message to Slack incoming webhook in Clojure.
(ns slack
(:require [clj-http.client :as client]
[clojure.data.json :as json]))
(defn send-to-slack
"Sends a simple message to slack using an 'incoming webhook'.
url will be of form: https://myapp.slack.com/services/hooks/incoming-webhook?token=mytoken .
(Exact url you should use will appear on the slack integration page)
text will be any valid message.
This implementation could be expanded if you wanted to specify channel, username, etc.
@untergeek
untergeek / ls-es-mapping.json
Last active March 16, 2019 12:38
Logstash v1.2+ Elasticsearch Mapping Template
{
"template" : "logstash-*",
"settings" : {
"index.refresh_interval" : "5s",
"analysis" : {
"analyzer" : {
"default" : {
"type" : "standard",
"stopwords" : "_none_"
}
file "#{params[:home]}/.ssh/config" do
owner params[:user]
group params[:user]
content <<-EOH
Host github.com
IdentityFile ~/.ssh/github
IdentitiesOnly yes
StrictHostKeyChecking no
EOH
end
@jordansissel
jordansissel / puppet-parser-elsewhere.rb
Created October 30, 2010 10:06
Using the puppet config parser for a configfile in your own project.
#!/usr/bin/env ruby
#
require "rubygems"
require "puppet" # gem puppet
require "ap" # gem awesome_print
# Need to define a type for each type we want to have.
# Otherwise, unknown types are errors in puppet.
Puppet::Type.newtype(:input) do
#!/usr/bin/env ruby
require 'rubygems'
require 'chef'
require 'chef/client'
require 'chef/run_context'
Chef::Config[:solo] = true
Chef::Config[:log_level] = :info
Chef::Log.level(:info)