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
import nfc | |
clf=nfc.ContactlessFrontend() | |
clf.open('usb:001:006') | |
tag=clf.connect(rdwr={'on-connect': lambda tag: False}) | |
print(tag) |
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
import sys | |
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton | |
if __name__ == '__main__': | |
app = QApplication(sys.argv) | |
window = QWidget() | |
button = QPushButton('button', window) | |
window.show() |
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
# 無線LANの設定 | |
# GL Driver Enable G1 GL (Full KMS) | |
# see also: https://stackoverflow.com/questions/47899501/raspbian-qml-bad-performance | |
$ sudo raspi-config | |
$ wget https://gist.githubusercontent.com/nakamura-akifumi/0dc211c1b8a02e5b526083803b4f0393/raw/a8c29dd9f7cb6100ae76de304ad20962975950fb/config.txt | |
$ sudo cp config.txt /boot | |
$ sudo apt-get -y update | |
$ sudo apt-get -y upgrade |
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
# For more options and information see | |
# http://rpf.io/configtxt | |
# Some settings may impact device functionality. See link above for details | |
# uncomment if you get no picture on HDMI for a default "safe" mode | |
#hdmi_safe=1 | |
# uncomment this if your display has a black border of unused pixels visible | |
# and your display can output without overscan | |
#disable_overscan=1 |
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
<script> | |
var xhr = new XMLHttpRequest(); | |
$(function () { | |
$('#submitbutton').click(function() { | |
//var xhr = new XMLHttpRequest(); | |
xhr.open('GET', 'http://www.tmpz84.info:3000/large-file.iso', true); | |
xhr.responseType = 'blob'; | |
xhr.onload = function () { | |
if (this.status === 200) { | |
var blob = this.response; |
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 | |
$incomingUrl = ''; // 発行されたURL | |
$payload = array( | |
'text' => GetMyHostname().'のアドレス:'.GetMyIpAddr(), | |
'username' => 'tmpz84', | |
// 'icon_url' => 'https://slack.global.ssl.fastly.net/12078/img/services/incoming-webhook_48.png', | |
'icon_emoji' => ':beginner:', | |
'channel' => '#server_status', |
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
upstream app_server { | |
server unix:/tmp/unicorn_${appname}.sock fail_timeout=0; | |
# for TCP setups, point these to your backend servers | |
#server localhost:3000 fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name ${hostname}; |
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
mkdir -p /opt/app | |
chown misadmin:misadmin /opt/app | |
cd /etc/nginx/conf.d | |
cp default.conf default.conf.org |
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
iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP | |
iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP | |
iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP | |
iptables -A INPUT -i lo -j ACCEPT | |
iptables -A INPUT -p icmp -j ACCEPT | |
iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT | |
# iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT | |
iptables -A INPUT -p tcp -m tcp --dport 10037 -j ACCEPT | |
iptables -A INPUT -p tcp -m tcp --dport 10083 -j ACCEPT | |
iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT |
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
echo "start script" | |
echo "step 1: install nginx" | |
cat << 'EOL' >> /etc/yum.repos.d/nginx.repo | |
[nginx] | |
name=nginx repo | |
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ | |
gpgcheck=0 | |
enabled=1 |
NewerOlder