几个命令

取txt文件值 data=read.table(“1.txt”,header=T) 读值 head(data) windows下 获取当前工作目录 getwd() 相对路径 setwd(“.\\Rsourse”) 上一级目录 setwd(“..\\”) 绝对路径 setwd(“D:\\MySpace\\机器学习\\R\\Rsourse”)  

使用R语言导入不同格式的文件

假如我们要导入C:\Users\user\Desktop路径下的test.csv文件,则输入代码: read.csv(file = “C:\\Users\\user\\Desktop\\test.csv”) 默认情况下,R语言会认为第一行的是数据的标题,假如你的数据的第一行其实并不是标题,那么可以输入代码: read.csv(file = “C:\\Users\\user\\Desktop\\test.csv”,header = F) 下面的代码会将数据赋给对象Mydata: Mydata<-read.csv(file = “C:\\Users\\user\\Desktop\\test.csv”,header = F) 要查看Mydata对象里的数据,直接输入Mydata就可以了: Mydata 原始txt数据中有a、b两列数据,并且它们以“;”号作为分隔符,则: read.table(file = “C:\\Users\\user\\Desktop\\test.txt”,header = T,sep=”;”) 假如分隔符是其他符号,例如百分号“%”,则代码修改为: read.table(file = “C:\\Users\\user\\Desktop\\test.txt”,header = T,sep=”%”)  

Apache2

关于Apache2的几个修改 1、修改端口 vim /etc/apache2/ports.conf 修改Listen 3333 vim /etc/apache2/sites-enabled/000-default.conf 修改第一行<VirtualHost *:3333> 重启服务 2、修改默认路径 vim /etc/apache2/apache2.conf 往下翻页,添加 <Directory /home/user/web> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> vim /etc/apache2/sites-enabled/000-default.conf 更改 DocumentRoot /home/user/web 重启服务 3、修改默认路径到用户目录,并给予修改权限 mkdir /home/user/web vim /etc/apache2/envvars 更改apache用户与组 export APACHE_RUN_USER=www-data export APACHE_RUN_GROUP=www-data 修改为: export APACHE_RUN_USER=user export APACHE_RUN_GROUP=user (与你系统的用户同名,避免Apache2 写入权限的问题) 重启服务

目录下没有Index文件提示无访问权限

Apache默认在当前目录下没有index.html入口就会显示网站根目录,让网站目录文件都暴露在外面,是一件非常危险的事,例如:数据库密码泄露,隐藏页面暴露等严重安全问题! 进入apache的配置文件 $ sudo vi /etc/apache2/apache2.conf #Debian/Ubuntu systems $ sudo vi /etc/httpd/conf/httpd.conf #RHEL/CentOS systems Options Indexes FollowSymLinks 修改为: Options FollowSymLinks 修改后结果如下: <Directory “/var/www/html”> #    Options None #    Options Indexes FollowSymLinks Options FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> 其实就是将Indexes去掉,Indexes表示若当前目录没有index.html就会显示目录结构。 重启Apache服务器  /etc/init.d/httpd restart   https://blog.csdn.net/ithomer/article/details/50487296

隐藏apache2版本信息

To hide web server version number, server operating system details, installed Apache modules and more, open your Apache web server configuration file using your favorite editor: $ sudo vi /etc/apache2/apache2.conf #Debian/Ubuntu systems $ sudo vi /etc/httpd/conf/httpd.conf #RHEL/CentOS systems And add/modify/append the lines below: ServerTokens Prod ServerSignature Off Save the file, …

根据不同访问设备跳转到PC页面或手机页面

<script type=”text/javascript”> var userAgent = navigator.userAgent.toLowerCase(); var platform; if(userAgent == null || userAgent == ”){ platform = ‘WEB’ ; }else{ if(userAgent.indexOf(“android”) != -1 ){ platform = ‘ANDROID’; location.href = “http://m.kuegou.com/”; }else if(userAgent.indexOf(“ios”) != -1 || userAgent.indexOf(“iphone”) != -1 || userAgent.indexOf(“ipad”) != -1){ platform = ‘IOS’; location.href = “http://m.kuegou.com/”; }else if(userAgent.indexOf(“windows …

MariaDB设置初始化密码及修改密码

方法1: [root@localhost ~]# mysql MariaDB[(none)]> UPDATE mysql.user SET password = PASSWORD(‘newpassword’) WHERE USER = ‘root’; MariaDB[(none)]> FLUSH PRIVILEGES; 方法2: [root@localhost ~]# mysql MariaDB[(none)]> SET password=PASSWORD(‘newpassward’); 方法3: [root@localhost ~]# mysqladmin -u root password ‘newpassword’ 如果root已经设置过密码,采用如下方法 [root@localhost ~]#mysqladmin -u root -p ‘oldpassword’ password ‘newpassword’ https://blog.csdn.net/zwj52pk/article/details/78651647

Manjaro安装MariaDB

sudo pacman -S mysql Output [dhani@dhani-manjaro ~]$ sudo pacman -S mysql :: There are 2 providers available for mysql: :: Repository extra 1) mariadb :: Repository community 2) percona-server Enter a number (default=1): Type 1 to select mariadb package or simply press Enter. Output: Resolving dependencies… looking for conflicting packages… …