Skip to content

Instantly share code, notes, and snippets.

View srics's full-sized avatar

Sridhar Ramaswamy srics

View GitHub Profile
#!/bin/sh
# Filename: /etc/dhcp/dhclient-exit-hooks.d/sethostname
# Purpose: Used by dhclient-script to set the hostname of the system
# to match the DNS information for the host as provided by
# DHCP.
# logs in /var/log/syslog
#
echo dhclient-exit-hooks.d/sethostname: reason = $reason, interface = $interface
@srics
srics / golang-tls.md
Created April 3, 2018 18:12 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@srics
srics / harden.sh
Created March 30, 2020 05:42 — forked from kost/harden.sh
hardening script for an alpine docker container
#!/bin/sh
set -x
set -e
#
# Docker build calls this script to harden the image during build.
#
# NOTE: To build on CircleCI, you must take care to keep the `find`
# command out of the /proc filesystem to avoid errors like:
#
# find: /proc/tty/driver: Permission denied
@srics
srics / action_gnutls_scripted.md
Created January 5, 2021 20:55 — forked from epcim/action_gnutls_scripted.md
gnutls certtool ssl tls openssl

CA - based on gnutls-bin


this directory holds CA key + wildcard certificates created for new infrastructure the CA key/cert is "ca-cert.pem/key"

TODO:

  • create scripts to re-generate client certificates based on NEW CA
  • develop procedure to generate client/server certs from template (partialy done)
  • develop procedure to generate clr files + revocate certificate + distribute them on public places
@srics
srics / VMX-pi-HAL-CANBusMonitor
Created December 22, 2022 07:32 — forked from kauailabs/VMX-pi-HAL-CANBusMonitor
VMX-pi-HAL-CANBusMonitor
#include <stdio.h> /* printf() */
#include "VMXPi.h"
int main(int argc, char *argv[])
{
bool realtime = false;
uint8_t update_rate_hz = 50;
VMXPi vmx(realtime, update_rate_hz);
if(vmx.IsOpen()) {