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
/* | |
* modbus_rtu_get_device_info.cpp | |
* MODBUS RTU Device Info Getter for ESP32 series | |
* | |
* SPDX-FileCopyrightText: 2024 Tomoatsu Shimada/Walbrix Corporation | |
* | |
* SPDX-License-Identifier: MIT | |
*/ | |
#include <cstdint> |
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
def is_shift_key_being_pressed(): | |
TIOCLINUX = 0x541C # TIOCLINUXの値はLinuxのカーネルヘッダファイルから取得 | |
shift_state = 6 # 変数の初期値 | |
# 変数をバイトオブジェクトに変換 | |
shift_state_buf = struct.pack('B', shift_state) | |
try: | |
# ioctlシステムコールを使用してシフト状態を取得 | |
shift_state_buf = fcntl.ioctl(sys.stdin.fileno(), TIOCLINUX, shift_state_buf) | |
# 取得した結果をアンパックして表示 |
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
<?php | |
/** | |
* event.php | |
* JavaScriptのEventSource APIにサーバー側でのファイル更新イベントを通知するためのエンドポイント | |
* | |
* PHPにinotifyエクステンションが必要 https://github.com/arnaud-lb/php-inotify | |
* | |
* 2024 Tomoatsu Shimada | |
*/ |
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 socket | |
import argparse | |
def get_ssh_version_string(host, port=22, timeout=5): | |
try: | |
# ソケットアドレス情報を取得 | |
addr_info = socket.getaddrinfo(host, port, socket.AF_UNSPEC, socket.SOCK_STREAM) | |
for res in addr_info: |
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
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.webdriver.common.by import By | |
def image_loaded(driver, element): | |
try: | |
# 画像が完全にロードされているかどうかを確認するJavaScript | |
return driver.execute_script("return arguments[0].complete && typeof arguments[0].naturalWidth != 'undefined' && arguments[0].naturalWidth > 0", element) |
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 MySQLdb | |
import ssl | |
import socket | |
from datetime import datetime | |
import smtplib | |
from email.mime.text import MIMEText | |
from email.mime.multipart import MIMEMultipart | |
# MySQLデータベース接続設定 |
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); |
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 |
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" |
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" |
NewerOlder