Archives:

Mongodb

yum -y update 编辑Mongodb安装源 vim /etc/yum.repos.d/mongodb-org-3.6.repo 编辑内容如下: [mongodb-org-3.6] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc 安装 yum install -y mongodb-org 修改mongodb配置文件 vim /etc/mongod.conf systemctl start mongod.service //启动服务 systemctl stop mongod.service //停止服务 systemctl restart mongod.service //重启服务 删除安装的包yum erase $(rpm -qa | grep mongodb-org) 删除数据及日志 rm -r /var/log/mongodb rm -r /var/lib/mongo   更多内容参考: https://www.jianshu.com/p/d09506c64fcd https://www.cnblogs.com/hackyo/p/7967170.html


Centos创建以太坊私有链

首先第一部当然是更新,然后使用yum命令安装golang语言 yum –y updateyum install golanggit clone https://github.com/ethereum/go-ethereum.git  cd go-ethereum  make allcd go-ethereummake all 这里出现了编译错误,提示go的版本1.8.3,编译需要最少1.9。前往https://www.golangtc.com/download goland中国下载go1.10.1.linux-amd64.tar.gz,再次安装前需要卸载原有的golang,yum –y remove golang tar -C /usr/local -xzf go1.10.1.linux-amd64.tar.gzexport PATH=$PATH:/usr/local/go/bin 重复make,在go-ethereum/build/bin使用ll命令,会罗列文件夹内的在go-ethereum/build/bin目录下创建init.json的文本文件,内容如下: {  “config”: {        “chainId”: 14,        “homesteadBlock”: 0,        “eip155Block”: 0,        “eip158Block”: 0    },  “alloc”      : {},  “coinbase”   : “0x0000000000000000000000000000000000000000”,  “difficulty” : “0x05000”,  “extraData”  : “”,  “gasLimit”   : “0x2fefd8”,  “nonce”      : “0x0000000000000042”,  “mixhash”    : “0x0000000000000000000000000000000000000000000000000000000000000000”,  “parentHash” : “0x0000000000000000000000000000000000000000000000000000000000000000”,  • Read More »


以太坊星火节点 CentOS 接入

转自:https://ethfans.org/wikis/%E6%98%9F%E7%81%AB%E8%8A%82%E7%82%B9%E8%AE%A1%E5%88%92-CentOS-%E6%8E%A5%E5%85%A5%E6%96%87%E6%A1%A3 https://ethfans.org/wikis/%E6%98%9F%E7%81%AB%E8%8A%82%E7%82%B9%E8%AE%A1%E5%88%92-Ubuntu-%E6%8E%A5%E5%85%A5%E6%96%87%E6%A1%A3   CentOS 的安装和部署流程跟 Ubuntu 的主要区别只有四点,其他部分均可以直接参考 Ubuntu 接入文档,所以这里只对这四点作出解释。 创建 deploy 用户 安装系统依赖库 安装 geth 安装 NodeJS 创建 deploy 用户 # 首次以 root 用户登陆后,先安装 sudo yum -y install sudo   # 创建 deploy 用户 adduser deploy   # 设置 deploy 用户密码 passwd deploy   # 给 deploy 用户添加 sudo 权限 echo “deploy    ALL=(ALL) ALL” >> • Read More »


Mining Monero On Centos

建站的时候租用了一台服务器,centos的操作系统。上面只放了两个网站, CPU使用率基本为零,偶尔操作的时候也只有40%,闲置是极大的浪费。资料说门罗币(monero)可以用cpu挖,那我也挖门罗币吧。 首先要有钱包地址,本地钱包或者在线钱包,我选择了后者,所以前者就不多说了。在线平台有很多,网友说这家还不错https://mymonero.com/,https://hitbtc.com/,注册账号之后在account里找到钱包地址,下面会用到。 接下来要在服务器上安装挖矿工具,以下命令复制粘贴。安装运行需要的程序后,从fireice-uk获取源码并编译安装,此处可以修改捐赠比例,默认是2%。 sudo yum -y install centos-release-scl epel-release sudo yum -y install cmake3 devtoolset-7-gcc* hwloc-devel libmicrohttpd-devel openssl-devel make sudo scl enable devtoolset-7 bash git clone https://github.com/fireice-uk/xmr-stak.git mkdir xmr-stak/build cd xmr-stak/build cmake3 -DCMAKE_LINK_STATIC=ON -DXMR-STAK_COMPILE=generic -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF .. make install 然而总是在42%时出错,在网上找到了这个办法。清除后重新编译。 mkdir xmr-stak/build cd xmr-stak/build export CFLAGS=”-O2 -march=native -msse3 -fomit-frame-pointer -pipe” export CHOST=”x86_64-pc-linux-gnu” export CXXFLAGS=”${CFLAGS}” • Read More »


Multi-sites and 404 of Permalinks issue

Initially, I was going to write something about using Modelica for simulations of HVAC systems. But I have been assigned to other tasks. So, I just share some experience about connecting one IP with multi-domains here. My server has been running a website already when the server is set for running multi-sites, the original files • Read More »


SetUpDesktopOnSever

SetUpDesktopOnSever Recently, I tried to download recovery image for my Surface Pro 3 from the official website.  The established downloading link lost connection after a few minutes and the download speed was within 10 kb/s. Since the server rent from Aliyun is overseas, I considered to download it from the server. There are two options • Read More »


UsingModelicaBuildingLibrary

Modelica is a non-proprietary, object-oriented, equation-based language to conveniently model complex physical systems containing, e.g., mechanical, electrical, electronic, hydraulic, thermal, control, electric power or process-oriented subcomponents.


Improved IDF2JSON

The last version eliminated all comments because they are not needed in the JSON format. But the comments can be used as properties. So, I did some modifications. Since I am not familiar with Fortran. All the work is done with Python by replacing characters to change the structure. The results are shown below:   • Read More »


IDFtoJSON

EnergyPlus is developed based on Fortran 950. The file format looks very like JavaScript Object Notation (JSON). By extracting the comments as properties, it can be transformed to JSON format. I did some modifications to EnergyPlus IDF file and transformed it to JSON format with Python. The JSON file was validated by https://www.bejson.com/ . Then, • Read More »


ErrConnectingDatabase

After upgrading to Version 4.9. I got an error of Error establishing a database connection. The possible cause of ‘Error establishing a database connection’ is the problems in MySQL, check the username and password in wp-config.php. But the causes may vary. Firstly, open ‘wp-config.php’ and set ‘define(‘WP_DEBUG’, ‘true’)’; Then, go to the website to see • Read More »