Skip to content

Instantly share code, notes, and snippets.

View takeshiyako2's full-sized avatar

Takeshi Yako takeshiyako2

View GitHub Profile
@takeshiyako2
takeshiyako2 / td-agent.conf
Created July 27, 2016 06:14
fluent-plugin-google-cloud-storage-out config sample
# tail
<source>
type tail
format /^(?<date>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3}) (?<status>\S+) \[(?<role>\S+)\] (?<info>.*)$/
path /tmp/application.log
pos_file /var/log/td-agent/myapp.application.pos
tag td.myapp.application
</source>
<match td.myapp.application>
@takeshiyako2
takeshiyako2 / renew_ip_address_test.xml
Created August 25, 2016 06:42
Change Route53 IP address by dnscurl.pl
<?xml version="1.0" encoding="UTF-8"?>
<ChangeResourceRecordSetsRequest xmlns="https://route53.amazonaws.com/doc/2013-04-01/">
<ChangeBatch>
<Changes>
<Change>
<Action>DELETE</Action>
<ResourceRecordSet>
<Name>test.hitokoto.co.</Name>
<Type>A</Type>
<TTL>300</TTL>
@takeshiyako2
takeshiyako2 / default.conf
Created September 12, 2016 08:41
nginx ngx_http_geoip_module with AWS ELB
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
if ($allowed_country = yes) {
set $exclusions 1;
}
@takeshiyako2
takeshiyako2 / Info.plist
Last active February 7, 2017 02:03
iOS Objective-C against kCFStreamErrorDomainSSL error
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>mydomain.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
@takeshiyako2
takeshiyako2 / Raspberry Pi 4 Model B - USB power ON-OFF - uhubctl.md
Last active February 3, 2024 15:36
Raspberry Pi 4 - USB power ON/OFF by uhubctl

Issue

I want to USB power ON/OFF on Raspberry Pi 4.
Raspberry Pi 4でUSBパワーをON/OFFしたい。

Raspberry PiのUSBポートに直接LEDライトを接続してオンオフを試しました。
ここでは、https://github.com/mvp/uhubctl というユーティリティを使います。
https://github.com/codazoda/hub-ctrl.c も、だいたい同じことができるようですが、こちらの uhubctl の方が扱いやすそうだったので、こちらを選びました。

個別のUSBポートのパワーのON/OFFはできないようで、全てのUSBポートのパワーを一緒に操作しています。

@takeshiyako2
takeshiyako2 / Power Control TP-Link HS105 by tplink-smarthome-api on macOS.md
Last active February 5, 2021 11:15
Power Control TP-Link HS105 by tplink-smarthome-api on macOS