scripting

Nmap - RTTVAR has grown to over 2.3 seconds, decreasing to 2.0

橙三吉。 提交于 2020-01-22 16:49:47
问题 I have a script that I'm using to build a config for icinga2. The network is large, multiple /13's large. When I run the script I keep getting the RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 error. I've tried raising my gc_thresh and breaking up the subnets. I've dived through the little info from google and can't seem to find a fix. If anyone has any ideas, I'd really appreciate it. I'm on Ubuntu 16.04 My script: # Find devices and create IP list i=72 while [ $i -lt 255 ] do echo

ssh invocation in script function

杀马特。学长 韩版系。学妹 提交于 2020-01-21 11:46:27
问题 I have written a simple script that calls a function in a while loop. I have determined that the while loop works correctly. In the do section I call a function. This also works fine. However as soon as I execute a command on a remote host using ssh in the function implementation this seems to break the calling while loop. For the first iteration the function call succeeds, the command is invoked on the remote host and the result is returned as expected. However then the script ends as if I

Write an executable .sh file with Java for OSX

旧街凉风 提交于 2020-01-21 10:58:08
问题 So I am trying to write an .sh file that will be executable, this is how I'm currently writing it: Writer output = null; try { output = new BufferedWriter(new FileWriter(file2)); output.write(shellScriptContent); output.close(); } catch (IOException ex) { Logger.getLogger(PunchGUI.class.getName()).log(Level.SEVERE, null, ex); } So that writes the file just fine, but it is not executable. Is there a way to change the executable status when I write it? Edit: To further clarify, I am trying to

Write an executable .sh file with Java for OSX

会有一股神秘感。 提交于 2020-01-21 10:58:06
问题 So I am trying to write an .sh file that will be executable, this is how I'm currently writing it: Writer output = null; try { output = new BufferedWriter(new FileWriter(file2)); output.write(shellScriptContent); output.close(); } catch (IOException ex) { Logger.getLogger(PunchGUI.class.getName()).log(Level.SEVERE, null, ex); } So that writes the file just fine, but it is not executable. Is there a way to change the executable status when I write it? Edit: To further clarify, I am trying to

Find and rename files with no extension?

半城伤御伤魂 提交于 2020-01-20 01:40:49
问题 So, I've got a bunch of files with no extension. I want to write a windows batch script that will: Find files with no extension (in a specified folder) Add .bla to the end of the file name I'm such a windows batch script noob I don't even know where to start. Suggestions? 回答1: For windows batch files, this will rename only files with no extension to the .bla extension: rename *. *.bla Notice the first argument is a star and a dot: *. The second argument is: *.bla The start dot (*.)

Adding external scripts to Xcode4

旧城冷巷雨未停 提交于 2020-01-17 07:51:20
问题 I need to do some tasks before any Archive launched in Xcode. Is there any way in Xcode to add a .sh or .py script run before Archive ? PS : I can complete these tasks by hand but it requires time, some tasks might be forgotten or if the process is done by someone else all the tasks can be forgotten. The problem is that these tasks are required to have a successfull Apple validation. Thanks 回答1: You can add script build phases at any point between the existing phases. Here is a post which

Comparing numbers in a text file to a list of numbers in an other textfile

我的梦境 提交于 2020-01-17 06:20:31
问题 I have a .txt file containing 4-digit numbers. sometimes they only contain one 4-digit number, sometimes multiple 4-digit numbers, sometimes they are empty. example1.txt file: 6304 6204 example2.txt file: 6308 example3.txt file: 6305 example4.txt file: 6300 6204 6301 example5.txt file: 6302 6234 6345 What I need to do, is to check if the numbers inside the example file are in a list of numbers I have in an other textfile. this list looks something like this: ( but with more numbers ) 6300

Expect script for checking ssh connection for a list of ips

淺唱寂寞╮ 提交于 2020-01-17 05:20:07
问题 Can anyone help me in creating an expect script to just do an SSH on a list of servers and check if it was fine. I do not need to interact, do not need to fire any command on each server, I just want to do an ssh and come out, with a return code mentioning whether it was successful or not. Expect is important here, as I do not have an option to setup a passwordless connection. Also there is a possibility that passwordless connection is setup on some of those servers. I tried something like: #

Extract a word that follows a particular word from a webpage with python

倾然丶 夕夏残阳落幕 提交于 2020-01-17 05:04:43
问题 I am writing a simple web scraper script to extract a single word from a web page. The word I require changes regularly, but comes after a word that never changes, so I can search for it. This my script so far: #!/bin/python import requests response = requests.get('http://vpnbook.com/freevpn') print(response.text) Which obviously prints the whole HTML of the page. But the bit I need is the password: <li>All bundles include UDP53, UDP 25000, TCP 80, TCP 443 profile</li> <li>Username: <strong

VB Script and filename with space

可紊 提交于 2020-01-17 03:34:05
问题 I wrote a VBS file to open the "6 May" folder with following content path = "F:\Test\2010\May\6 May" Set Sh = CreateObject("WSCript.Shell") Sh.Run ""path"",3,True Set Sh = Nothing However on executing this I am getting following error Windows Script Host Script: F:\Sperry\2010\May_06 May\open.vbs Line: 4 Char: 10 Error: Expected end of statement Code: 800A0401 Source: Microsoft VBScript compilation error OK Can anyone help me in this? 回答1: Your ""path"" syntax is incorrect. To concatenate