Skip to content

Instantly share code, notes, and snippets.

@mtigas
mtigas / gist:952344
Last active June 20, 2024 11:22
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:

@CodingFu
CodingFu / deviseCheck.js
Created November 13, 2013 00:08
Simple devise user login check in node.js
var mysql = require('mysql')
, bcrypt = require('bcrypt')
, db = {
host: 'localhost',
user: 'root',
database: 'prod'
};
function checkUser(email, password, callback) {
var connection = mysql.createConnection(db);
@soarez
soarez / ca.md
Last active July 24, 2024 12:02
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@Liryna
Liryna / ARMDebianUbuntu.md
Last active May 20, 2024 15:04
Emulating ARM on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

@jjgod
jjgod / checkout-chromium-release-branches.markdown
Last active January 12, 2024 09:30
Steps to checkout Chromium release branches

Steps to checkout Chromium release branches

Initial setup

mkdir chromium && cd chromium
fetch --nohooks chromium --nosvn=True
gclient sync --with_branch_heads --nohooks # May not even need this.

Fetching/updating a specific release branch

@gabrielef
gabrielef / SanitizeUrl.php
Last active June 23, 2017 19:48
Convert title to seo friendly url
<?php
class SanitizeUrl {
public static function slug($string, $space="-") {
$string = utf8_encode($string);
if (function_exists('iconv')) {
$string = iconv('UTF-8', 'ASCII//TRANSLIT', $string);
}
$string = preg_replace("/[^a-zA-Z0-9 \-]/", "", $string);
@yiding
yiding / gist:1bfe9bbf5187a6ff6f34
Created June 30, 2014 19:03
WebRTC native, forcing ports to be allocated in a certain range.
class PortAllocatorFactoryWrapper : public PortAllocatorFactory {
public:
PortAllocatorFactoryWrapper(talk_base::Thread* worker_thread, int minPort, int maxPort)
: PortAllocatorFactory(worker_thread), minPort_(minPort), maxPort_(maxPort) {}
virtual cricket::PortAllocator *CreatePortAllocator(
const std::vector<StunConfiguration> &stun,
const std::vector<TurnConfiguration> &turn) override {
auto allocator = PortAllocatorFactory::CreatePortAllocator(stun, turn);
allocator->SetPortRange(minPort_, maxPort_);
@awidegreen
awidegreen / pia_swe.ovpn
Last active July 3, 2024 02:23
rtorrent through openvpn
client
dev tun
# "Allow calling of built-in executables and user-defined scripts." In other
# words, this must be specified for the `up` script to be executed.
script-security 2
route-nopull
up vpn-up.sh
down vpn-down.sh
@bellbind
bellbind / binding.gyp
Last active June 20, 2024 18:22
[nodejs]Native module with libuv and v8::Promise on node-4
# -*- mode: python -*-
{
"targets": [
{
"include_dirs": ["<!(node -e \"require('nan')\")"],
"target_name": "TimerAndPromise",
"sources": [
"timer-and-promise.cc"
],
"conditions": [