Skip to content

Instantly share code, notes, and snippets.

@hirokuma
hirokuma / hirokuma.scm
Created March 2, 2019 04:06
gimp-script-fu-hirokuma
(script-fu-register
"script-fu-hirokuma" ;func name
"hirokuma" ;menu label
"hirokuma" ;description
"hirokuma" ;author
"copyright 2019" ;copyright notice
"March 02, 2019" ;date created
"" ;image type that the script works on
SF-ADJUSTMENT "Width" '(256 1 1024 1 10 0 1)
SF-ADJUSTMENT "Height" '(256 1 1024 1 10 0 1)
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/syscall.h>
#include "lmdb.h"
#define DBDIR "./testdb"
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "lmdb.h"
#define DBDIR "./testdb"
#define DBNAME "name"
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "lmdb.h"
#define DBDIR "./testdb"
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "lmdb.h"
#define DBDIR "./testdb"
#include <stdio.h> //printf
#include <string.h> //memset
#include <unistd.h> //close
#include <sys/socket.h> //socket
#include <arpa/inet.h> //inet
#include <sys/types.h> //getaddrinfo
#include <netdb.h> //getaddrinfo
@hirokuma
hirokuma / inet_pton_example.c
Created November 4, 2018 00:40
inet_pton()
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <arpa/inet.h>
int main(void)
{
const char IPADDR[] = "192.168.10.5";
@hirokuma
hirokuma / sodium_mbedtls_chacha20.c
Created July 28, 2018 07:58
sodium_mbedtls_chacha20.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "include/sodium/crypto_stream_chacha20.h"
#include "include/sodium/randombytes.h"
#include "include/mbedtls/chacha20.h"
static void dump(const unsigned char *pData, size_t Len)
{
for (size_t lp = 0; lp < Len; lp++) {
@hirokuma
hirokuma / sodium_chacha20poly1305_test.c
Created July 27, 2018 15:38
libsodium_chacha20poly1305_mbedtls
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "include/sodium/crypto_aead_chacha20poly1305.h"
static const unsigned char test_key[1][32] =
{
{
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
import java.math.BigDecimal;
public class Main {
public static void main(String[] args) {
//0xFEDCBA9876543210
BigDecimal dec = new BigDecimal("18364758544493064720");
BigDecimal div = dec.divide(new BigDecimal("72057594037927936"));
System.out.println("big decimal 2byte: " + Integer.toHexString(div.intValue()));