Skip to content

Instantly share code, notes, and snippets.

View uplime's full-sized avatar
👻
Spooky

Nicholas Chambers uplime

👻
Spooky
View GitHub Profile
@jodell
jodell / shmsetup.sh
Created October 13, 2011 18:54
kernel shared memory calculator
#!/bin/bash
# http://archives.postgresql.org/pgsql-admin/2010-05/msg00285.php
# Output lines suitable for sysctl configuration based
# on total amount of RAM on the system. The output
# will allow up to 50% of physical memory to be allocated
# into shared memory.
# On Linux, you can use it as follows (as root):
#
# ./shmsetup >> /etc/sysctl.conf
@grawity
grawity / SASL.md
Last active August 21, 2024 07:09
SASL authentication from the perspective of IRC server-to-server protocols

SASL authentication in IRC

© 2014 Mantas Mikulėnas <[email protected]>

This documentation is released under Creative Commons 3.0 Attribution license.


This is a description of server-server protocol, intended for ircd and services developers. For the client-server protocol descriptions, intended for client & bot developers, see the IRCv3 [sasl-3.1][] and [sasl-3.2][] specifications.

@ormaaj
ormaaj / multidim.bash
Last active February 21, 2019 22:19
Non-serious bash 2d array implementation
#!/usr/bin/env bash
function getElem {
while
${!1+\:} return 1
typeset -a "__getElemArr=${!1}"
set -- "__getElemArr${1#*]}"
[[ $1 == *\[!(@]|\*]) ]]
do :
done
@mniip
mniip / timer.c
Last active December 31, 2016 05:04
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <string.h>
#include <signal.h>
#include <curses.h>
void quit()
{
endwin();
@mniip
mniip / 2048.sh
Created March 25, 2015 02:33
A 2048 clone for those who can't afford a desktop environment. Runs in sh!
#!/bin/sh
print_cell()
{
if [ "$1" = 0 ]; then
echo -en " "
else
if [ "$1" -ge 128 ]; then
echo -en '\x1B[33m'
elif [ "$1" -ge 16 ]; then
echo -en '\x1B[31m'
@arusso
arusso / make-san-cert.rb
Last active June 1, 2021 21:20
Generating a SAN Certificate in Ruby
require 'openssl'
require 'openssl-extensions/all'
keyfile = '/tmp/mycert.key'
csrfile = '/tmp/mycert.csr'
file = File.new(keyfile,'w',0400)
key = OpenSSL::PKey::RSA.new 2048
file.write(key)
@PurpleBooth
PurpleBooth / README-Template.md
Last active November 17, 2024 02:42
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@aspyatkin
aspyatkin / generate_csr.rb
Last active October 7, 2023 18:20
Generate X509 CSR with SAN extension in Ruby
require 'openssl'
# Generate X509 CSR (certificate signing request) with SAN (Subject Alternative Name) extension and sign it with the RSA key
def generate_csr(common_name, organization, country, state_name, locality, domain_list)
# create signing key
signing_key = OpenSSL::PKey::RSA.new 2048
# create certificate subject
subject = OpenSSL::X509::Name.new [
['CN', common_name],
@zenorocha
zenorocha / etc-hosts-on-win.md
Last active April 11, 2024 23:07
/etc/hosts on Windows

1. Get your IP Address

echo `ifconfig $(netstat -nr | grep -e default -e "^0\.0\.0\.0" | head -1 | awk '{print $NF}') | grep -e "inet " | sed -e 's/.*inet //' -e 's/ .*//' -e 's/.*\://'`

2. Modify your hosts file

notepad