scripting

Schedule Heroku to restart dynos every 10 or so minutes

梦想的初衷 提交于 2020-04-15 17:13:51
问题 I am developing a REST api with Node.js on Heroku, and one the drivers is giving me problems (I reported that to the driver creator already), but basically a restart of the dynos every half an hour or so seems to fix this. I was hoping y'all could help me with writing a script for scheduler or something similar to restart the dynos automatically every 10 or so minutes as a temporary fix. p.s. I checked out the scheduler documentation, but it didn't make much sense Thanks! 回答1: You can do what

How to send output from a python script to an email address

偶尔善良 提交于 2020-04-08 18:03:11
问题 The bounty expires in 4 days . Answers to this question are eligible for a +50 reputation bounty. Pinocchio is looking for a more detailed answer to this question: I have a script that runs main() and at the end I want to send the contents it has by e-mail. I don't want to write new files nor anything. I tried the code showed here but it didn't work. I have a threaded python script that pings 20 nodes on a local area network, and prints out the status of each: Node is Alive, Node is Down, etc

Using one script for copying text from cells in a row to another sheet using an icon in a row

亡梦爱人 提交于 2020-04-07 07:07:55
问题 From my previous post (Autocopy cell value from one cell to another sheet by clicking an icon in google sheets) I now run into a new problem which I would like someone to help me out with. I'm trying to achieve a spreadsheet where an anonymous user can click the icon in column A and the data from column B and C is moved from sheet1 to sheet2 including a timestamp. So far so good. It is up and running with a help from this great community. I'm using this script: function copyPasteValue2() {

Using one script for copying text from cells in a row to another sheet using an icon in a row

天涯浪子 提交于 2020-04-07 07:06:22
问题 From my previous post (Autocopy cell value from one cell to another sheet by clicking an icon in google sheets) I now run into a new problem which I would like someone to help me out with. I'm trying to achieve a spreadsheet where an anonymous user can click the icon in column A and the data from column B and C is moved from sheet1 to sheet2 including a timestamp. So far so good. It is up and running with a help from this great community. I'm using this script: function copyPasteValue2() {

How do I verify if a file exists and it's from today?

安稳与你 提交于 2020-03-26 17:36:36
问题 I have this BATCH file, How to make sure the source file C:\file.zip exist and it's today's file, before applying the copy submission? following is not working when I tried: echo off cls echo will do a back if [ C:\file.zip ] then echo found, will validate if its the file created today? copy C:\file.zip "\\to_computer_of_enterprise\\granted\\to\\upload\\here" else: echo sorry do not exist fi 回答1: Here is a batch code not using command forfiles which is by default not available on Windows XP

echo output not getting assigned to a variable in shell script

喜夏-厌秋 提交于 2020-03-25 19:24:30
问题 end=echo $FSDB_FILE_NAME | rev | cut -d'_' -f 2 |rev begin=echo $FSDB_FILE_NAME | rev | cut -d'_' -f 3 |rev echo $end echo $begin echo abc_11204.00_15713.00_.csv | rev | cut -d'_' -f 2 |rev ---- This works But echo $end is not printing anything I even tried: set end=echo abc_11204.00_15713.00_.csv | rev | cut -d'_' -f 2 |rev echo $end This prints empty Please help me with this Sample input : abc_123.00_345.00_xyz.csv Output : end=345.00 begin=123.00 回答1: Could you please try following. Easy

echo output not getting assigned to a variable in shell script

淺唱寂寞╮ 提交于 2020-03-25 19:24:12
问题 end=echo $FSDB_FILE_NAME | rev | cut -d'_' -f 2 |rev begin=echo $FSDB_FILE_NAME | rev | cut -d'_' -f 3 |rev echo $end echo $begin echo abc_11204.00_15713.00_.csv | rev | cut -d'_' -f 2 |rev ---- This works But echo $end is not printing anything I even tried: set end=echo abc_11204.00_15713.00_.csv | rev | cut -d'_' -f 2 |rev echo $end This prints empty Please help me with this Sample input : abc_123.00_345.00_xyz.csv Output : end=345.00 begin=123.00 回答1: Could you please try following. Easy

Running bash script does not return to terminal when using ampersand (&) to run a subprocess in the background

北城余情 提交于 2020-03-13 06:11:02
问题 I have a script (lets call it parent.sh) that makes 2 calls to a second script (child.sh) that runs a java process. The child.sh scripts are run in the background by placing an & at the end of the line in parent.sh. However, when i run parent.sh, i need to press Ctrl+C to return to the terminal screen. What is the reason for this? Is it something to do with the fact that the child.sh processes are running under the parent.sh process. So the parent.sh doesn't die until the childs do? parent.sh

I want to use “awk” or sed to print all the lines that start with “comm=” in a file

笑着哭i 提交于 2020-03-13 06:07:19
问题 I want to use "awk" or "sed" to print all the lines that start with comm= from the file filex , Note that each line contains "comm=somthing" for example : comm=rm , comm=ll, comm=ls .... How can i achieve that ? 回答1: For lines that start with comm= sed -n '/^comm=/p' filex awk '/^comm=/' filex If comm= is anywhere in the line then sed -n '/comm=/p' filex awk '/comm=/' filex 回答2: You could use grep also : grep comm= filex this will display all the lines containing comm= . 回答3: Here's an

I want to use “awk” or sed to print all the lines that start with “comm=” in a file

♀尐吖头ヾ 提交于 2020-03-13 06:06:30
问题 I want to use "awk" or "sed" to print all the lines that start with comm= from the file filex , Note that each line contains "comm=somthing" for example : comm=rm , comm=ll, comm=ls .... How can i achieve that ? 回答1: For lines that start with comm= sed -n '/^comm=/p' filex awk '/^comm=/' filex If comm= is anywhere in the line then sed -n '/comm=/p' filex awk '/comm=/' filex 回答2: You could use grep also : grep comm= filex this will display all the lines containing comm= . 回答3: Here's an