Skip to content

Instantly share code, notes, and snippets.

View rhykw's full-sized avatar

Russel Hunter Yukawa rhykw

View GitHub Profile
@rhykw
rhykw / WoSensorTH.rb
Created September 22, 2022 16:21
SwitchBot温湿度計からデータを取るrubyスクリプト
#!ruby
require 'ble'
module BLE
class Device
def service_data
@o_dev[I_DEVICE]['ServiceData']
end
end
#!/bin/bash
install -m 0700 /dev/null p.cgi
cat <<'EOF' > p.cgi
#!/usr/bin/perl
use strict;
print "Content-Type: text/html\n\n";
--- php-5.1.6/ext/curl/interface.c.curl716
+++ php-5.1.6/ext/curl/interface.c
@@ -271,7 +271,9 @@
REGISTER_CURL_CONSTANT(CURLOPT_FTPAPPEND);
REGISTER_CURL_CONSTANT(CURLOPT_NETRC);
REGISTER_CURL_CONSTANT(CURLOPT_FOLLOWLOCATION);
+#ifdef CURLOPT_FTPASCII
REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII);
+#endif
REGISTER_CURL_CONSTANT(CURLOPT_PUT);
@rhykw
rhykw / install_goenv.sh
Created August 1, 2018 12:55
goenv install
#!/bin/bash
set -e
git clone https://github.com/syndbg/goenv.git ~/.goenv
echo 'export GOENV_ROOT="$HOME/.goenv"' >> ~/.bash_profile
echo 'export PATH="$GOENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo 'if [ -x goenv ] ;then eval "$(goenv init -)" ;fi' >> ~/.bash_profile
. ~/.bash_profile
@rhykw
rhykw / Makefile
Last active March 10, 2018 15:22
libignotify
libignotify.so: libignotify.c
gcc -fPIC -o libignotify.so --shared libignotify.c
clean:
\rm -f libignotify.so
.PHONY: clean
#!/bin/bash
for name in /etc/yum.repos.d/*.repo;do mv $name $name.backup;done
cat << '____EOF____' > /etc/yum.repos.d/CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
baseurl=http://vault.centos.org/5.11/os/$basearch/
gpgcheck=1
@rhykw
rhykw / htscanner.c.patch
Created January 25, 2017 06:47
copy from GH:E. d40740930cf81e9da75e
--- htscanner.c.orig 2012-03-02 00:14:32.000000000 +0900
+++ htscanner.c 2015-12-16 17:12:00.049294116 +0900
@@ -148,7 +148,16 @@
#if PHP_VERSION_ID < 50204
if (zend_alter_ini_entry(name, name_len + 1, value, value_len, mode, PHP_INI_STAGE_RUNTIME) == FAILURE) {
#else
+#if PHP_VERSION_ID < 70000
if (zend_alter_ini_entry(name, name_len + 1, value, value_len, mode, PHP_INI_STAGE_HTACCESS) == FAILURE) {
+#else
+ zend_string *zsname;
Sep 23 14:09:30 PowerDNS Security Update Recommended: Upgrade recommended, see https://doc.powerdns.com/md/security/powerdns-advisory-2016-01/
Sep 23 14:36:12 AXFR of domain 'de' initiated by 93.174.93.210
Sep 23 14:36:12 Got a signal 11, attempting to print trace:
Sep 23 14:36:12 /usr/local/pdns/sbin/pdns_server(+0xf299e) [0x7f17d8e6099e]
Sep 23 14:36:12 /lib64/libc.so.6(+0x326a0) [0x7f17d77af6a0]
Sep 23 14:36:12 /usr/local/pdns/sbin/pdns_server(_ZNK12ComboAddress8toStringEv+0x2c) [0x7f17d8ddc2ec]
Sep 23 14:36:12 /usr/local/pdns/sbin/pdns_server(_ZNK9DNSPacket9getRemoteEv+0xd) [0x7f17d8dd7a7d]
Sep 23 14:36:12 /usr/local/pdns/lib/pdns/libmrubybackend.so(_ZN12MrubyBackend6lookupERK5QTypeRKSsP9DNSPacketi+0x59) [0x7f17d749f4cb]
Sep 23 14:36:12 /usr/local/pdns/sbin/pdns_server(_ZN10DNSBackend6getSOAERKSsR7SOADataP9DNSPacket+0x54) [0x7f17d8e211d4]
Sep 23 14:36:12 /usr/local/pdns/sbin/pdns_server(_ZN12UeberBackend6getSOAERKSsR7SOADataP9DNSPacket+0x9d) [0x7f17d8e6b20d]
#include <netinet/in.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
#include <netinet/in.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{