Q&A in 2018 - Q1
2024-10-12 03:14:55
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
最新文章
- The Strategy pattern
- 东大OJ-5到100000000之间的回文质数
- php插件开发
- ElasticSearch实战使用
- asp.net mvc 中的部分视图
- poj 2226 Muddy Fields(最小覆盖点+构图)
- [Angular 2] Handle Reactive Async opreations in Service
- 【PPC】Qemu怎么玩儿
- [Javascript] Introducing Reduce: Common Patterns
- [转]Ubuntu Tweak 0.8.7 发布:支持 Ubuntu 14.04
- poj2656---求一列数中最大数的序数而且在前面输入的更优先
- PHP - 字符串操作
- javascript 中的this
- S3C2440硬件IIC详解
- php生成PDF文件(FPDF)
- nginx 80 端口 部署多个Web
- Groovy学习笔记-动态类型
- Python语言:下载上证股票数据程序
- ILBC 规范
- MVC 之 初识(一)