This worked!
Command:
# cat /etc/sysconfig/iptables
Result:
# (1) ポリシーの設定 OUTPUTのみACCEPTにする
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
# (2) ループバック(自分自身からの通信)を許可する
-A INPUT -i lo -j ACCEPT
# (3) データを持たないパケットの接続を破棄する
-A INPUT -p tcp --tcp-flags ALL NONE -j DROP
# (4) SYNflood攻撃と思われる接続を破棄する
-A INPUT -p tcp ! --syn -m state --state NEW -j DROP
# (5) ステルススキャンと思われる接続を破棄する
-A INPUT -p tcp --tcp-flags ALL ALL -j DROP
# (6) icmp(ping)の設定
# hashlimitを使う
# -m hashlimit hashlimitモジュールを使用する
# —hashlimit-name t_icmp 記録するファイル名
# —hashlimit 1/m リミット時には1分間に1パケットを上限とする
# —hashlimit-burst 10 規定時間内に10パケット受信すればリミットを有効にする
# —hashlimit-mode srcip ソースIPを元にアクセスを制限する
# —hashlimit-htable-expire 120000 リミットの有効期間。単位はms
-A INPUT -p icmp --icmp-type echo-request -m hashlimit --hashlimit-name t_icmp --hashlimit 1/m --hashlimit-burst 10 --hashlimit-mode srcip --hashlimit-htable-expire 120000 -j ACCEPT
# (7) 確立済みの通信は、ポート番号に関係なく許可する
-A INPUT -p tcp -m state --state ESTABLISHED,RELATED -j ACCEPT
# (8) 任意へのDNSアクセスの戻りパケットを受け付ける
-A INPUT -p udp --sport 53 -j ACCEPT
# (9) SSHを許可する設定
# hashlimitを使う
# -m hashlimit hashlimitモジュールを使用する
# —hashlimit-name t_sshd 記録するファイル名
# —hashlimit 1/m リミット時には1分間に1パケットを上限とする
# —hashlimit-burst 10 規定時間内に10パケット受信すればリミットを有効にする
# —hashlimit-mode srcip ソースIPを元にアクセスを制限する
# —hashlimit-htable-expire 120000 リミットの有効期間。単位はms
-A INPUT -p tcp -m state --syn --state NEW --dport 22 -m hashlimit --hashlimit-name t_sshd --hashlimit 1/m --hashlimit-burst 10 --hashlimit-mode srcip --hashlimit-htable-expire 120000 -j ACCEPT
# (10) 個別に許可するプロトコルとポートをここに書き込む。
# この例では、HTTP(TCP 80)とHTTPS(TCP 443)を許可している。
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
COMMIT
Reference:
http://knowledge.sakura.ad.jp/beginner/4048/
Wednesday, August 30, 2017
CentOS: iptables: Fixing Webserver Accessibility (How secure now?)
Command:
# diff /etc/sysconfig/iptables /etc/sysconfig/iptables.org
Result:
1c1,2
< # Generated by iptables-save v1.4.7 on Wed Aug 30 00:09:28 2017
---
> # Firewall configuration written by system-config-firewall
> # Manual customization of this file is not recommended.
3,11c4,12
< :INPUT DROP [0:0]
< :FORWARD DROP [0:0]
< :OUTPUT ACCEPT [24:2320]
< -A INPUT -i lo -j ACCEPT
< -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
< -A INPUT -p tcp -m tcp --dport 53 -j ACCEPT
< -A INPUT -p udp -m udp --dport 53 -j ACCEPT
< -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
< -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
---
> :INPUT ACCEPT [0:0]
> :FORWARD ACCEPT [0:0]
> :OUTPUT ACCEPT [0:0]
> -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
> -A INPUT -p icmp -j ACCEPT
> -A INPUT -i lo -j ACCEPT
> -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
> -A INPUT -j REJECT --reject-with icmp-host-prohibited
> -A FORWARD -j REJECT --reject-with icmp-host-prohibited
13d13
< # Completed on Wed Aug 30 00:09:28 2017
Reference:
http://programmerbox.com/2013-12-24_vps_construct_procedure_manual/
# diff /etc/sysconfig/iptables /etc/sysconfig/iptables.org
Result:
1c1,2
< # Generated by iptables-save v1.4.7 on Wed Aug 30 00:09:28 2017
---
> # Firewall configuration written by system-config-firewall
> # Manual customization of this file is not recommended.
3,11c4,12
< :INPUT DROP [0:0]
< :FORWARD DROP [0:0]
< :OUTPUT ACCEPT [24:2320]
< -A INPUT -i lo -j ACCEPT
< -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
< -A INPUT -p tcp -m tcp --dport 53 -j ACCEPT
< -A INPUT -p udp -m udp --dport 53 -j ACCEPT
< -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
< -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
---
> :INPUT ACCEPT [0:0]
> :FORWARD ACCEPT [0:0]
> :OUTPUT ACCEPT [0:0]
> -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
> -A INPUT -p icmp -j ACCEPT
> -A INPUT -i lo -j ACCEPT
> -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
> -A INPUT -j REJECT --reject-with icmp-host-prohibited
> -A FORWARD -j REJECT --reject-with icmp-host-prohibited
13d13
< # Completed on Wed Aug 30 00:09:28 2017
Reference:
http://programmerbox.com/2013-12-24_vps_construct_procedure_manual/
ラベル:
CentOS,
diff utility,
iptables
Tuesday, August 29, 2017
CentOS: iptables: Opening HTTP and HTTPS Ports
Command:
# diff /etc/sysconfig/iptables /etc/sysconfig/iptables.org
Result:
13,14d12
< -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
< -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
Command:
# service iptables restart
Result:
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
iptables: Applying firewall rules: [ OK ]
# diff /etc/sysconfig/iptables /etc/sysconfig/iptables.org
Result:
13,14d12
< -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
< -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
Command:
# service iptables restart
Result:
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
iptables: Applying firewall rules: [ OK ]
CentOS: Adding User
Command:
# useradd USERNAME
# passwd USERNAME
Result:
Changing password for user USERNAME.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
Command:
# su USERNAME
$ cd ~
$ ls
$ pwd
Result:
/home/USERNAME
# useradd USERNAME
# passwd USERNAME
Result:
Changing password for user USERNAME.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
Command:
# su USERNAME
$ cd ~
$ ls
$ pwd
Result:
/home/USERNAME
ラベル:
CentOS
SSH: Accessing Virtual Private Server Using RSA Private Key File
Command:
$ cat vps.key
Result:
-----BEGIN RSA PRIVATE KEY-----
fasdfsadfsadJAyxNgvFkJoMF+MEyWV4Qfasdfasd
gTf2LsM2mo6Jodh+VVffsadfsadfsdafsadfa0QPTlY+905/z3e24DYtKHbP
eRfem0kq/H17eguWk4BounPWfJKrYGR1rS00K5OeWfoTAoz6osc3rN8LXwIBIwKB
gQCZXb8ppDdM50Ki7A04CSoEb/qWChMJtIRFGfMI3A+MvFuj/50Wi7zGoQz9wDxW
gv0cNaT/Z/B1z40AAAAAAAAAAAAAAAAAAAAIY83RKh/Kj+Jv8OhW1FNUp/Il7WOs
1zo+owYp9uyT08gE1XBGvMrdam2w77YabIT20Dt2jkKs2wJBfasdfVu88cqmJ2P
F0+JlFbOL5pvldjfkeDkefIesdIdfeIdkXxK343/45uo35lYVj6vXfdsafFeMWD
jHH3EYMCQQD1JcnOz8CGMSeMbFXrdb1erkt3fgcJwny4WotUUoRx5KZinPGSasXv
GmL8zshzHcN9wWFgicXGOcqpQijM8kP1AkAdHoMd4MtnOBFxF6rkhMB+8v4gR0zw
F901P7OURpHAiCf/4lnFD98fadsfsadfasdfasdfuoUFHeHqr/LLMi3jAkBUDPS7
73U1Uq55SbcO5ooR1Vuz8LH0t7W7jMIOSC1o4K4TLn6123cQJk3TBRGGjdygJQtx
jlJv2UzMUTKPaQFbAkAuvRDkvUVb1lvuduolUZHmz3SBdwiKIVMn8+SeXoCT+hL8
SQJ56ary8w+dkfjaldkfkjdekelsldkelf
-----END RSA PRIVATE KEY-----
Command:
$ cat ~/.ssh/config
Result:
Host vps
HostName 111.111.11.111
Port 22
User root
IdentityFile ~/vps.key
Command:
$ chmod 600 ~/vps.key
Command:
$ ssh vps
Result:
[root@v111-111-11-111 ~]#
$ cat vps.key
Result:
-----BEGIN RSA PRIVATE KEY-----
fasdfsadfsadJAyxNgvFkJoMF+MEyWV4Qfasdfasd
gTf2LsM2mo6Jodh+VVffsadfsadfsdafsadfa0QPTlY+905/z3e24DYtKHbP
eRfem0kq/H17eguWk4BounPWfJKrYGR1rS00K5OeWfoTAoz6osc3rN8LXwIBIwKB
gQCZXb8ppDdM50Ki7A04CSoEb/qWChMJtIRFGfMI3A+MvFuj/50Wi7zGoQz9wDxW
gv0cNaT/Z/B1z40AAAAAAAAAAAAAAAAAAAAIY83RKh/Kj+Jv8OhW1FNUp/Il7WOs
1zo+owYp9uyT08gE1XBGvMrdam2w77YabIT20Dt2jkKs2wJBfasdfVu88cqmJ2P
F0+JlFbOL5pvldjfkeDkefIesdIdfeIdkXxK343/45uo35lYVj6vXfdsafFeMWD
jHH3EYMCQQD1JcnOz8CGMSeMbFXrdb1erkt3fgcJwny4WotUUoRx5KZinPGSasXv
GmL8zshzHcN9wWFgicXGOcqpQijM8kP1AkAdHoMd4MtnOBFxF6rkhMB+8v4gR0zw
F901P7OURpHAiCf/4lnFD98fadsfsadfasdfasdfuoUFHeHqr/LLMi3jAkBUDPS7
73U1Uq55SbcO5ooR1Vuz8LH0t7W7jMIOSC1o4K4TLn6123cQJk3TBRGGjdygJQtx
jlJv2UzMUTKPaQFbAkAuvRDkvUVb1lvuduolUZHmz3SBdwiKIVMn8+SeXoCT+hL8
SQJ56ary8w+dkfjaldkfkjdekelsldkelf
-----END RSA PRIVATE KEY-----
Command:
$ cat ~/.ssh/config
Result:
Host vps
HostName 111.111.11.111
Port 22
User root
IdentityFile ~/vps.key
Command:
$ chmod 600 ~/vps.key
Command:
$ ssh vps
Result:
[root@v111-111-11-111 ~]#
Monday, August 28, 2017
Saturday, August 26, 2017
Thursday, August 24, 2017
Monday, August 21, 2017
Sunday, August 20, 2017
Friday, August 18, 2017
macOS Sierra: Burning a CD from Darik's Boot and Nuke iso File
Command:
$ sudo dd if=~/Downloads/dban-2.3.0_i586.iso of=/dev/disk6s2
Result:
32656+0 records in
32656+0 records out
16719872 bytes transferred in 30.549265 secs (547308 bytes/sec)
$ sudo dd if=~/Downloads/dban-2.3.0_i586.iso of=/dev/disk6s2
Result:
32656+0 records in
32656+0 records out
16719872 bytes transferred in 30.549265 secs (547308 bytes/sec)
Thursday, August 17, 2017
Wednesday, August 16, 2017
Monday, August 14, 2017
macOS Sierra: Installing Go Ethereum
Command:
$ brew tap ethereum/ethereum
Result:
Updating Homebrew...
==> Auto-updated Homebrew!
Updated Homebrew from 9d55446cd to e1bab7ede.
Updated 3 taps (caskroom/cask, homebrew/core, homebrew/science).
==> New Formulae
apng2gif dep inetutils netcdf snapcraft
armadillo flann libpq payara superlu
ceres-solver hdf5@1.8 libtrng pumba vtk
cfitsio hwloc mujs sbt@0.13
==> Updated Formulae
acpica jp2a
agda jpeg ✔
akamai jpeginfo
allure jpegoptim
angular-cli jsdoc3
ansifilter kapacitor
apache-flink knot-resolver
aptly kubernetes-cli
arangodb lean-cli
argyll-cms leptonica
arx-libertatis libagar
ascii libav
aspell libbpg
autopano-sift-c libcdr
aws-elasticbeanstalk libcds
awscli libfabric
axel libgaiagraphics
bacula-fd libgeotiff
bartycrouch libgit2-glib
basex libgphoto2
bash-git-prompt libgxps
bash-snippets liblcf
bazel liblo
beecrypt libmspub
bibtexconv libmwaw
bit libpano
bitrise libphonenumber
blastem libpng ✔
bnd librasterlite
botan libraw
brew-gem libsoup
btfs libsvg-cairo
buku libtiff ✔
byobu libuninameslist
cabal-install ✔ libvirt
cc65 libvisio
certbot libwmf
certstrap libwps
chakra libxkbcommon
clojurescript little-cms
closure-compiler little-cms2 ✔
clutter-gtk logstalgia
cmake ✔ macvim ✔
cmark makensis
cmark-gfm makeself
cocoapods mal4s
coffeescript mame
collector-sidecar mandoc
conjure-up mapnik
consul mapserver
convox mariadb@10.0
couchdb mariadb@10.1
crowdin media-info
curl ✔ mediaconch
dateutils mednafen
dbhash mercurial ✔
dcm2niix metabase
dcmtk micro
dcraw minetest
debianutils minidlna
deis minimal-racket
depqbf minio
devil mjpegtools
dhall-json mksh
diff-pdf mldonkey
diffoscope monetdb
digdag mongo-c-driver
django-completion mongo-orchestration
djvulibre mongodb
dnsmasq mono-libgdiplus
docker-machine-driver-vultr mpd
docutils mpdscribble
double-conversion mpg123
duck mpv
dwdiff mscgen
e2fsprogs msgpack
efl msitools
eg mycli
elixir nagios
emscripten nativefier
epeg netpbm
etcd nmap ✔
etsh node
expat node-build
exploitdb node@6
faas-cli nodeenv
fbida nodenv
fdroidserver numpy ✔
ffmpegthumbnailer nzbget
fibjs octave ✔
ficy oniguruma
filebeat onscripter
firebase-cli open-scene-graph
fizmo openal-soft
fizsh openclonk
flactag opencoarrays
flawfinder opencsg
flow openjpeg
fltk ✔ openmsx
fluent-bit openrct2
fobis openshift-cli
folly openslide
fontforge opusfile
fonttools orientdb
forego osrm-backend
fox overmind
freeling packer
freeswitch paket
freetds pandoc-crossref
fs-uae pango
fswatch passenger
fwup pazpar2
fzf pdf2htmlex
gauge pdftoedn
gcsfuse pdftoipe
gd ✔ percona-server
gdal percona-server-mongodb
gdk-pixbuf percona-server@5.5
gedit percona-server@5.6
geeqie percona-toolkit
gegl percona-xtrabackup
geocode-glib pgcli
geoserver pike
getdns pilosa
ghostscript ✔ pioneer
git ✔ pjproject
git-flow-avh platformio
gitbucket plowshare
gitg plplot
github-markdown-toc pngquant
gitlab-ci-multi-runner podofo
gjs ponscripter-sekai
glassfish ponyc
glew ✔ poppler
gmic postgresql
gnupg postgresql@9.4
gnuplot ✔ postgresql@9.5
gnuplot@4 potrace
goad povray
gofabric8 ppsspp
goofys pre-commit
gource presto
gphoto2 protobuf-c
grace pwgen
gradle pyinvoke
grafana qemu
graphicsmagick ✔ qrupdate ✔
grib-api re2
grpc re2c
gsmartcontrol redis@3.2
gsoap residualvm
gst-plugins-bad rlvm
gst-plugins-good rtags
gst-plugins-ugly rtv
gtk+3 saltstack
gws sane-backends
harfbuzz sbcl
hashcat sbt ✔
haskell-stack scalapack
hdf5 ✔ scipy
heroku scour
hivemind scummvm
homebrew/science/ampl-mp sdl2_image
homebrew/science/anvio sdl_image ✔
homebrew/science/astrometry-net sfml
homebrew/science/bwa sjk
homebrew/science/dlib skinny
homebrew/science/enblend-enfuse slackcat
homebrew/science/fwdpp sleuthkit
homebrew/science/g2o sonarqube
homebrew/science/genometools sourcery
homebrew/science/gnuastro spandsp
homebrew/science/gromacs spim
homebrew/science/hdf4 sqldiff
homebrew/science/igraph sqlite ✔
homebrew/science/igv sqlite-analyzer
homebrew/science/igvtools sqlmap
homebrew/science/insighttoolkit statik
homebrew/science/itensor subnetcalc
homebrew/science/lammps subversion
homebrew/science/libbi supertux
homebrew/science/mantaflow svg2pdf
homebrew/science/maq svg2png
homebrew/science/mathgl swiftformat
homebrew/science/megahit swiftgen
homebrew/science/mira swiftlint
homebrew/science/mrbayes syncthing
homebrew/science/nextflow syntaxerl
homebrew/science/nexusformat tcl-tk
homebrew/science/opencollada tectonic
homebrew/science/opencv termius
homebrew/science/opencv3 terraform
homebrew/science/openimageio thefuck
homebrew/science/openmeeg tiff2png
homebrew/science/packmol tippecanoe
homebrew/science/paraview todolist
homebrew/science/parsnp tor
homebrew/science/pcl translate-toolkit
homebrew/science/phlawd twoping
homebrew/science/pillow ufoai
homebrew/science/pspp ufraw
homebrew/science/radx varnish
homebrew/science/raxml varnish@4
homebrew/science/ray vault
homebrew/science/repeatmasker vdirsyncer
homebrew/science/scram veclibfort ✔
homebrew/science/shrimp vice
homebrew/science/simpleitk vim ✔
homebrew/science/siril vips
homebrew/science/snpeff vncsnapshot
homebrew/science/sratoolkit volatility
homebrew/science/sumo wabt
homebrew/science/vcftools watchman
homebrew/science/vigra watson
homebrew/science/visp weboob
homebrew/science/wxmaxima webp ✔
homebrew/science/xfig webpack
htmldoc widelands
hugo ✔ wimlib
i2p wine
ice wireguard-tools
icecream wolfssl
icu4c wpcli-completion
idris wxmac ✔
imagemagick ✔ x11vnc
imagemagick@6 x264
imageworsener xmake
imlib2 xmoto
immortal xplanet
influxdb xsane
insect yaz
io yle-dl
ipython youtube-dl
ipython@5 zbar
isync zebra
jasper zorba
jbig2enc zsh
jenkins
==> Renamed Formulae
transfig ✔ -> fig2dev
==> Deleted Formulae
jpeg@9 mapnik@2 szl
==> Migrating transfig to fig2dev
==> Unlinking transfig
==> Moving transfig children
==> Linking fig2dev
==> Tapping ethereum/ethereum
Cloning into '/usr/local/Homebrew/Library/Taps/ethereum/homebrew-ethereum'...
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 6 (delta 1), reused 1 (delta 0), pack-reused 0
Unpacking objects: 100% (6/6), done.
Tapped 3 formulae (32 files, 33.5KB)
Command:
$ brew install ethereum
Result:
==> Installing ethereum from ethereum/ethereum
==> Installing dependencies for ethereum/ethereum/ethereum: go
==> Installing ethereum/ethereum/ethereum dependency: go
==> Downloading https://homebrew.bintray.com/bottles/go-1.8.3.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring go-1.8.3.sierra.bottle.tar.gz
==> Caveats
A valid GOPATH is required to use the `go get` command.
If $GOPATH is not specified, $HOME/go will be used by default:
https://golang.org/doc/code.html#GOPATH
You may wish to add the GOROOT-based install location to your PATH:
export PATH=$PATH:/usr/local/opt/go/libexec/bin
==> Summary
🍺 /usr/local/Cellar/go/1.8.3: 7,035 files, 282.0MB
==> Installing ethereum/ethereum/ethereum
==> Cloning https://github.com/ethereum/go-ethereum.git
Cloning into '/Users/USERNAME/Library/Caches/Homebrew/ethereum--git'...
remote: Counting objects: 2275, done.
remote: Compressing objects: 100% (2009/2009), done.
remote: Total 2275 (delta 270), reused 1395 (delta 148), pack-reused 0
Receiving objects: 100% (2275/2275), 7.08 MiB | 1.28 MiB/s, done.
Resolving deltas: 100% (270/270), done.
Note: checking out 'ab5646c532292b51e319f290afccf6a44f874372'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
==> Checking out tag v1.6.7
==> go env
==> make all
==> Caveats
To have launchd start ethereum/ethereum/ethereum now and restart at login:
brew services start ethereum/ethereum/ethereum
==> Summary
🍺 /usr/local/Cellar/ethereum/1.6.7: 10 files, 46.3MB, built in 1 minute 16 seconds
$ brew tap ethereum/ethereum
Result:
Updating Homebrew...
==> Auto-updated Homebrew!
Updated Homebrew from 9d55446cd to e1bab7ede.
Updated 3 taps (caskroom/cask, homebrew/core, homebrew/science).
==> New Formulae
apng2gif dep inetutils netcdf snapcraft
armadillo flann libpq payara superlu
ceres-solver hdf5@1.8 libtrng pumba vtk
cfitsio hwloc mujs sbt@0.13
==> Updated Formulae
acpica jp2a
agda jpeg ✔
akamai jpeginfo
allure jpegoptim
angular-cli jsdoc3
ansifilter kapacitor
apache-flink knot-resolver
aptly kubernetes-cli
arangodb lean-cli
argyll-cms leptonica
arx-libertatis libagar
ascii libav
aspell libbpg
autopano-sift-c libcdr
aws-elasticbeanstalk libcds
awscli libfabric
axel libgaiagraphics
bacula-fd libgeotiff
bartycrouch libgit2-glib
basex libgphoto2
bash-git-prompt libgxps
bash-snippets liblcf
bazel liblo
beecrypt libmspub
bibtexconv libmwaw
bit libpano
bitrise libphonenumber
blastem libpng ✔
bnd librasterlite
botan libraw
brew-gem libsoup
btfs libsvg-cairo
buku libtiff ✔
byobu libuninameslist
cabal-install ✔ libvirt
cc65 libvisio
certbot libwmf
certstrap libwps
chakra libxkbcommon
clojurescript little-cms
closure-compiler little-cms2 ✔
clutter-gtk logstalgia
cmake ✔ macvim ✔
cmark makensis
cmark-gfm makeself
cocoapods mal4s
coffeescript mame
collector-sidecar mandoc
conjure-up mapnik
consul mapserver
convox mariadb@10.0
couchdb mariadb@10.1
crowdin media-info
curl ✔ mediaconch
dateutils mednafen
dbhash mercurial ✔
dcm2niix metabase
dcmtk micro
dcraw minetest
debianutils minidlna
deis minimal-racket
depqbf minio
devil mjpegtools
dhall-json mksh
diff-pdf mldonkey
diffoscope monetdb
digdag mongo-c-driver
django-completion mongo-orchestration
djvulibre mongodb
dnsmasq mono-libgdiplus
docker-machine-driver-vultr mpd
docutils mpdscribble
double-conversion mpg123
duck mpv
dwdiff mscgen
e2fsprogs msgpack
efl msitools
eg mycli
elixir nagios
emscripten nativefier
epeg netpbm
etcd nmap ✔
etsh node
expat node-build
exploitdb node@6
faas-cli nodeenv
fbida nodenv
fdroidserver numpy ✔
ffmpegthumbnailer nzbget
fibjs octave ✔
ficy oniguruma
filebeat onscripter
firebase-cli open-scene-graph
fizmo openal-soft
fizsh openclonk
flactag opencoarrays
flawfinder opencsg
flow openjpeg
fltk ✔ openmsx
fluent-bit openrct2
fobis openshift-cli
folly openslide
fontforge opusfile
fonttools orientdb
forego osrm-backend
fox overmind
freeling packer
freeswitch paket
freetds pandoc-crossref
fs-uae pango
fswatch passenger
fwup pazpar2
fzf pdf2htmlex
gauge pdftoedn
gcsfuse pdftoipe
gd ✔ percona-server
gdal percona-server-mongodb
gdk-pixbuf percona-server@5.5
gedit percona-server@5.6
geeqie percona-toolkit
gegl percona-xtrabackup
geocode-glib pgcli
geoserver pike
getdns pilosa
ghostscript ✔ pioneer
git ✔ pjproject
git-flow-avh platformio
gitbucket plowshare
gitg plplot
github-markdown-toc pngquant
gitlab-ci-multi-runner podofo
gjs ponscripter-sekai
glassfish ponyc
glew ✔ poppler
gmic postgresql
gnupg postgresql@9.4
gnuplot ✔ postgresql@9.5
gnuplot@4 potrace
goad povray
gofabric8 ppsspp
goofys pre-commit
gource presto
gphoto2 protobuf-c
grace pwgen
gradle pyinvoke
grafana qemu
graphicsmagick ✔ qrupdate ✔
grib-api re2
grpc re2c
gsmartcontrol redis@3.2
gsoap residualvm
gst-plugins-bad rlvm
gst-plugins-good rtags
gst-plugins-ugly rtv
gtk+3 saltstack
gws sane-backends
harfbuzz sbcl
hashcat sbt ✔
haskell-stack scalapack
hdf5 ✔ scipy
heroku scour
hivemind scummvm
homebrew/science/ampl-mp sdl2_image
homebrew/science/anvio sdl_image ✔
homebrew/science/astrometry-net sfml
homebrew/science/bwa sjk
homebrew/science/dlib skinny
homebrew/science/enblend-enfuse slackcat
homebrew/science/fwdpp sleuthkit
homebrew/science/g2o sonarqube
homebrew/science/genometools sourcery
homebrew/science/gnuastro spandsp
homebrew/science/gromacs spim
homebrew/science/hdf4 sqldiff
homebrew/science/igraph sqlite ✔
homebrew/science/igv sqlite-analyzer
homebrew/science/igvtools sqlmap
homebrew/science/insighttoolkit statik
homebrew/science/itensor subnetcalc
homebrew/science/lammps subversion
homebrew/science/libbi supertux
homebrew/science/mantaflow svg2pdf
homebrew/science/maq svg2png
homebrew/science/mathgl swiftformat
homebrew/science/megahit swiftgen
homebrew/science/mira swiftlint
homebrew/science/mrbayes syncthing
homebrew/science/nextflow syntaxerl
homebrew/science/nexusformat tcl-tk
homebrew/science/opencollada tectonic
homebrew/science/opencv termius
homebrew/science/opencv3 terraform
homebrew/science/openimageio thefuck
homebrew/science/openmeeg tiff2png
homebrew/science/packmol tippecanoe
homebrew/science/paraview todolist
homebrew/science/parsnp tor
homebrew/science/pcl translate-toolkit
homebrew/science/phlawd twoping
homebrew/science/pillow ufoai
homebrew/science/pspp ufraw
homebrew/science/radx varnish
homebrew/science/raxml varnish@4
homebrew/science/ray vault
homebrew/science/repeatmasker vdirsyncer
homebrew/science/scram veclibfort ✔
homebrew/science/shrimp vice
homebrew/science/simpleitk vim ✔
homebrew/science/siril vips
homebrew/science/snpeff vncsnapshot
homebrew/science/sratoolkit volatility
homebrew/science/sumo wabt
homebrew/science/vcftools watchman
homebrew/science/vigra watson
homebrew/science/visp weboob
homebrew/science/wxmaxima webp ✔
homebrew/science/xfig webpack
htmldoc widelands
hugo ✔ wimlib
i2p wine
ice wireguard-tools
icecream wolfssl
icu4c wpcli-completion
idris wxmac ✔
imagemagick ✔ x11vnc
imagemagick@6 x264
imageworsener xmake
imlib2 xmoto
immortal xplanet
influxdb xsane
insect yaz
io yle-dl
ipython youtube-dl
ipython@5 zbar
isync zebra
jasper zorba
jbig2enc zsh
jenkins
==> Renamed Formulae
transfig ✔ -> fig2dev
==> Deleted Formulae
jpeg@9 mapnik@2 szl
==> Migrating transfig to fig2dev
==> Unlinking transfig
==> Moving transfig children
==> Linking fig2dev
==> Tapping ethereum/ethereum
Cloning into '/usr/local/Homebrew/Library/Taps/ethereum/homebrew-ethereum'...
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 6 (delta 1), reused 1 (delta 0), pack-reused 0
Unpacking objects: 100% (6/6), done.
Tapped 3 formulae (32 files, 33.5KB)
Command:
$ brew install ethereum
Result:
==> Installing ethereum from ethereum/ethereum
==> Installing dependencies for ethereum/ethereum/ethereum: go
==> Installing ethereum/ethereum/ethereum dependency: go
==> Downloading https://homebrew.bintray.com/bottles/go-1.8.3.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring go-1.8.3.sierra.bottle.tar.gz
==> Caveats
A valid GOPATH is required to use the `go get` command.
If $GOPATH is not specified, $HOME/go will be used by default:
https://golang.org/doc/code.html#GOPATH
You may wish to add the GOROOT-based install location to your PATH:
export PATH=$PATH:/usr/local/opt/go/libexec/bin
==> Summary
🍺 /usr/local/Cellar/go/1.8.3: 7,035 files, 282.0MB
==> Installing ethereum/ethereum/ethereum
==> Cloning https://github.com/ethereum/go-ethereum.git
Cloning into '/Users/USERNAME/Library/Caches/Homebrew/ethereum--git'...
remote: Counting objects: 2275, done.
remote: Compressing objects: 100% (2009/2009), done.
remote: Total 2275 (delta 270), reused 1395 (delta 148), pack-reused 0
Receiving objects: 100% (2275/2275), 7.08 MiB | 1.28 MiB/s, done.
Resolving deltas: 100% (270/270), done.
Note: checking out 'ab5646c532292b51e319f290afccf6a44f874372'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
==> Checking out tag v1.6.7
==> go env
==> make all
==> Caveats
To have launchd start ethereum/ethereum/ethereum now and restart at login:
brew services start ethereum/ethereum/ethereum
==> Summary
🍺 /usr/local/Cellar/ethereum/1.6.7: 10 files, 46.3MB, built in 1 minute 16 seconds
ラベル:
Ethereum,
macOS Sierra,
イーサリアム
Sunday, August 13, 2017
Saturday, August 12, 2017
Friday, August 11, 2017
Thursday, August 10, 2017
Wednesday, August 9, 2017
Bash (Unix shell): Converting Bitcoin Cash Amount to Yen
Command:
$ cat ./cryptocurrency_price_bittrex.sh
Result:
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 PAIR AMOUNT" >&2
exit 1
fi
pair=$1;
amount=$2;
yenrate=$(curl -s "https://coincheck.com/api/rate/BTC_JPY" | python -c "import sys, json; print json.load(sys.stdin)['rate']");
curl -s "https://bittrex.com/api/v1.1/public/getticker?market=$pair" | python -c "import sys, json; print float(json.load(sys.stdin)['result']['Last']) * float(sys.argv[1]) * float(sys.argv[2])" $amount $yenrate
Command (How many Yen for 0.19 Bitcoin Cash):
$ ./cryptocurrency_price_bittrex.sh BTC-BCC 0.19
Result:
7461.446566
$ cat ./cryptocurrency_price_bittrex.sh
Result:
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 PAIR AMOUNT" >&2
exit 1
fi
pair=$1;
amount=$2;
yenrate=$(curl -s "https://coincheck.com/api/rate/BTC_JPY" | python -c "import sys, json; print json.load(sys.stdin)['rate']");
curl -s "https://bittrex.com/api/v1.1/public/getticker?market=$pair" | python -c "import sys, json; print float(json.load(sys.stdin)['result']['Last']) * float(sys.argv[1]) * float(sys.argv[2])" $amount $yenrate
Command (How many Yen for 0.19 Bitcoin Cash):
$ ./cryptocurrency_price_bittrex.sh BTC-BCC 0.19
Result:
7461.446566
Tuesday, August 8, 2017
Tuesday, August 1, 2017
Bash (Unix shell): Getting Cryptocurrency Price Using API
Command:
$ cat cryptocurrency_price.sh
Result:
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 PAIR AMOUNT" >&2
exit 1
fi
pair=$1; amount=$2; curl -s "https://coincheck.com/api/rate/$pair" | python -c "import sys, json; print float(json.load(sys.stdin)['rate']) * float(sys.argv[1])" $amount
Command:
$ ./cryptocurrency_price.sh
Result:
Usage: ./cryptocurrency_price_jpy.sh PAIR AMOUNT
Command:
$ ./cryptocurrency_price.sh btc_jpy 1
Result:
318146.0
Command:
$ ./cryptocurrency_price_jpy.sh eth_jpy 13.5
Result:
303218.972773
Command:
$ ./cryptocurrency_price_jpy.sh xem_jpy 1000
Result:
18703.59758
$ cat cryptocurrency_price.sh
Result:
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 PAIR AMOUNT" >&2
exit 1
fi
pair=$1; amount=$2; curl -s "https://coincheck.com/api/rate/$pair" | python -c "import sys, json; print float(json.load(sys.stdin)['rate']) * float(sys.argv[1])" $amount
Command:
$ ./cryptocurrency_price.sh
Result:
Usage: ./cryptocurrency_price_jpy.sh PAIR AMOUNT
Command:
$ ./cryptocurrency_price.sh btc_jpy 1
Result:
318146.0
Command:
$ ./cryptocurrency_price_jpy.sh eth_jpy 13.5
Result:
303218.972773
Command:
$ ./cryptocurrency_price_jpy.sh xem_jpy 1000
Result:
18703.59758
Subscribe to:
Posts (Atom)