Skip to content
Advertisement

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

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,

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:

Advertisement