VPS CPU挖矿 LTC

任何Linux通用

 

install build-essential libcurl4-openssl-dev

install gcc make curl-devel

 

git clone https://github.com/pooler/cpuminer
cd cpuminer
./configure CFLAGS=”-O3″
make

make install

——– cpulimit

 

git clone https://github.com/opsengine/cpulimit
cd cpulimit

make
cp src/cpulimit /usr/bin

—- 脚本

 

 

vi k.sh

cpulimit -l 50 minerd –url=stratum+tcp://us.litecoinpool.org:3333 –userpass=cn3588.1:1 -t 1
~

 

注意尽量设置在-l 50-80之间,要不然vps供应商会察觉。我所有的无用VPS都设置在50,正常VPS设置在40,小流量网站的设置在20,企业网站VPS设置在10.

-t 1 , 根据CPU的个数来设定

 

 

vestacp + php7 + php5.6 (Centos)

curl -O http://vestacp.com/pub/vst-install.sh

Additional Repository 选 remi

 

—php7

 

php -v

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
如果提示有一个RPM已经安装, 需要 yum remove epel-release-7-5.noarch*
yum –enablerepo=remi update remi-release
service httpd stop
yum -y remove php
yum --enablerepo=remi-php70 install php70-php php70-php-pear php70-php-bcmath php70-php-pecl-jsond-devel php70-php-mysqlnd php70-php-gd php70-php-common php70-php-fpm php70-php-intl php70-php-cli php70-php php70-php-xml php70-php-opcache php70-php-pecl-apcu php70-php-pecl-jsond php70-php-pdo php70-php-gmp php70-php-process php70-php-pecl-imagick php70-php-devel php70-php-mbstring
service php-fpm stop
service php70-php-fpm start
rm/usr/bin/php
ln-s /usr/bin/php70/usr/bin/php
service httpd restart
php -v
-php 5.6 (建议)
service httpd stop
yum -y remove php
#For 32 Bit OS
wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
#For 64Bit OS
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
vi /etc/yum.repos.d/remi.repo
remi => 1
php56 => 1
yum -y install php php-bcmath php-cli php-common php-gd php-imap php-mbstring php-mcrypt php-mysql php-pdo php-soap php-tidy php-xml php-xmlrpc php-pecl-apc phpMyAdmin roundcubemail php-opcache php-xdebug
service httpd start

Dropbox 备份 小型网站(使用sqlite数据库)

wget https://raw.github.com/andreafabrizi/DropboxUploader/master/dropbox_uploader.sh

chmod +x dropbox_uploader.sh

./dropbox_uploader.sh info

 

vi backup.sh

#!/bin/bash
SCRIPT_DIR=”/root”
DROPBOX_DIR=”/ovh_zq_1″
BACKUP_SRC=”/var/www”
BACKUP_DST=”/tmp”

NOW=$(date +”%Y.%m.%d”)
DATEM=$(date +”%Y_%m”)
DESTFILE=”$BACKUP_DST/$NOW.tar.gz”

tar cfz “$DESTFILE” $BACKUP_SRC

$SCRIPT_DIR/dropbox_uploader.sh upload “$DESTFILE” “$DROPBOX_DIR/$DATEM/$NOW.tar.gz”

rm -f “$DESTFILE”

 

cron来做定时任务

crontab e

0 5 * * * /bin/bash /root/backup.sh

/etc/rc.d/init.d/crond restart

Debian 安装 VNC 和 XFCE

apt-get install xfce4 xfce4-goodies gnome-icon-theme tightvncserver iceweasel

adduser vnc

apt-get install sudo

gpasswd -a vnc sudo

su – vnc

 

 

运行

vncserver

停止

vncserver -kill :1

 

 

—黑屏处理

vi /root/.vnc/xstartup
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &

Centos 7 安装 VNC 和 GNOME 桌面 或 xfce

yum groupinstall “GNOME Desktop”

yum install tigervnc-server

cp /lib/systemd/system/[email protected] /etc/systemd/system/[email protected]:1.service

vi /etc/systemd/system/[email protected]:1.service

 

更改

 

#ExecStart=/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
#PIDFile=/home/<USER>/.vnc/%H%i.pid
ExecStart=/sbin/runuser -l root-c "/usr/bin/vncserver %i"
PIDFile=/home/root/.vnc/%H%i.pid

如果有防火墙

firewall-cmd --permanent --zone=public --add-service vnc-server
firewall-cmd --reload


启动vnc
vncserver

启动运行
systemctl daemon-reload
systemctl enable [email protected]:1.service
reboot
systemctl start [email protected]:1.service


xfce

yum -y install epel-release
yum -y group install "Xfce"
yum -y group install "X Window System"

—黑屏处理

vi /root/.vnc/xstartup
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &

 

 

vncserver -kill :1

vncserver

 

 

CentOS5 6 7 安装 VirtualBox

vim /etc/yum.repos.d/virtualbox.repo

 

 

[virtualbox]
name=Oracle Linux / RHEL / CentOS-$releasever / $basearch – VirtualBox
baseurl=http://download.virtualbox.org/virtualbox/rpm/el/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc

 

 

CentOS/RHEL 7, 64 Bit (x86_64):
# rpm -Uvh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

CentOS/RHEL 6, 32 Bit (i386):
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

CentOS/RHEL 6, 64 Bit (x86_64):
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

CentOS/RHEL 5, 32 Bit (i386):
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

CentOS/RHEL 5, 64 Bit (x86_64):
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

# yum install gcc make patch dkms qt libgomp -y
# yum install kernel-headers kernel-devel fontforge binutils glibc-headers glibc-devel -y

export KERN_DIR=/usr/src/kernels/2.6.32-504.3.3.el6.x86_64

yum install VirtualBox-5*
service vboxdrv setup

CentOS5 安装 XFCE VNC 和 浏览器

yum groupinstall xfce-4.4

yum install vnc vnc-server

 

vi /etc/sysconfig/vncservers

添加

VNCSERVERS=”1:root”
VNCSERVERARGS[1]=”-geometry 1024×768″

vncserver

配置环境

vi /root/.vnc/xstartup

替换

#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
#xterm -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop”&
#twm &
startxfce4 &

开机启动
chmod +x ~/.vnc/xstartup
service vncserver restart
chkconfig vncserver on

到这里 VNC 已经可用

yum -y install firefox
yum -y install fonts-chinese

CentOS yum安装chrome

 

vim /etc/yum.repos.d/CentOS-Base.repo

 

[google]
name=Google - i386
baseurl=http://dl.google.com/linux/rpm/stable/i386
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub


[google64]
name=Google - x86_64
baseurl=http://dl.google.com/linux/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub


安装稳定版本: yum install google-chrome-stable
安装测试版本:yum install google-chrome-beta
安装不稳定版本:yum install google-chrome-beta

出现库问题
yum install libstdc++-4.4.7-3.el6.i686



方式二
cd /etc/yum.repos.d/
wgethttp://people.centos.org/hughesjr/chromium/6/chromium-el6.repo
yum install chromium
# 安装后位于 /opt/chromium-browser
root运行, 创建快捷方式
后面 加 %U -user-data-dir

Centos6 安装 Xfce (桌面化)

In 64 bit CentOS (x86_64)

# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

In 32 bit CentOS (i386)

# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm


# yum groupinstall Xfce


如果有字体乱码问题.
# yum groupinstall Fonts
# yum install xorg-x11-fonts-Type1 xorg-x11-fonts-misc


运行Xfce
startxfce4