directory

Lucene教程

。_饼干妹妹 提交于 2019-12-27 03:33:52
一:简单的示例 1.1:生成索引     1.1.1:Field.Store和Field.Index     1.1.2:为数字生成索引     1.1.3:为索引加权     1.1.4:为日期生成索引  1.2:查询    1.2.1:介绍IndexReader 1.3:删除    1.3.1:还原删除的文档    1.3.2:清空回收站时面的数据  1.4:更新 前言:本教程用于 Lucene3.5 ,Maven地址为 <dependency> <groupId>org.apache.lucene</groupId> <artifactId>lucene-core</artifactId> <version>3.5.0</version> </dependency> 一:简单的示例 我就不介绍Lucene了,想来看这篇博客的人,都知道Lucene是什么。直接给出生成索引,和查询的示例 1.1:生成索引 生成索引的代码如下: /** * 创建索引 */ public void index(){ IndexWriter writer = null; try { //1、创建Derictory // Directory directory = new RAMDirectory();//这个方法是建立在内存中的索引 Directory directory = FSDirectory

500 OOPS: vsftpd: refusing to run with writable root inside chroot()解决方法

点点圈 提交于 2019-12-27 02:47:49
# setsebool -P ftpd_full_access=on FTP连接时报错如下: 500 OOPS: vsftpd: refusing to run with writable root inside chroot()   解决方法: chroot_local_user=YES ---锁定用户登录ftp后,只能到自己的家目录下,不能随便切换到其它目录。但是普通系统用户默认是可以在自己的家目录里写文件的,vsftp出于安全性要求,如果锁定了用户的ftp登录目录,则所在目录不能有写权限。 方法1 、 /etc/vsftpd/vsftpd.conf配置文件增加如下一行 local_root=/data/ftp //系统用户登录后进入到该目录 , 注意该目录对其它用户同样不能有写的权限。(连写入的权限都没有,这个方法也不靠谱) 如果有写权限,则执行chroot a-w /var/ftp -R 取消写入权限。 方法2 、简单粗暴的方法 不要设置local_root参数,取消用户往自己目录写权限: chmod a-w /home/username, 但是用户登录操作系统后会影响用户使用,自己目录写的权限都没有。--不可行。 方法3 、/etc/vsftpd/vsftpd.conf配置文件增加如下一行 allow_writeable_chroot=YES --可行

使用ansible远程管理集群

坚强是说给别人听的谎言 提交于 2019-12-27 01:59:07
使用ansible远程执行命令 1.ansible简介 ansible的官方定义:“Ansible is Simple IT Automation”——简单的自动化IT工具。这个工具的目标: 自动化部署APP 自动化管理配置项 自动化的持续交付 自动化的(AWS)云服务管理。 其本质上就是在远程在多台服务器执行一系列命令和文件同步,和以前的介绍的 使用并行ssh提高工作效率 功能类似,他们都是使用ssh协议进行远程操作,但ansible比pssh功能更强大,比如支持主机列表分组、支持playbook模板文件等。本文仅仅介绍ansible的Ad-Hoc用法,即默认的command模块,直接在shell执行命令。 2.安装 ubuntu14.04直接使用 apt-get 安装: sudo apt-get install -y ansible 也可以使用pip命令安装: sudo pip install ansible 为了支持输入远程主机用户密码,还需要安装 sshpass 工具: sudo apt-get install -y sshpass 安装完成后创建~/.hosts文件,内容如下: [local] ceph-0 [mon] ceph-1 [osd] ceph-2 ceph-3 以上配置文件定义了三个主机组,分别为 local 、 mon 、 osd , ceph-x 是主机名

Move folders to parent level (Windows)

孤街浪徒 提交于 2019-12-26 23:31:50
问题 My file tree looks like this: Parent folder Subfolder Subsubfolder Subfolder Subsubfolder Subfolder Subsubfolder I'd like to move all subsubfolders to the parent folder without changing the structure of the subsubfolders . How do I do this? 回答1: Create a move.bat in the parent folder and run this: FOR /R "." %%F IN (.) DO ( move "%%F" ".") see https://stackoverflow.com/a/33276986/4934937 来源: https://stackoverflow.com/questions/48158375/move-folders-to-parent-level-windows

Need To Create Simple C# Windows App - Looks In Folder and Processes New Files Added [duplicate]

橙三吉。 提交于 2019-12-26 08:15:06
问题 This question already has answers here : Processing Folder With Multiple Files Using FileSystemWatcher and C# (3 answers) Closed last year . Could someone please help me create a simple windows C# app that would look in a specified folder? The app basically will on the click of a button watch a specified folder and if a new file is put into the folder it opens the file and does some processing with it. I also need to consider if multiple files are created into the folder at relatively the

C#文件和文件夹操作

为君一笑 提交于 2019-12-25 23:13:55
编辑器加载中.../1.文件夹创建、移动、删除--------- //创建文件夹 Directory.CreateDirectory(Server.MapPath("a")); Directory.CreateDirectory(Server.MapPath("b")); Directory.CreateDirectory(Server.MapPath("c")); //移动b到a Directory.Move(Server.MapPath("b"), Server.MapPath("a\\b")); //删除c Directory.Delete(Server.MapPath("c")); //2.文件创建、复制、移动、删除--------- //创建文件 //使用File.Create创建再复制/移动/删除时会提示:文件正由另一进程使用,因此该进程无法访问该文件 //改用 FileStream 获取 File.Create 返回的 System.IO.FileStream 再进行关闭就无此问题 FileStream fs; fs = File.Create(Server.MapPath("a.txt")); fs.Close(); fs = File.Create(Server.MapPath("b.txt")); fs.Close(); fs = File.Create

文件及文件夹操作

非 Y 不嫁゛ 提交于 2019-12-25 23:13:14
文件及文件夹操作: C/S:WinForm可以操作客户端文件 Client Server B/S:Brower Server 命名空间:using system .IO; 1. File类: 创建:File.Create(路径);创建文件,返回FileStream FileStream fs = File.Create(路径);之后需要关闭否则打不开,fs.close(); 删除:File.Delete(路径);无返回值 复制文件:File.Copy(源文件,目标文件); 剪切文件:File.Move(源文件路径,目标路径); 判断文件是否存在:File.Exists(路径);返回布尔型,true代表已存在 文件加密:File.Encrypt();File.Decrypt();解密 File.GetCreationTime(路径);获取创建时间,返回DateTime类型 SetCreationTime(路径,DateTime类型);修改创建时间 File.GetLastAccessTime(路径);最后访问时间,返回DateTime类型 SetLastAccessTime(路径,DateTime类型);修改访问时间 File.GetLastWriteTime(路径);最后修改时间,返回DateTime类型 SetLastWriteTime(路径,DateTime类型);修改修改时间

Read file content and use Regular Expression to locate a pattern in each File in Perl

ぃ、小莉子 提交于 2019-12-25 20:01:33
问题 I have about 200 files located in the same directory, all of which contain a specific piece of content that I need to match using RegExp and either save all of the matched contents into a single array or store them in a new file. When working with notepad++ regexp engine I do the following to locate the pattern: <div class="opacity description">(.*)</div> so that is the pattern I am looking for. And this is how i Open and List all the files in the directory. my $d = shift; opendir(D, "details

How to create a folder with a folder name containing spaces in linux?

与世无争的帅哥 提交于 2019-12-25 19:30:35
问题 How to create a folder witha a folder name containing spaces in linux? For Example, folder name should be "Stack OverFlow". 回答1: you can also do mkdir Stack\ OverFlow the \ does the same thing as " " but it is easier. so you can do stuff like mkdir Stack\ OverFlow\ is\ Great . you can manipulate that folder using the \ as well. so things like cd Stack\ OverFlow and rm -rf Stack\ OverFlow . 回答2: Just use quotes around the name: mkdir "this is my dir" Then you can check it by also using quotes:

How to select the second, third, fourth… newest folder with batch

♀尐吖头ヾ 提交于 2019-12-25 18:55:15
问题 I have written a batch which checks the newest folder for .xml files and copy them to another folder, after copying the files it should call an application and stop. Now I need to let the batch watch in the next folder (after completing the whole circle with the first) for any .xml files and do the same, and so on... With this code I can copy all the .xml files from the newest folder to another folder: SETLOCAL SET "sourcedir=Y:\PriCat\Debiteuren" SET "destindir=Y:\Pricat\Pricatombouw" set