Skip to content

Instantly share code, notes, and snippets.

View angeloped's full-sized avatar

Angeloped angeloped

  • Philippines
View GitHub Profile
@angeloped
angeloped / MEM_RET.C
Created January 21, 2023 17:38
Memory Retrieval Operation | MHIP kernel component
#include <stdio.h>
#include <math.h>
// Memory Retrieval Operation | MHIP kernel component
// 1/22/2023
// 6 bit address/size
// A B C A B C
// 0 3 [ ] 1 3 [ ]
int SAM[] = {0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,1,1,1,0,1};
@angeloped
angeloped / MEM_HOP.C
Created January 21, 2023 17:04
Memory Hopping Operation | MHIP kernel component
#include <stdio.h>
#include <math.h>
// Memory Hopping Operation | MHIP kernel component
// 1/21/2023
// 6 bit address/size
// A B C A B C
// 0 3 [ ] 1 3 [ ]
int SAM[] = {0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,1,1,1,0,1};
@angeloped
angeloped / BOOL_OP.C
Created January 20, 2023 11:57
Boolean Comparing Operation | MHIP kernel component
#include <stdio.h>
// Boolean Comparing Operation | MHIP kernel component
// Bryan Pedrosa
// 1/20/2023
// modes:
//[0x0]BOOL_EQ - equal
//[0x1]BOOL_LT - less than
//[0x2]BOOL_GT - greater than
@angeloped
angeloped / IsTor.url
Created January 19, 2023 07:26
A Torproject API to check if IP connected is configured to Tor.
https://check.torproject.org/api/ip
@angeloped
angeloped / cross_socket.c
Created January 8, 2023 01:09
A truly Cross-Platform socket client written in C language.
#include <stdio.h>
// 1/8/2022
// modified version of https://github.com/ApOgEE/mingw-c-socket
// WORKS ON Linux kali 4.19.0-kali4-686-pae #1 SMP Debian 4.19.28-2kali1 (2019-03-18) i686 GNU/Linux
//////////////////////////////////////////////////////////////////////////
// CROSS-PLATFORMING A SOCKET PROGRAM
// See https://stackoverflow.com/questions/28027937/cross-platform-sockets
@angeloped
angeloped / FAST_ROT.C
Last active December 20, 2022 23:59
Highly-efficient Array Rotation Algorithm written in C.
#include <stdio.h>
// 12/21/2022
// calculating where to begin swapping with
//[0x0] LTR - left to right
//[0x1] RTL - right to left
int predict_swap(int mode, int index_mx, int start, int steps){
if(mode==0x0){
return (start+steps)%index_mx;
}else if(mode==0x1){
@angeloped
angeloped / angular_size.js
Created July 13, 2022 19:16
angular size function. calculation extracted from https://www.1728.org
/angsize.htm
// angular size https://www.1728.org/angsize.htm
function angular_size(sz, r){
const raddeg = 57.2957795130823;
var arctan = Math.atan( (.5*sz) / r );
return arctan * 2 * raddeg;
}
# https://gist.github.com/davebiagioni/1ac21feb1c2db04be4e6
# https://stackoverflow.com/questions/60695284/linearly-spaced-array-in-c
def linspace(x1, x2, nstep):
step = (x2 - x1) / (nstep - 1)
return [round(x1 + (i * step), 8) for i in range(0, nstep)]
@angeloped
angeloped / std_deviation.py
Created June 18, 2022 23:33
Python implementation of standard deviation.
import math
# https://en.wikipedia.org/wiki/Unbiased_estimation_of_standard_deviation
def std_deviation(items, mean):
sum_ = sum([(i-mean)**2 for i in items])
N = len(items) # the size of the population
return math.sqrt(sum_ / (N-1))
@angeloped
angeloped / gaussian.py
Created June 18, 2022 23:29
Python implementation of Gaussian function.
# https://en.wikipedia.org/wiki/Gaussian_function
def gaussian_func(x, a, std_dvtn, mean):
e = 2.718281828459045 # euler's const
return (a*e) ** -(((x-mean)**2) / (2*std_dvtn)**2)