Skip to content

Instantly share code, notes, and snippets.

@mtigas
mtigas / gist:952344
Last active April 3, 2024 07:57
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

@TeWu
TeWu / gist:1234573
Last active February 2, 2022 20:23
TCP client and multithreaded server in 14 lines of Ruby code

TCP client and multithreaded server in 14 lines of Ruby code

Server:

require "socket"
server = TCPServer.open(2626)
loop do
	Thread.fork(server.accept) do |client| 
 client.puts("Hello, I'm Ruby TCP server", "I'm disconnecting, bye :*")
@chetan
chetan / yardoc_cheatsheet.md
Last active May 10, 2024 02:53
YARD cheatsheet
@elithrar
elithrar / wale_postgres_recovery.md
Last active May 3, 2021 15:38
WAL-E + Postgres 9.x (single server + DB) Setup and Recovery

A quick "how to" on what you need to do to both setup AND recover a single-server PostgreSQL database using WAL-E

  • WAL-E: https://github.com/wal-e/wal-e
  • Assuming Ubuntu 12.04 LTS ("Precise")
  • We'll be using S3. Make sure you have an IAM in a group with GetObject, ListBucket and PutObject on the bucket you want to use (and that it's not public).

Setup:

  1. These packages:
#!/usr/bin/env ruby
require 'bunny'
require 'securerandom'
conn = Bunny.new
conn.start
class FibonacciClient
def initialize(conn, server_queue)
ch = conn.create_channel
@ajford
ajford / .ycm_extra_conf.py
Last active April 12, 2021 11:55
PlatformIO/YouCompleteMe Integration
"""
YouCompleteMe extra configuration for Platformio based
projects.
Based on the `.ycm_extra_conf.py` by @ladislas in his Bare-Arduino-Project.
Anthony Ford <github.com/ajford>
"""
import os
@shovon
shovon / increase_swap.sh
Created April 10, 2015 15:18
Increasing swap size. Only tested on the ubuntu/trusty64 Vagrant box. CREDIT GOES TO ---> http://jeqo.github.io/blog/devops/vagrant-quickstart/
#!/bin/sh
# size of swapfile in megabytes
swapsize=8000
# does the swap file already exist?
grep -q "swapfile" /etc/fstab
# if not then create it
if [ $? -ne 0 ]; then
@Vestride
Vestride / encoding-video.md
Last active June 5, 2024 14:38
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@miblodelcarpio
miblodelcarpio / notes_weechat
Last active February 24, 2023 18:04
WeeChat Relay Setup
weechat
Relay setup
On the server's instance of weechat:
/relay add ssl.irc 8001
/secure set relay WHATEVER_PASSWORD
/set relay.network.password "${sec.data.relay}"
On the server, to generate the ssl certificate: