Skip to content

Instantly share code, notes, and snippets.

坂本ポテコ sakamoto-poteko

Block or report user

Report or block sakamoto-poteko

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
sakamoto-poteko / Makefile
Created Apr 18, 2018
.Net Interop Example
View Makefile
g++ -shared interop.cpp -o
View edgerouter-azure-vpn-commands.txt
set vpn ipsec ipsec-interfaces interface pppoe0
set vpn ipsec auto-firewall-nat-exclude enable
set vpn ipsec nat-traversal enable
set vpn ipsec esp-group esp-azure compression disable
set vpn ipsec esp-group esp-azure lifetime 3600
set vpn ipsec esp-group esp-azure mode tunnel
set vpn ipsec esp-group esp-azure pfs disable
set vpn ipsec esp-group esp-azure proposal 1 encryption aes256
set vpn ipsec esp-group esp-azure proposal 1 hash sha1
sakamoto-poteko / ecdsa.cpp
Created Sep 22, 2017
OpenSSL ECDSA signing and verification
View ecdsa.cpp
#include <cstdio>
#include <cstdint>
#include <cstring>
#include <iostream>
#include <vector>
#include <openssl/ecdsa.h>
#include <openssl/sha.h>
#include <openssl/pem.h>
#include <openssl/x509.h>
sakamoto-poteko / move.cpp
Last active Sep 1, 2017
std::move in ctor initializer
View move.cpp
#include <utility>
#include <iostream>
class ctor
std::cout << "default ctor" << std::endl;
sakamoto-poteko /
Created Jul 26, 2017
OpenCV camera calibration and undistort
import numpy as np
import cv2
import glob
# termination criteria
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001)
cbrow = 7
cbcol = 9
View checksum.c
int checksum(const char *str)
int weight[] = {7, 3, 1};
int checksum = 0;
int len = strlen(str);
for (int i = 0; i < len; ++i) {
int mappedNum = 0;
if (isdigit(str[i])) {
View avx2_fma_pi.cpp
#include <stdlib.h>
#include <stdio.h>
#include <immintrin.h>
const static __m256i SEED_MUL = _mm256_set1_epi32(214013);
const static __m256i SEED_ADDI = _mm256_set1_epi32(2531011);
const static __m256i SEED_MASK = _mm256_set1_epi32(0x3F800000);
const static __m256 FLOAT_1 = _mm256_set1_ps(1.f);
const static __m256i INT32_1 = _mm256_set1_epi32(1);
sakamoto-poteko / nvml.cpp
Last active Oct 28, 2015
NVML Get GPU Utilization
View nvml.cpp
#include <cstdio>
#include <nvml.h>
#pragma comment(lib, "nvml")
int main(int argc, char* argv[])
nvmlReturn_t result;
unsigned int device_count;
View a20test.asm
[bits 16]
org 07c00h
mov ax, cs
mov ds, ax
mov es, ax
call check_a20
test ax, ax
sakamoto-poteko /
Last active Aug 29, 2015
Async & Queued MgConvert
if [ `identify -format "%n" ${src}` -eq 1 ]
convert ${src} -resize ${width}x${height} ${des}
You can’t perform that action at this time.