Skip to content

Instantly share code, notes, and snippets.

View shimarin's full-sized avatar

Tomoatsu Shimada shimarin

View GitHub Profile
import MySQLdb
import ssl
import socket
from datetime import datetime
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
# MySQLデータベース接続設定
#include <sys/mman.h>
#include <unistd.h>
#include <iostream>
int main()
auto fd = memfd_create("mytmpfile", 0);
if (fd < 0) throw std::runtime_error("memfd_create");
std::string tmp_filename = "/proc/" + std::to_string(getpid()) + "/fd/" + std::to_string(fd);
ffmpeg -ss 00:00:44 -i testa.mkv -to 00:01:30 -vf "scale=1920:-2" -vcodec libx264 testa.mp4
#include <cstring>
#include <string>
#include <stdio.h>
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/event_groups.h"
#include "driver/gpio.h"
#include "esp_wifi.h"
#include "esp_log.h"
diff --git a/src/core/ipv6/ip6_addr.c b/src/core/ipv6/ip6_addr.c
old mode 100644
new mode 100755
index 687c02f7..ad649761
--- a/src/core/ipv6/ip6_addr.c
+++ b/src/core/ipv6/ip6_addr.c
@@ -41,6 +41,7 @@
#include "lwip/opt.h"
diff --git a/components/tcp_transport/transport_tcp.c b/components/tcp_transport/transport_tcp.c
index 5bfb99dd..cdae5bf0 100644
--- a/components/tcp_transport/transport_tcp.c
+++ b/components/tcp_transport/transport_tcp.c
@@ -32,60 +32,51 @@ typedef struct {
int sock;
} transport_tcp_t;
-static int resolve_dns(const char *host, struct sockaddr_in *ip) {
shimarin / trade.html
Last active February 26, 2022 07:58
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="" rel="stylesheet">
<link rel="stylesheet" href="">
<div id="page-content" class="card">
<h1 class="card-header"><i class="bi bi-calculator"></i>信用取引計算くん</h1>
shimarin / Makefile.vscode
Last active February 22, 2021 21:34
VS Codeで、複数のC++ソースファイルが置いてあるフォルダで編集中ファイルの実行をできるようにするための tasks.jsonと外部 Makefile
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
OBJS=$(subst .cpp,.o,$(call rwildcard,,*.cpp))
BINS=$(subst .cpp,,$(call rwildcard,,*.cpp))
HEADERS=$(call rwildcard,,*.h)
CXXFLAGS ?= -std=c++2a
all: $(BINS)
libproj.a: $(OBJS)
shimarin /
Last active February 21, 2021 05:40
import os,argparse,glob
import xxhash
def calc_hash_from_file_handle(f):
h = xxhash.xxh64()
bufsize = h.block_size * 0x800
data =
while data:
* ICMPv6 echo request (ping6) test
#include <unistd.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/icmp6.h>