testing from new comer
scottwei007 / hello-world Goto Github PK
View Code? Open in Web Editor NEWnew comer
new comer
安装Python:
安装pip:
Requests模块安装:
mysqldb模块安装:
Beautiful Soup 安装
6,重启:systemctl stop v2ray ; systemctl start v2ray
hadoop安装:
按装ssh(如果没有安装过的话,Hadoop分布式用到。用root权限不会有坑):sudo apt-get install ssh 或者 sudo apt-get installopenssh-client。启动它:sudo/etc/init.d/ssh start
配置SSH免登陆。/home目录生成秘钥:ssh-keygen -t rsa,并且将id_rsa.pub追加到authorized_keys文件中。赋权限(不能777,坑点)chmod 700 ~/.ssh ,chmod 600 ~/.ssh/authorized_keys。用ssh localhost测试。
下载与解压hadoop(hadoop的搭建都依赖于jdk,所以需要先安装jdk),下载:wget http://mirror.bit.edu.cn/apache/hadoop/common/stable/hadoop-2.7.3.tar.gz,解压:tar -xvf hadoop-2.7.3.tar.gz
设置配置:core-site.xml:
fs.defaultFS
hdfs://localhost:9000
格式化: $ bin/hdfs namenode -format
启动hadoop:sbin/start-dfs.sh
启动yarn:$ sbin/start-yarn.sh
hive安装:
ssr:
以下命令均以root用户执行,或sudo方式执行
centos:
yum install git
ubuntu/debian:
apt-get install git
获取源代码
git clone -b manyuser https://github.com/shadowsocksr-backup/shadowsocksr.git
进入根目录初始化配置(假设根目录在~/shadowsocksr,如果不是,命令需要适当调整):
cd ~/shadowsocksr
bash initcfg.sh
以下步骤要进入子目录:
cd ~/shadowsocksr/shadowsocks
快速运行####
python server.py -p 443 -k password -m aes-256-cfb -O auth_sha1_v4 -o http_simple
#说明:-p 端口 -k 密码 -m 加密方式 -O 协议插件 -o 混淆插件
如果要后台运行:
python server.py -p 443 -k password -m aes-256-cfb -O auth_sha1_v4 -o http_simple -d start
如果要停止/重启:
python server.py -d stop/restart
下载客户端:
https://github.com/shadowsocksrr/shadowsocksr-csharp/releases
https://github.com/shadowsocksrr/shadowsocksr-android/releases
创建github pages: 创建一个仓库,lilwei.github.io
安装Hexo: 前提安装git,安装node.js, 使用Git Bash命令行 : npm install -g hexo-cli
建站:
hexo init hexo(自定义文件名)
cd hexo
npm install
关联hexo和github pages,编辑_config.yml文件(注意格式):
deploy:
type: git
repo: https://github.com/lilwei/lilwei.github.io.git
branch: master
本地测试: hexo s
访问:localhost:4000
发布到github(清除,生成,发布):
hexo clean
hexo g
npm install hexo-deployer-git --save
hexo d
写文章时,可视化,安装hey插件: npm install hexo-hey --save
修改_config.yml配置文件(注意格式):
admin:
name: hexo
password: hey
secret: hey hexo
expire: 60*1
# cors: http://localhost:3000
在浏览器输入服务器ip:80访问到“Welcome to nginx!”欢迎界面表示ok。
重启:nginx -s reload
1
注意:不能使用root角色启动elasticsearch
下载: sudo wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.1.tar.gz
比较 SHA: sudo sha1sum elasticsearch-5.4.1.tar.gz
解压: sudo tar -xzf elasticsearch-5.4.1.tar.gz
进入目录: cd elasticsearch-5.4.1
给目录权限: sudo chown q2872869434 /usr/elasticsearch/elasticsearch-5.4.1 -R
修改java内存(elasticsearch默认2g): sudo vi elasticsearch-5.4.1/config/jvm.options
设置软连接(elasticsearch找不到java): sudo ln -s /usr/java/jdk1.8.0_131/bin/java /usr/bin/java
运行(不能用root角色)后端进程: ./bin/elasticsearch -d -p pid
测试,有json字符串说明ok : curl 'http://localhost:9200/?pretty'
关闭: kill cat pid
外部连接 添加elasticsearch.yml中的: network.bind_host:0.0.0.0
12.. nofile大小不够添加 /etc/security/limits.conf中的: q2872869434- nofile 65536
https://gryzli.info/2018/03/30/elasticsearch-installation-how-to/
安装Git: sudo yum install git
创建一个git用户: sudo adduser git
创建目录和存储,加git用户权限: sudo git init --bare project.git
chown -R git:git project.git
创建证书登录,收集所有需要登录的用户的公钥,就是他们自己的id_rsa.pub文件,把所有公钥导入到/home/git/.ssh/authorized_keys文件里(没有就创建),一行一个。可以用ssh-keygen -t rsa命令生成公匙和秘匙。 复制文件到文件 more .ssh/id_rsa.pub >/home/git/.ssh/authorized_keys
另一台电脑登陆的时候,需要生成自己的公匙和秘匙,并把公匙放到服务器的/home/git/.ssh/authorized_keys文件就行。
克隆仓库,测试: git clone [email protected] :/srv/project.git
禁用 gituser用户通过shell登录,编辑/etc/passwd文件:
git ❌503:503::/home/git:/bin/bash
改为:
git ❌503:503::/home/git:/usr/bin/git-shell
git命令: git init --bare project.git
git add;
git commit -m 'test';
git status; git log;
git remote add origin [email protected]:/srv/project.git
git remote -v ; git remote rm origin;
git fetch origin; git pull origin(git clone的目录);
git push origin master;
git diff master origin/master
1, 安装svn : yum install subversion
2. 新建一个目录用于存储SVN所有文件: mkdir /svn
3, 新建一个资源仓库: svnadmin create /svn/repo
4, 查看生成的文件: ls /svn/repo
5, 配置svn服务的配置文件svnserver.conf文件:
[general]
anon-access = none
auth-access = write
password-db = /svn/project/conf/passwd
authz-db = /svn/project/conf/authz
realm = My Test Repository #这是个提示信息
6, passwd文件添加两个访问用户及口令:
[users]
xiaoran.shen = 123456
test1 = 123456
test2 = 123456
7, 配置新用户的授权文件authz:
[groups]
admin = xiaoran.shen,test1
user = test2
[/]
@admin = rw
@user = r
8, 启动svn服务,默认端口3690: svnserve -d -r /svn/repo/
9, 杀死svn服务:
ps -ef|grep svn
kill -9 xxxxid
10, 客户端连接: svn co svn://35.187.151.129
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON="/home/scott/red5/red5-server/red5.sh"
NAME="Red5"
RED5_HOME=/home/scott/red5-server
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
DESC="Red5 Server"
. /lib/lsb/init-functions
set -e
PROCESS_DIR="/usr/local/bin/red5-1.0"
log_daemon_msg () {
# Dummy function to be replaced by LSB library.
echo $@
}
log_progress_msg() {
echo $@
}
log_end_msg () {
# Dummy function to be replaced by LSB library.
if test "$1" != "0"; then
echo "Error with $DESCRIPTION: $NAME"
fi
return $1
}
case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start --pidfile $PIDFILE
--chdir $RED5_HOME --background --make-pidfile
--exec $DAEMON
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
start-stop-daemon --stop --quiet --pidfile $PIDFILE
--name java
rm -f $PIDFILE
log_end_msg $?
;;
restart|force-reload)
echo -n "Restarting $DESC: $NAME"
start-stop-daemon --stop --quiet --pidfile $PIDFILE
--name java
rm -f $PIDFILE
sleep 1
echo -e
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
###############
4. 解决start-stop-daemon报错:yum -y install lsb
wget http://ftp.de.debian.org/debian/pool/main/d/dpkg/dpkg_1.17.25.tar.xz
tar -xf dpkg_1.17.25.tar.xz
cd dpkg-1.17.25
./configure >/dev/null
make >/dev/null
cd utils
make
sudo cp start-stop-daemon /usr/local/bin/start-stop-daemon
5. 授权该文件chmod 777 red5,并运行:/etc/init.d/red5 start
安装安装git:yum install git
克隆:git clone git://git.ffmpeg.org/rtmpdump
8.下载Patch.diff文件,http://pastebin.com/raw.php?i=6cC9BSTc或者https://github.com/downloads/K-S-V/Scripts/rtmpdump-2.4.zip
复制它到rtmpdump目录下,授权,并 patch -p0 -i Patch.diff
编译:make
make install prefix=/usr
解决ffmpeg: error while loading shared libraries: librtmp.so.1:报错:
在/etc/ld.so.conf文件加上:/usr/local/lib/ 保存刷新:: sudo ldconfig
测试rtmpdump --help
下载安装解压ffmpeg:wget http://johnvansickle.com/ffmpeg/releases/ffmpeg-1.2.3-64bit-static.tar.bz2
授权,运行/ffmpeg --help
测试命令: rtmpdump -r "rtmpe_stream" -a "live" -f "WIN 11,9,900,117" -W "swf_player" -p "home_page" -y "playpath" --live | ffmpeg -re -i - -sn -vcodec copy -acodec copy -f flv "rtmp://127.0.0.1:1935/live/jsx2"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.