npm指定目录

使用—prefix npm start –prefix /path/to/project 参考: https://stackoverflow.com/questions/36172442/how-to-npm-start-at-a-different-directory……

阅读全文

parallelshell同时运行多个命令

安装和使用 npm i -g parallelshell # 使用 parallelshell "cmd1" "cmd2" "cmd3" 与cmd1 & cmd2 &cmd3的区别: parallelshell会结束所有的进程如果其中一个进程终止 来源: https://www.npmjs.com/package/parallelshell https://github.com/darkguy2008/parallelshell……

阅读全文

linux显示中文

查看字符编码 locale 修改字符编码 dpkg-reconfigure locales Debian and Ubuntu /etc/default/locale ssh输入中文 修改 /etc/default/locale LANG=C.UTF-8 LANGUAGE= LC_CTYPE=C.UTF-8 LC_NUMERIC="C.UTF-8" LC_TIME="C.UTF-8" LC_COLLATE="C.UTF-8" LC_MONETARY="C.UTF-8" LC_MESSAGES="C.UTF-8" LC_PAPER="C.UTF-8" LC_NAME="C.UTF-8" LC_ADDRESS="C.UTF-8" LC_TELEPHONE="C.UTF-8" LC_MEASUREMENT="C.UTF-8" LC_IDENTIFICATION="C.UTF-8" LC_ALL= 本地访问远程终端,本地的locale和远程的locale中的变量相同可以避免乱码 ……

阅读全文

jupyter使用xgboost服务挂掉

发生错误 OMP: Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized. 1 import os os.environ['KMP_DUPLICATE_LIB_OK']='True' 2 安装nomkl conda install nomkl 参考https://github.com/dmlc/xgboost/issues/1715……

阅读全文

使用postgresql

sudo apt-get install postgresql netstat -ap | grep 5432 切换用户并登录 sudo su postgres psql postgres 创建用户 CREATE USER username WITH PASSWORD 'password'; 创建数据库 和 赋权 \c databasename #切换数据库 CREATE DATABASE databasename OWNER username; GRANT ALL PRIVILEGES ON DATABASE databasename TO username; GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO username; 退出 \q 登录 psql -U username -d databasename -h 127.0.0.1 -p 5432 设置远程访问 postgresql.……

阅读全文

使用git

git --version #查看版本 生成密钥 ssh-keygen -t rsa -f ~/.ssh/id_rsa_github -C "[email protected]" #生成文件 ls ~/.ssh/ id_rsa_github id_rsa_github.pub known_hosts 添加公钥到github id_rsa_github.pub内容复制到github上 #测试 ssh -i ~/.ssh/id_rsa_github -T [email protected] .com ssh -T [email protected] #会报错,需要配置config 新建config Host github.com HostName github.com User git IdentityFile ~/.ssh/id_rsa_github 测试 ssh -T [email protected] 单独到项目文件夹设置用户名邮箱 git config user.email “[email protected]” git config user.name “username” 常用命令 git add . git commit -m "message" git push git status git diff git config --local --list 回滚 git revert ID……

阅读全文

nestjs相关

nestjs nodemon 新建 nest new nesttest src/ ├── app.controller.spec.ts ├── app.controller.ts ├── app.module.ts ├── app.service.ts └── main.ts 运行 npm run start main.ts中 app.listen({{port}) 端口号 默认3000 访问localhost:3000 生成控制器 nest generate controller cats https://docs.nestjs.com/controllers 返回的时候使用的引号` ,使用’ 不能显示变量 生成服务 nest generate service cats //cats.service.ts @Injectable() export class CatsService { private readonly cats: Cat[] = []; create(cat: Cat){ this.cats.push(cat) } findAll(): Cat[] { return this.cats; } } //cats.controller.ts @Controller('cats') export class CatsController { constructor(private readonly catsService: CatsService) {} @Get() async findAll(): Promise<Cat[]> { return this.……

阅读全文

使用ibmcloud

创建资源 安装使用 IBM Cloud CLI https://console.bluemix.net/docs/cli/index.html#overview ibmcloud api https://api.ng.bluemix.net ibmcloud login -u [email protected] -o [email protected] -s dev //上传 bluemix app push pythondjangotest 创建项目 django-admin startproject mysite cd mysite //上传程序要在这个目录执行上传命令 python3 manage.py startapp helloworld 解决依赖 pip3 freeze > requirements.txt chardet==2.3.0 Django==2.1.7 gunicorn==19.9.0 httplib2==0.9.2 pycurl==7.43.0 pytz==2018.9 reportbug==7.1.7 requests==2.12.4 six==1.10.0 urllib3==1.19.1 uWSGI==2.0.18 在目录下新建runtime.txt,并添加python版本 例如: python-3.6.4 遇到错误 bluemix cf set-env pythondjangotest DISABLE_COLLECTSTATIC 1 bluemix cf restage pythondjangotest Procfile文件 web: gunicorn mysite.……

阅读全文

angular相关

https://angular.io 安装 npm install -g @angular/cli 新建项目 ng new my-app https://angular.io/guide/entry-components The entryComponents array Though these two mechanisms account for most entry components, if your app happens to bootstrap or dynamically load a component by type imperatively, you must add it to entryComponents explicitly. 传递变量到dialog https://material.angular.io/components/dialog/overview ngClass用法 https://angular.io/api/common/NgClass 下拉列表默认值 https://stackblitz.com/edit/how-to-set-default-value-of-mat-select-when-options-are-retriev?file=app%2Ftable-basic-example.html……

阅读全文