Skip to content

Instantly share code, notes, and snippets.

@jc-lab
jc-lab / uvw-test.md
Last active July 8, 2021 03:05
uvw 테스트

코드

서버

$ nc -l -p 1234

클라이언트

@jc-lab
jc-lab / App.inf
Created February 23, 2021 02:03
UEFI: Connect handles to controllers
[Sources]
BdsConnect.c
[Packages]
MdePkg/MdePkg.dec
[LibraryClasses]
BaseLib
PrintLib
DevicePathLib
@jc-lab
jc-lab / MSCabinetSignerTest.java
Created November 22, 2020 02:42
MSCabinetSignerTest with signtool
/**
* Copyright 2012 Emmanuel Bourg
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@jc-lab
jc-lab / ptrace_test.c
Created September 10, 2020 02:38
ptrace_test
#include <iostream>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/signal.h>
#include <sys/ptrace.h>
volatile int g_running = 1;
@jc-lab
jc-lab / ExternalZlib.cmake
Created August 12, 2020 09:29
CMake ZLIB
# IN MAIN PROJECT
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# ExternalZlib.cmake
FetchContent_Declare(
zlib
GIT_REPOSITORY https://github.com/madler/zlib.git
GIT_TAG v1.2.11
)
@jc-lab
jc-lab / temp.js
Last active November 26, 2019 13:57
paillier-js recovery "r"
function fixedMod(a, b) {
let r = a.mod(b);
if(r.isNegative())
r = b.plus(r);
return r;
}
//simplevariant
decrypt(c) {
//let phi = this._p.subtract(1).multiply(this._q.subtract(1));
@jc-lab
jc-lab / configure-pat.sh
Created October 26, 2019 04:41
AWS NAT Instance configure-pat.sh for Keep source ip
#!/bin/bash
# Configure the instance to run as a Port Address Translator (PAT) to provide
# Internet connectivity to private instances.
function log { logger -s -t "vpc" -- $1; }
function die {
[ -n "$1" ] && log "$1"
log "Configuration of PAT failed!"
exit 1
@jc-lab
jc-lab / hmac_sha256.c
Created October 2, 2019 09:53
hmac_sha256
void hmac_sha256(unsigned char *digest, const unsigned char *in_key, int key_length, const unsigned char *in_message, int message_length) {
SHA256_CTX ctx;
unsigned char key[64] = { 0 };
unsigned char o_key_pad[64] = { 0 };
unsigned char i_key_pad[64] = { 0 };
unsigned char* key_pads[] = {o_key_pad, i_key_pad, NULL};
unsigned char** cur_key_pad = key_pads;
unsigned char key_pad_xor = 0x5c;
@jc-lab
jc-lab / app protocol to http protocol.js
Created October 2, 2019 00:19
app protocol to http protocol
const {PassThrough} = require('stream');
protocol.registerStreamProtocol('app', ((request, callback) => {
let url = new murl.URL(request.url);
let newUrlOptions = {
auth: url.auth,
hash: url.hash,
host: webpackDevServerUrl.host,
hostname: url.hostname,
href: url.href,
@jc-lab
jc-lab / kube-flannel-v0.11.0-fixed.yml
Created September 24, 2019 06:04
kube-flannel-v0.11.0-fixed.yml
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: flannel
rules:
- apiGroups:
- ""
resources:
- pods