View memfd_create.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); |
View trim.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -ss 00:00:44 -i testa.mkv -to 00:01:30 -vf "scale=1920:-2" -vcodec libx264 testa.mp4 |
View mqtt-relay.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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" |
View lwip_support_ipv6_scopes.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
View esp8266-mqtt-ipv6.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | |
- |
View trade.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>信用取引計算くん</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.0/font/bootstrap-icons.css"> | |
</head> | |
<body> | |
<div id="page-content" class="card"> | |
<h1 class="card-header"><i class="bi bi-calculator"></i>信用取引計算くん</h1> |
View Makefile.vscode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
View dupremover.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import os,argparse,glob | |
import xxhash | |
def calc_hash_from_file_handle(f): | |
h = xxhash.xxh64() | |
bufsize = h.block_size * 0x800 | |
data = f.read(bufsize) | |
while data: | |
h.update(data) |
View ping6test.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ICMPv6 echo request (ping6) test | |
*/ | |
#include <unistd.h> | |
#include <sys/socket.h> | |
#include <arpa/inet.h> | |
#include <netinet/icmp6.h> |
View build-wg-gateway.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import argparse,ipaddress,subprocess,re | |
import qrcode | |
def generate_privkey(): | |
return subprocess.check_output(["wg","genkey"]).decode("UTF-8").strip() | |
def get_pubkey(privkey): | |
return subprocess.check_output(["wg","pubkey"], input=privkey.encode("UTF-8")).decode("UTF-8").strip() |
NewerOlder