Skip to content

Instantly share code, notes, and snippets.

View sivachandran's full-sized avatar

Sivachandran Paramasivam sivachandran

View GitHub Profile
@sivachandran
sivachandran / oci-ssh-whitelist-ddns.py
Created June 22, 2025 01:25
Python script to update OCI security list to whitelist dynamic dns ip address for SSH access.
import socket
import oci
import sys
# === Config - Update these ===
DOMAIN_NAME = "example.com"
SECURITY_LIST_ID = "ocid1.securitylist.oc1..xxxxxx" # Replace with your Security List OCID
PORT = 22
PROTOCOL = "6" # TCP
DESCRIPTION = f"SSH access for {DOMAIN_NAME}"
@sivachandran
sivachandran / bin2h.cmake
Last active March 10, 2025 03:16
Pure CMake function to convert any file into C/C++ header, implemented with only CMake commands.
include(CMakeParseArguments)
# Function to wrap a given string into multiple lines at the given column position.
# Parameters:
# VARIABLE - The name of the CMake variable holding the string.
# AT_COLUMN - The column position at which string will be wrapped.
function(WRAP_STRING)
set(oneValueArgs VARIABLE AT_COLUMN)
cmake_parse_arguments(WRAP_STRING "${options}" "${oneValueArgs}" "" ${ARGN})
@sivachandran
sivachandran / RSA_padding_add_PKCS1_OAEP_SHA512.c
Created July 7, 2014 16:45
RSA PKCS1 OAEP padding with SHA512 algorithm
static int MGF1_SHA512(unsigned char *mask, long len, const unsigned char *seed, long seedlen)
{
return PKCS1_MGF1(mask, len, seed, seedlen, EVP_sha512());
}
static int RSA_padding_add_PKCS1_OAEP_SHA512(unsigned char *to, int tlen,
const unsigned char *from, int flen,
const unsigned char *param, int plen)
{
int i, emlen = tlen - 1;
@sivachandran
sivachandran / SimpleTcpRedirector.py
Created March 4, 2012 01:42
A simple TCP redirector in python
#!/usr/bin/env python
import socket
import threading
import select
import sys
terminateAll = False
class ClientThread(threading.Thread):