「 LINUX 」 August 19, 2018
更改Linux登录的shell
Words count 258 Reading time 1 mins.
- 查看linux一共有哪些shell
chsh -l
- 查看当前用户执行的shell
echo $ SHELL //SHELL一定要大写
- 修改当前用户的shell为bin/sh
chsh -s /bin/sh
Read article
「 LINUX 」 August 19, 2018
Words count 258 Reading time 1 mins.
chsh -l
echo $ SHELL //SHELL一定要大写
chsh ...
Read article
「 LINUX 」 August 19, 2018
Words count 258 Reading time 1 mins.
chsh -l
echo $ SHELL //SHELL一定要大写
chsh -s /bin/sh
Read article
「 JAVA 」 August 19, 2018
Words count 481 Reading time 1 mins.
「 项目开发记录 」 August 19, 2018
Words count 2.3k Reading time 2 mins.
前言:目前实现汉化的方案很笨拙,需要对源码里的模板文件,以及js里用的显示数据进行一一汉化。所以在这里记录一下汉化以及编译安装的过程。
go语言环境
node环境
git
利用yum安装go
yum install go
yum会自动处理go需要的环境依赖
wget https://nodejs.org/dist/v8.5.0/node-v8.5.0-linux-x64.tar.gz
3.解压
tar zxvf node...
「 项目开发记录 」 August 19, 2018
Words count 897 Reading time 1 mins.
yum insatll go
export GOPATH=`pwd`
cd $GOPATH/src/github.com/prometheus
git clone https://github.com/prometheus/prometheus.git
cd prometheus
make assets
make build
复制prometheus.yml到目录下,然后运行
./prometheus
promethus的前端页面在/root/src/github.com/prometheus...
Read article「 HADOOP 」 August 19, 2018
Words count 14k Reading time 13 mins.
序号 | IP地址 | 主机名 | 类型 | 用户名 |
---|---|---|---|---|
1 | 192.168.162.177 | Master.Hadoop | NameNode | root |
2 | 192.168.162.155 | Slave1.Hadoop | DataNode | root |
3 | 192.168.162.166 | Slave2.Hadoop | DataNode | root |
vim /etc/hostname
按照一定的格式修改三台机器的主机名。
vim /etc/hosts...
Read article
「 MYSQL 」 August 19, 2018
Words count 78 Reading time 1 mins.
ALTER TABLE tableName CONVERT TO CHARACTER SET utf8;
Read article
「 PYTHON 」 August 19, 2018
Words count 4.9k Reading time 4 mins.
以Student这个model为例
In [59]: Student._meta.fields
Out[59]:
(<django.db.models.fields.AutoField: id>,
<django.db.models.fields.CharField: stu_name>,
<django.db.models.fields.CharField: stu_no>,
<django.db.models.fields.CharField: stu_sex...
Read article
「 PYTHON 」 August 19, 2018
Words count 1.3k Reading time 1 mins.
之前配置url是直接修改url.py如下图:
from django.conf.urls import url
from django.contrib import admin
import blog.views as bv
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^index/', bv.index)
]
这样是可行的,但是如果我们的网站过于庞大,会有好多应用,而且url也很多。这时候,我...
Read article「 PYTHON 」 August 19, 2018
Words count 191 Reading time 1 mins.
启动runserver时需要在命令行后添加 地址和端口号,如下:
python manage.py runserver 0.0.0.0:8000
修改settings文件,允许访问的主机参数:
ALLOWED_HOSTS = ['*']
Read article
「 PYTHON 」 August 19, 2018
Words count 7.3k Reading time 7 mins.
models.py
class Student(models.Model):
stu_name = models.CharField(max_length=30)
stu_no = models.CharField(max_length=20)
stu_sex = models.CharField(max_length=10)
stu_age = models.IntegerField()
stu_birth = models.DateTimeField(auto_now_add=True)
def...
Read article