Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

External usb SSD Restic/Backrest backup automation

I've a zimaboard micro server with proxmox and a debian 10 CT that is delegate for backup system (Restic/Backrest) with an external usb ssd always attached. It is possible to pilote the external usb ...
0 votes
3 answers
661 views

how to print file name and total number of fasta sequences?

I have a fasta file namely test.fasta, pas.fasta, cel.fasta as shown below test.fasta >tile ATGTC >259 TGAT pas.fasta >ta ATGCT cel.fasta >787 TGTAG >yog TGTAT >In NNTAG I need to ...
0 votes
2 answers
99 views

Run shellcode as root in a buffer overflow attack?

I'm trying to exploit the following code: #include <stdio.h> #include <string.h> int main(int argc, char** argv){ char buffer[100]; strcpy(buffer, argv[1]); return 0; } with ...
0 votes
0 answers
18 views

Get fullname of downloaded Python wheel, without merely watching the filesystem

My script downloads a "continuum-transfunctioner" wheel from a pypi server as follows: python3 -m pip download continuum-transfunctioner -i https://pypi.acme.com:8080/simple --no-...
0 votes
0 answers
34 views

Output of python script like if it's typed in interactive mode

I have a python file and I want to obtain the output just like I'm typing the content in interactive mode (like this question https://stackoverflow.com/q/59008423 but with a shell script) I try with ...
0 votes
0 answers
98 views

Write output of multiple python scripts to single file

I used to have only one python script, of which the output would be directed to a log file. It works like this, I have it in the autostart, using crontab. @reboot /bin/sleep 30; sudo /usr/bin/python3 -...
4 votes
1 answer
7k views

Python open screen and execute inside screen

I have a py script S1 that I would need to execute inside a screen. On an end-user point of view, I would like them to just execute another python script S2, which will open a screen and execute the ...
0 votes
2 answers
20k views

Running Python script using shell script redirecting python output

I am running my python script using a shell script run.sh to restart it if crashes : #!/bin/sh COMMAND='nohup python3 -u test.py run >> py.log &' LOGFILE=restart.txt writelog() { now=`...
21 votes
8 answers
150k views

How to include python script inside a bash script

I need to include below python script inside a bash script. If the bash script end success, I need to execute the below script: #!/usr/bin/python from smtplib import SMTP import datetime ...
2 votes
2 answers
2k views

Problem when converting bash to python using bash2py

Don't know if this is the right forum for this, but I have a problem with converting bash script to python with bash2py. I've run the installer, and it all seems fine. Beginning configuration for bash-...
7 votes
3 answers
10k views

Display cron job times in a human-friendly format

Is there a way to display or is there a tool that can parse a crontab expression and display it in a human-friendly way? 10 6 * * * sh /usr/local/crons/file_check.sh For example, for the above cron ...
5 votes
5 answers
779 views

How can I replace multiple substrings from multiple lines in a file matching a pattern from a different file?

I have a file that contains multiple IP addresses and hostnames, and another file that contains some folders with many IP addresses per line. ip_hostname.txt host1 10.1.1.1 host2 10.2.2.2 host3 10.3.3....
1 vote
2 answers
460 views

How to start a screen with crontab

sudo Crontab -e 15 0 * * 1-5 /usr/bin/screen -S wake_up -d -m /home/pi/auto/wake_up.py But at 00:15 there is no screen started... This command: (worked in terminal) screen -S wake_up -d -m /home/pi/...
0 votes
1 answer
906 views

Shell script that prompts user for arguments and inserts them as parameters into a python script

I am trying to write a shell script that prompts the user for 3 case-sensitive arguments username password url and then take those parameters and calls a python script i.e.: "python streamcount....
26 votes
6 answers
9k views

How can I sort a list with major.minor.patch level and sometimes rc correctly?

I have to sort the following list with a shell script and make the latest version appear on the bottom or top. How would I do that with shell tools only? release-5.0.0.rc1 release-5.0.0.rc2 release-5....

15 30 50 per page
1
2 3 4 5
10