I tried to write a bash script which upload a file to an ip address with ftp connection, but i have an issue or something like that. I have a .txt file with a lot of line. Every line have an ip address, nothing else just the ip address. So i want to read the ip address from the text
How do I print array of u16 in C?
I’d like to print both MSB and LSB of a u16 variable, here is my code: This code just print the LSB part in hexa format, but can you tell me how do I print the MSB part? Answer This code just print the LSB part Well of course, buf[0] = reg; only copies 8 bits. And what result you
How to SSH a curl command
env = GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu) Situation: SystemA=No internet. SystemB=Yes internet. SystemA has a log file. SystemA wants SystemB to send a curl command for him. SystemA$ ssh SystemB curl -X POST -H “Content-type: application/json” -d “$data” $hook = fail SystemB$ curl -X POST -H “Content-type: application/json” -d “$data” $hook = success How do I achieve this without SystemA
get a char passed as parameter
I would like to write a function in NASM System V ABI x86-64 (Intel Syntax) that I could use in a C program. Here is the prototype of the function: I therefore retrieve the parameters in order (const char *s = rdi, int c = rsi) First, I get the character stored in the register rsi and put it in
How to print a string AFTER the date in Linux Terminal?
I want to type a one-line command in Linux that will print the date followed by a string to the Terminal. For example, “… is today’s date.” This is what I tried. However, this printed ” is today’s date. Sat Feb 20…” I thought reversing the order would help, but this only printed the date. Conversely, my third attempt only
Problem with same thread ID for different threads
I am having trouble with my threads. I am trying to create 10 threads and for each thread I want to print the thread ID. I am able to print the thread ID but the problem is that all threads prints out the same thread ID. This is my code: main: mqClient: When testing two threads this is the output
Missing Python headers (Python.h) on Heroku
I’m trying to deploy to Heroku a Python application which requires some C extensions. The problem is that when I deploy the app to Heroku via git push heroku master I get the following error: From what I understand, I’m missing the Python.h header file, which is required to build my C extension. I’ve already tried apt install python-dev, python-devel,
Is there a program that functions like printf with an entire file as input?
My use case is as follows. file.txt First arg: %s Second %s arg, Third %s Run prog file.txt “one” “$(ls dir1/dir2)” “three” Resulting in First arg: one Second file1 file2 file3 arg, Third three I first thought to use sed but that inevitably runs into problems when bash substitutions get read as format characters like this sed s/%1/$VAR/g -> sed
How to use variables in shell?
Having a simple script like this, which should convert minutes to seconds When run after entering a number (5), it outputs an expression “expr $x ‘*’ 60” instead of a product(300). What could be the reason? Answer You didn’t execute the expression, instead you created a string. Try it like this:
Linux Sort words alphabetically and make a file for each letter
I want to write a shell script which creates automatically 26 dictionary files, where the first file should contain all the words starting with a or A, the second all the words starting with b or B, … etc. Where each dictionary file is sorted. For example, if I had a file that had the words Lime, Apple, Orange, Avacado,