Q&A in 2018 - Q1
Those questions
Simply write down questions that ever frustrated me a little:
- How to convert unix timestamp to standard format in SQL?
- How to convert unix timestamp to standard format in R?
- How to download files from the remote server to local desktop?
- How to quit vim?
- How to edit config in vim to install java as a root?
- How to install Neo4j on Linux?
- How to switch between root and super in Linux?
- What is the common command for tmux?
- How to download file via url from the remote server?
- What is the common command for neo4j?
- How to install pip in cmd?
- Git: bash: cd: too many arguments?
- How to export one large table from hive to personal file on remote server?
- How to set the system variable?
- How to check and edit in shell?
- How to schedule a task in shell?
- How to install postgresql in shell?
- How to run R script and .py from command line?
- How to suppress the message from command line?
- How to git push initially?
- Why messy code in the output under shell exvirenment?
- Why output '/usr/bin/env "python\r"' error in Linux?
- How to check MD5 for one .model file?
Answers
FROM_UNIXTIME(log_timestamp/1000,'%Y-%m-%d %H:%i:%S')
as.POSIXct(1522789634, origin="1970-01-01 00:00:00")
[1] "2018-04-04 05:07:14 CST"
scp root@139.224.15.11:/home/super/weifan/behaviour/script_001_behavioral/out/* Downloads
scp -r root@139.224.15.11:/home/super/weifan/behaviour/script_001_behavioral/out/ Downloads/
scp C:/Users/lenovo/Documents/master/Innotechx/doc/graphdb.sh daiweifan@39.106.135.84:/home/super/weifanD
sz *.jpg
save and quit: ESC -> ':' -> 'wq'; not save and quit: ESC -> ':' -> 'q!'; unchange angthing and quitL ESC -> ':' -> '!'
sudo su -
cd /usr
mkdir java
cp /home/super/software/jdk-8u161-linux-x64.tar.gz /usr/java/
tar -zxvf jdk-8u161-linux-x64.tar.gz
ln -s /usr/java/jdk1.8.0_161/ /usr/jdk
vim /etc/profile
JAVA_HOME=/usr/jdk
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export PATH
export CLASSPATH
source /etc/profile
sudo update-alternatives --install /usr/bin/java java /usr/java/jdk1.8.0_161/bin/java 50
sudo update-alternatives --install /usr/bin/javac javac /usr/java/jdk1.8.0_161/bin/javac 50
sudo update-alternatives --config java
tar -xf <filename>
cd $NEO4J_HOME
sudo bash
sudo su -
exit
sudo apt-get install tmux//install tmux
tmux ls//查看现有会话
tmux attach -t 0//进入当前会话
Ctrl+B D//退出
wget https://hue.qutoutiao.net/filebrowser/download=/user/ac/node_member/000008_0
cd /path/to/neo4j
bin/neo4j start
bin/neo4j-shell
du -hc /SN.db/*store.db*
- download python package
- check pip.exe under \Scripts directory
- add path for pyhton and \Scripts file
- enter pip in cmd
- if there is error 'failed to create process', enter python.exe -m pip
replace the blank with ' '
sudo su -
beeline -u 'jdbc:hive2://172.16.53.159:10000' -n ac -p ac123 --outputformat=csv2 --incremental=true -e "set mapreduce.job.queuename=root.develop.adhoc.ac;select a.member_id,a.device_code,a.teacher_id from (
select teacher_id, member_id,device_code from gobblin.qukan_p_member_info
where day='2018-04-20'
) a
left join (
select id,status from gobblin.qukan_p_member
where day='2018-04-20'
and status=1
) b
on a.teacher_id=b.id
order by a.member_id" > member_info.csv;
path: C:\Users\lenovo\software\python34
C:\Users\lenovo\software\python34\Scripts
# check the size of file
- ls -lh test1.sh
- cat test1.sh |wc -l
- head test1.sh
- cat member-city0424.csv | sed 1d |cut -d ',' -f 2,3|sort|uniq > city.csv
- df -h
- ssh root@139.224.15.11
- ps -ef |grep neo4j
- grep -Ev '^null|^Null|NULL' locate.csv > locate2.csv
- kill -9 ***
- find / -name '*.py'
- [root@arch 12002]# cd /var/lib/postgres/data/base/12002
[root@arch 12002]# du -sh
- grep -E '(100_1000|bigger_1000)' 20160220 | head
crontab -e
0 0 * * * * sh /your/path/to/***.sh > /your/path/to/**log.sh
yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm
yum install postgresql10
yum install postgresql10-server
/usr/pgsql-10/bin/postgresql-10-setup initdb
systemctl enable postgresql-10
systemctl start postgresql-10
vim /var/lib/pgsql/10/data/**.conf
service postgresql-10 restart
psql -U postgres
# connect to database mimic
$ psql -d mimic
# set default schema to mimiciii
mimic=# SET search_path TO mimiciii;
# chack and unstall the software
$ rpm -qa | grep pgdg-centos10
$ yum -y remove postgresql10-libs-10.4-1PGDG.f25.x86_64
# run
Rscript test.r C:\Users\lenovo\Desktop\1.csv C:\Users\lenovo\Desktop\img
python similarity.py input_case/ output/
# install package
sudo su - -c\ "R -e \"install.packages('dplyr',repos='https://cran.rstudio.com/')\""
install.packages('',repos='https://cran.rstudio.com/')
pip install
# arguments
# R
#! /path/to/Rscript --vanilla --default-packages=utils
args <- commandArgs(TRUE)
args[1]
args[2]
# python
sys.argv[0]
suppressWarnings(suppressMessages(suppressPackageStartupMessages({})
git config --global user.name "戴微帆"
git config --global user.email "daiweifan@bigbaser.com"
scp root@224.139.15.11:/home/super/weifan/behaviour/ .
scp root@224.139.15.11:/opt/rwork/scripts/ .
scp root@139.224.15.11:/opt/rwork/scripts/ .
scp root@139.224.15.11:/opt/rwork/scripts/script_002_similarity .
scp root@139.224.15.11:/opt/rwork/scripts/script_002_similarity/ .
scp -r root@139.224.15.11:/opt/rwork/scripts/ .
cd scripts
ll
git init
git add --all
git commit -m 'Initial commit'
git remote add origin http://daiweifan@git.innotechx.com/scm/an/ac-data-job.git
git push -u origin master
git add --all
git commit -m 'Initial commit'
git remote add origin http://daiweifan@git.innotechx.com/scm/an/ac-data-job.git
git push -u origin master
1、C:\Windows\Fonts下找到字体文件simsun.ttc,重命名为simsun.ttf;
2、上传到主机/usr/share/fonts/zh_CN/
3、修改文件权限755
4、mkfontscale (如果提示 mkfontscale: command not found,需自行安装 # yum install mkfontscale )
5、mkfontdir
6、fc-cache -fv (如果提示 fc-cache: command not found,则需要安装# yum install fontconfig )
或 fc-cache /usr/share/fonts/zh_CN/
7、reboot系统(生产环境,未做此操作,执行完fc-cache /usr/share/fonts/zh_CN/后fc-list验证新字体已存在,应用乱码问题经验证也已解决,说明reboot不是必须。)
验证字体:
fc-list|grep 宋
fc-list :lang=zh-cn | sort
https://blog.csdn.net/qq_40809549/article/details/80523849
用 ./ 运行python 脚本文件出现 报错信息 /usr/bin/env "python\r" 找不到那个文件或目录
错误原因:这主要是因为\r这个字符的缘故。在linux终端下,输出\r会什么都不显示,只是把光标移到行首。于是终端虽然输出了/usr/bin/env: python,但是碰到\r后,光标会被移到行首,接着输出了:No such file or directory把前面的覆盖掉了。于是出现了那个莫名其妙的出错信息了
解决办法:
用vim打开sh脚本文件 vim file_name.py 打开后输入
:set ff 然后回车 再重新设置下文件格式:
:set ff=unix 然后保存退出
:wq! 回车
linux: md5sum model.***
Win10: certutil -hashfile model.*** MD5
Q&A in 2018 - Q1的更多相关文章
- Q&A in 2018 - Q2
How to zip a file for Windows? 压缩一个文件: makecab c:/file_name.txt c:/file_name.zip 解压一个文件: expand c:/f ...
- Django中数据查询(万能下换线,聚合,F,Q)
数据查询中万能的下划线基本用法: __contains: 包含 __icontains: 包含(忽略大小写) __startswith: 以什么开头 __istartswith: 以什么开头(忽略大小 ...
- 聚合查询、分组查询、F&Q查询
一.聚合查询和分组查询 1.aggregate(*args, **kwargs): 通过对QuerySet进行计算,返回一个聚合值的字典.aggregate()中每个参数都指定一个包含在字典中的返回值 ...
- (CCPC-Final 2018)K - Mr. Panda and Kakin
题意:x是\([1e5,1e9]\)的随机数,p是小于x的最大素数,q是大于等于x的最小素数,\(n=pq\),\(c=f^{2^{30}+3}\mod{n}\),给n和c求f 题解:rsa解密,首先 ...
- Django 数据库操作进阶F和Q操作
Model中的F F 的操作通常的应用场景在于:公司对于每个员工,都涨500的工资.这个时候F就可以作为查询条件 1 2 3 from django.db.models import F models ...
- Python菜鸟之路:Django 数据库操作进阶F和Q操作
Model中的F F 的操作通常的应用场景在于:公司对于每个员工,都涨500的工资.这个时候F就可以作为查询条件 from django.db.models import F models.UserI ...
- Q的进阶用法
Q的实例化用法 #q1 里面的条件都是or的关系 q1=Q() q1.connector = 'OR' q1.children.append(('id',1)) q1.children.append( ...
- Django-F和Q函数作用与使用
F函数 能够解析对现有查询对象的引用的对象. obj = Score.objects.get(stuid=') obj.score += 1 obj.order.save() 执行出的SQL语句 wh ...
- 洛谷P1527 [国家集训队] 矩阵乘法 [整体二分,二维树状数组]
题目传送门 矩阵乘法 题目描述 给你一个N*N的矩阵,不用算矩阵乘法,但是每次询问一个子矩形的第K小数. 输入输出格式 输入格式: 第一行两个数N,Q,表示矩阵大小和询问组数: 接下来N行N列一共N* ...
随机推荐
- Spring框架学习笔记(9)——API接口设计相关知识及具体编码实现
最近需要设计一个API服务器,想要把API接口搞得规范一下,就通过网上搜集到了一些资料,以下便是自己的一些理解以及相关的具体实现 本文采用的是spring boot+maven的方案 restful规 ...
- Jmeter之设置动态关联
前言 在Jmeter中,如何进行接口关联(上一个接口的返回参数作为下一个接口的入参使用)测试呢?下面我们一起来学习吧! 需求:需要利用商品信息接口的返回结果skuName值作为下一个登录接口参数Use ...
- cmake处理多源文件目录的方法(转)
cmake处理源代码分布在不同目录中的情况也很简单,现在假设我们的源代码分布情况如下: 源代码的分布情况 其中src目录下的文件要编译成一个链接库 第一步,项目主目录中的CMakelist.txt 在 ...
- Spring Boot 2.1.7 启动项目失败,报错: "Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured."
一开始按照网上的很多解决办法是: 启动类头部声明@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class}),但是这样会排除 ...
- 二叉树的非递归遍历C++实现
#include<iostream> #include<stdlib.h> #define maxsize 100 using namespace std; typedef s ...
- Spark作业执行流程源码解析
目录 相关概念 概述 源码解析 作业提交 划分&提交调度阶段 提交任务 执行任务 结果处理 Reference 本文梳理一下Spark作业执行的流程. Spark作业和任务调度系统是其核心,通 ...
- VFP调用API来控制USB摄像头,实现拍照或录像
*--前提:VFP7.0以上;Windows 2K及以上*--控件:AVICAP32.DLL *--定义:一般放到主程序或表单(集)的Load事件中Public WM_CAP_DRIVER_DISCO ...
- 开源堡垒机jumpserver的安装
开源跳板机jumpserver安装 简介 Jumpserver 是全球首款完全开源的堡垒机, 使用GNU GPL v2.0 开源协议, 是符合4A 的专业运维审计系统 Jumpserver 使用Pyt ...
- debian wget 报ERROR: The certificate of ‘xxx’ is not trusted.
# wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tar.xz --2019-01-11 15:04:41-- https://w ...
- NodeJS 介绍安装
1.NodeJS简介 Node.js是基于Chrome JavaScript运行时建立的一个平台,实际上它是对Google Chrome V8引擎进行了封装,它主要用于创建快速的.可扩展的网络应用.N ...