[Shell script] searches for function difference sets implemented by shell scripts and shell scripts
Text address
Click follow public account wenyuqinghuai
Sharing outline:
1. Background
2. Code Implementation
1. Background
During the automated testing of the company's tests, some functions with code development are covered, but those functions that have not yet been developed are still relatively slow to
JavaScript learning 10: Dynamic Loading of scripts and styles, javascript scriptsWhen writing web pages, we need to introduce a lot of JavaScript script files and CSS style files. Especially when there is a large demand for websites, the demand for scripts also increases. As a result, the performance of the website will be greatly reduced, so the concept of dynamic loading emerged, that is, loading the corr
Array of Shell scripts, shell scripts
#! /Bin/bash # The operations on arrays in the shell that you must know. Arr = ("hello" "word" "you" "are" "a" "good" "boy") # arr = ('LS') # I like this method. Echo "------- for ----------------" for I in $ {arr [@]} do echo $ Idoneecho "-------- for ---------------" for (I = 0; I
Copyright Disclaimer: This article is an original article by the blogger and cannot
Oracle BIEE Start and Stop scripts and oraclebiee start scriptsAs a BI developer, it is inevitable to start and stop BI services. The startup process is long and commands need to be switched to different directories. I am so bored that I have specially compiled the startup scripts in linux, save the following script as biee. sh, the subsequent process is quite simple,Start:./biee. sh start stop:./biee. sh s
CodeNon-standard, such as over 80 columns, spaces after parentheses, And the asterisk in the pointer is not appended with the variable name.
Static code check. For example, if msleep is less than 20, it is recommended to change it to 20, because less than 20 makes no sense.
There are some scripts in the scripts directory, such as cleanfile and cleanpatch, which can be used to automatically modify some pro
Batch Delete scripts for large tables: MySQL version; Delete scripts for mysql
It is often necessary to regularly Delete historical data from some tables. The data in such tables is usually very huge. To reduce the impact on the online environment, the deletion must be divided into small batches.
I have previously shared the SQLServer version.
The following is the MySQL version:
1 delimiter $2 drop proc
Python scripts run in the background and python scripts run in the background
Problem description:
Environment: CentOS6.4
A monitoring script test1.py written in python is always running in the while True mode. Run the following command to start the script remotely (using the putty terminal) in ssh:
python test1.py
Now that the script runs normally, you can see the process number through ps. In this case,
Methods and instances for calling system commands, Shell scripts, and Python scripts in Nodejs, nodejspython
Each language has its own advantages. It can be combined with each other to develop programs that are more efficient to execute, or use which implementation method is simpler. nodejs uses sub-processes to call system commands or files, for more information about the documentation, see refer to interf
Python detects QQ online status scripts and python online status scripts
Code for querying whether QQ is onlineBy accessing http://wpa.qq.com/pa? P = 1: [QQ number]: 1 query the returned ImageIf 2329 is returned, 2262 is online, and offline.
123456789101112131415161718
importtime,datetime importurllib2 defchk_qq(qqnum): chkurl ='http://wpa.qq.com/pa?p=1:'+`qqnum`+':1'a =urllib2.urlopen(chkurl) l
1, case do with the execution of the option script:#!/bin/bashCase $ inXecho "X is selected";;*)echo "Please use X"EsacSecond, case combined while doing interactive script:#!/bin/bashWhile TrueDoRead-p "Enter Port of Chaoxingdata (d,1):" PortCase ${port} inDecho "Port=${port}"Read-p "Press ENTER to continue";;1)echo "Port=${port}"Read-p "Press ENTER to continue";;*)echo "Error input,you fool"Read-p ' type ' go ' to continue: ' Goif [! ${go} = go] | | [-Z ${go}]ThenExitFiEsacDoneShell
When a variable is evaluated in a script, you need to add a [] to the outside and set a $[email protected] tmp]# cat real_mem_used01.sh#!/bin/bashTotal= ' Free-g|grep Mem |awk ' {print $} 'Used= ' Free-g|grep Mem |awk ' {print $} 'Buffer= ' Free-g|grep Mem |awk ' {print $6} 'Cache= ' Free-g|grep Mem |awk ' {print $7} 'real_used=$[$USED-$BUFFER-$CACHE]pused=$[$real _used*100/$TOTAL]echo $PUSED%[Email protected] tmp]#[Email protected] tmp]# sh real_mem_used01.sh12%[Email protected] tmp]#Method Two
Synchronization script, in the 5th step to splice the host name of your own configuration1#!/bin/Bash2#1gets the number of input parameters, if there are no parameters, exit directly3Pcount=$#4 if((pcount==0)); Then5 echo no args;6 exit;7 fi8 9#2Get file nameTenp1=$1 OneFname=$ (basename $p 1) AEcho fname=$fname - -#3get parent directory to absolute Path thepdir=$ (CD-P $ (dirname $p 1); pwd) -Echo pdir=$pdir - -#4get the current user name +User=$ (WhoAmI) - +#5Loops A for((host=3; host5; ho
Tags: Restart started warning body Stop one result postLet's start with an example: Suppose you have a test service that can start, shut down, or restart test by command, the following script simulates this feature:#!/bin/bash#test.shcase $ in start) echo "Starting service ..." sleep 1 echo "started the service!!" ;; Stop) echo "Stopping service ..." sleep 1 echo "stopped the service!!" ;; Restart) echo "Restarting service .
Non-interactive password modification in Shell scripts and non-Password modification in shell scriptsToday, when I wrote a shell script, I found that the user's password needs to be set and the password is set to interactive. This is obviously not good in the script, So I went online to search for information, two common non-interactive password setting methods are found:1: Use chpasswdIn fact, chpasswd uses the user to enter the 'user name: password'
How to customize service scripts and how to create standard rpm service scriptsCustom Service script:
#!/bin/bash#myscript#chkconfig: 2345 90 20#description: Starts, stops and saves iptables firewallcase $1 in start) echo "start my script!!" sleep 1 ;; restart) echo "restart my script!!" sleep 1 ;; stop) echo "stop my script!!" sleep 1 ;; *) echo "please input start|restart|stop
Weblogic Start and Stop scripts and weblogic start scriptsStart weblogic
Determine whether to enable the service by using the port.
#! /Bin/bash # author: wjf # date: # test environment: wls1036 horizontal cluster v_curr_user = 'whoam' v _ start_user = uweblogic # ------------ user v_admin_url = http: // 10.10.71.106: 9001 # ------------ manage the server's urlv_dir_domain_bin =/weblogic/Oracle/Middleware/user_projects/domains/gyhr_domain/bin # -----
Special characters of shell scripts and special characters of shell scripts1. # comment ,#! Besides, echo $ {PATH # *:} parameter replacement does not represent annotation, numeric conversion, and echo $(2 #101011) 2 .; command Line separator. Multiple commands can be written in one line. echo hello; echo there3.; the Code for copying the terminate case option is as follows:Case "$ variable" inabc) echo "\ $ variable = abc"; xyz) echo "\ $ variable =
Webview Dynamic Injection of js scripts and webviewjs scriptsAfter the webview is loaded, add a local click event to all img tabs.
/** Function () {var objs = document. getElementsByTagName ('img '); for (var I = 0; I
Then
webview.getSettings().setJavaScriptEnabled(true);webview.addJavascriptInterface(new Object(){ @JavascriptInterface public void openImage(int i, String src) { ArrayList
Inject script code after page data is loaded
webvi
Mutt
# VIM/ROOT/.MUTTRC
Set sendmail= "/usr/local/msmtp/bin/msmtp"
Set Use_from=yes
Set Realname= "Moniter"
Set from=fuquanjun@xxx.com
Set Envelope_from=yes
Set Rfc2047_parameters=yes
Set charset= "Utf-8
4, the mail sends the test (S-mail title, a table plus annex)
Copy Code code as follows:
# echo "message content 123456" | Mutt-s "Message header test message"-a/scripts/test.txt fuquanjun@xxxx.com
The f
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.