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/nft -f | |
# ipv4/ipv6 Simple & Safe Firewall | |
# you can find examples in /usr/share/nftables/ | |
table inet filter { | |
chain input { | |
type filter hook input priority 0; | |
# allow established/related connections | |
ct state {established, related} 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
/** | |
* Title: SFEN parser | |
* Date: 23-Jan-2014 | |
* Author: Daichi Shinozaki <dsdseg@gmail.com> | |
* Demo URL: http://jsfiddle.net/dseg/QezQ7/15/ | |
* | |
* Note: | |
* Tested with PEG.js 0.8.0 | |
* http://pegjs.majda.cz/ | |
* |
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
#!/bin/sh | |
# Requirements: geth | |
fee=$(geth attach ipc:/home/ubuntu/main_net/geth.ipc --exec 'web3.fromWei(web3.eth.gasPrice*web3.eth.estimateGas({from:"0xc1912fee45d61c87cc5ea59dae31190fffff232d"}))') | |
date | |
echo -n $fee | tr -d \" | |
echo \ ETH. |
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
Description='A basic static ethernet connection' | |
Interface=ens3 | |
Connection=ethernet | |
IP=static | |
Address=('111.112.113.114/255.255.254.0') | |
Gateway='111.112.113.1' | |
DNS=('108.61.10.10') | |
## For IPv6 autoconfiguration | |
#IP6=stateless |
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
PKCS11Provider opensc-pkcs11.dll |
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
use std::io::Write; | |
use std::net::{TcpListener, TcpStream}; | |
use std::thread; | |
fn handle_client(mut stream: TcpStream) { | |
thread::spawn(move || { | |
stream.write(b"Hello World\r\n").unwrap(); | |
}); | |
} |
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
# Usage: btc bitcoin_amount_in_satoshi | |
# $ btc 1550000000 | |
# 15.50000 BTC | |
# | |
function btc { | |
if [[ -n $1 ]]; then | |
btc=$(bc -l <<< "$1 / 100000000.0") | |
printf '%.5f BTC\n' $btc | |
fi | |
} |
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
TZ=JST-9 date -Iseconds|tr T ' '|tr - /|head -c 19 |
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
/** | |
* Template String Tag (For crafting query-string for HTTP/Get from a array) | |
* | |
* Usage: qsTag`${['a','b','c','d']}`(); // a=b&c=d | |
*/ | |
export const qsTag = (strings, ...keys) => (...values) => { | |
let result = []; | |
const input = keys[0]; | |
input.forEach((key: any, i: number, ary: any[]) => { | |
const postfix = (ary.length-1 === i ? '' : '&'); |
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
<select> | |
{ | |
// options が undefined or nullなら、何も出力しない。配列なら選択肢に整形する。 | |
options && Array.isArray(options) && options.map((item : any, idx : number) => | |
<option | |
key={`inq_opt_${idx}`} | |
value={item.value}>{item.label}</option>) | |
} | |
</select> |
NewerOlder