One, the read command reads the file automatically removes the space before and after the line.
A.txt: (There are spaces before and after each line)
11111
222222
3333333
A.sh:
#!/bin/bash
While Read Oneline;do
echo "$oneline"
Done
Execution Result:
111111
222222
333333
Second, use the ${variable name when using a variable in a string}
A.sh:
#!/bin/bash
A= "1"
b= "2"
echo "$a _$b"
Execution Result:
2
Modify the following:
echo "${a}_${b}"
Execution Result:
1_2
Reason:
In the
] filename-Z: Indicates simultaneous use of gzip compression-j: Indicates simultaneous use of bzip2 compression-j: Indicates simultaneous use of XZ compression-X: Means unpacking or decompressing-T: Indicates viewing files in the TAR package-C: means to build a tar package or to compress a file package-V: Represents a visualization-F: followed by file name (that is,-f filename)-P: Indicates the use of the original file's properties (not commonly used)-P: Indicates that an absolute path can be us
+++++++++++++++++++++++++++++++++++++++++++New file (file action)Touch Tail.txt New Filemkdir XXX Create FolderMkdir-p a/b/c Creating a multilevel directoryRM xxx.txt Deleting filesrm-r XXX Delete DirectoryRm-f Xxx.txt forcibly deleting files++++++++++++++++++++++++++++++++++++++++++++++CP xx1 XX2 Copy the xx1 to xx2 (copy) MV Xx1/home move the xx1 file to the home directoryRedirected output ls > 123.txt write the LS list to a
[TOC]11.28 restricting a directory from parsing PHP
There is a situation, some sites and forums are allowed to upload images to the server, but this gives the hacker left the door to enter the server, they upload some php or JS to the server, and then we execute the load, some functions can let the hacker get the maximum permissions, thus to the data threat!To avoid this kind of thing, we need to limit the upload type.1. Open the configuration file httpd-vhosts.conf
Add the following
This is a python3.5 of the file operations, there are copy/rename/overwrite input/append input and so on.Premise: In the pythonaaa/a folder of e-drive, there is a 123.txt1) Overwrite input>>>import os #启动模块 >>>f=open ("E:/pythonaaa/a/123.txt", "w+") #打开目标文件, w+ is opened as read and write, with r+>>> F.write ("I love Beijing Cheonan") #写入内容就是歌词7 >>>f.close () #关闭文件, this step is crucial! Have to open about.
A regular expression is a Swiss army knife that searches for a particular pattern from information. They are a huge library of tools, some of which are often overlooked or underutilized. Today I will show you some high-level usage of regular expressions.
For example, this is a regular expression that we might use to detect telephone numbers in the US:
R ' ^ (1[-\s.])? (\ ()? \d{3} (? ( 2)) [-\s.]? \d{3}[-\s.]? \d{4}$ '
We can add some comments and spaces to make it more readable.
R ' ^ ' R ' (
Start##The Fromkeys method itself is to point all keys to the same object.>>> C=dict.fromkeys (Range (5), [])>>> c{0: [], 1: [], 2: [], 3: [], 4: []}>>> c[0].append ({"B": {123}}) >>> c{0: [{' B ': Set ([123])} ], 1: [{' B ': Set ([123]}], 2: [{' B ': Set ([123])}], 3: [{' B ': Set ([
testing install. LogChown changed its owner chown root: Root install. LogChmod change attribute chmod 777 install. Log READ = 4 Write = 2 execute = 1CP copy CP filenameRm delete file Rm-RF filename force delete fileRmdir Delete folderRename MV 123.txt 222.txtCreate a folder using mkdirTouch file creation update current timeCat displays cat from the first line | more pagesNL adds a row number before the contentMore less side flipHead-N filename: disp
down find document contentChgrp Change file group CHGRP testing Install.logChown Change the owner Chown Root:root Install.logChmod change Properties chmod 777 Install.log read=4 write=2 execute=1CP copy CP filenameRM Delete file rm-rf filename Force Delete fileRmDir Deleting a folderMV Mobile MV 123.txt 222.txt Renamemkdir Creating a FolderTouch Create file Update current timeCat |more page starts with the first lineNL Add line number in front of con
interface
/work amp; Work Find document content up and down
Chgrp Change file group CHGRP testing Install.log
Chown Change the person chown root:root Install.log
chmod change attribute chmod 777 Install.log read=4 write=2
CP replication CP filename
RM Delete file rm-rf filename Force Delete file
RmDir Delete Folder
MV Mobile MV 123.txt 222.txt Rename
mkdir Create a folder
Touch Create file Update current time
Cat starts with the first line showing ca
"] {background:url (path/to/external/icon.png) no-repeat;padding-left:10px;}
The property selector. Use $ in the property selector to match an element that ends with a specific string. In the above code, all links to a. jpg image are linked. (Note that this is just a. jpg image, if you want to do all the picture links what to do, look at the next selector.) )Compatible browsers: ie7+, Firefox, Chrome, Safari, OperaX[data-*= "Foo"]Mentions how to match all the picture links in the prev
server| Script | execute
Author:david Euler
Date:2004/09/28
email:de_euler-david@yahoo.com.cn
Have any questions, please contact me:
Sometimes we need to run all the SQL scripts (possibly txt or SQL text files) in a folder to update the schema more than once, so you can use multiple statements to execute the SQL script. --The following query runs in SQL query, and executes the specified SQL script under D:\vss, which is the suffix of txtexec master. xp_cmdshell ' isql-u sa-p
To add columns to a table, use the following syntax:
Alter table table_nameADD column_name datatypeTo delete columns in a table, use the following syntax:
Alter table table_nameDrop column column_nameNote: Some database tutorial systems do not allow this method of deleting columns in database tables (drop column column_name)
.
InstanceMysql tutorial> create table Employee (-> Id int,-> First_name VARCHAR (15 ),-> Last_name VARCHAR (15 ),-> Start_date DATE,-> End_date DATE,-> Salary FLOAT (8, 2 )
machine file is 5 GB by default. I just resized the disk to 10 Gb, and 5 GB is still partitioned.2) The existing 5G is divided into three zones, except one of which is an extended partition (which is used to mount other logical partitions ), there are also two partitions. One is a LINUX partition and the other is a Linux swap (SWAP partition)
2) view the disk usage and mounting status of the existing Partition
Root @ Ubuntu:/home/Nemo # DF-H
Filesystem size used avail use % mounted on
/Dev/sda
Recently, we have used arcplan for reports. When we need to display data at different date granularities, it is easier to use SQL statements to directly query data from the database. It is highly reusable and recorded.
Annual granularity: displays the data pushed for the first five years of the current year.
T. d_day> = add_months (to_date ('123'|'123','Yyyymmdd'),-60)
AndT. d_day '
the PHP More account', 'HTTP: // www.phpe.net/news/34.shtml '));$ Tpl-> setVar ("FILEPIC", file_pic('3.jpg ', 'Welcome to PHP ',''));$ Tpl-> setVar ("FILEPIC", file_pic('show.gif ', 'show your enthusiastic activities-click to View Details', 'HTTP: // www.phpe.net/club/index.php? Act = ST f = 2 t = 1416 '));$ Tpl-> setVar ("FILEPIC", file_pic('1year.gif ', 'One year older than PHP', 'HTTP: // www.phpe.net/club/index.php? S = act = ST f = 7 t = 2419 '));*/
$ Tpl-> setVar ("CREATE", date ('Y
This article mainly introduces the summary of practical commands for using percona-toolkit to operate MySQL. percona-toolkit is a powerful MySQL auxiliary tool. For more information, see
1.pt-archiverFunction introduction:
Archive the records of tables in the mysql database to another table or file
Usage:
Pt-archiver [OPTION...] -- source DSN -- where WHERE
This tool only archives old data and does not significantly affect OLTP query of online data. you can insert the data into other tables on a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.