Skip to content

Tag: c++

Protect website files on linux hosting server

l have a website that is hosted in linux server, and my root is (/home/MyAccountName). My website allows users to upload there c++/c code, compile, and execute it. The problem is: The executed user’s program will have all the owner permissions (read – write -execute). so if the user’s code i…

‘unshare’ does not work as expected in C api

This sequence of commands works: However, the corresponding C program does not work as expected (it seems it does not unmount the previous /proc, and also it provides EBUSY trying to unmount the devpts): I omitted here error checking for readability I think that unshare or unmount does not work as expect: eve…

How to read from serial device in C++

I’m trying to figure out how I should read/write to my Arduino using serial communication in Linux C++. Currently I’m trying to read a response from my Arudino that I “trigger” with I’ve tried looking at the response from my Arduino in my terminal, by using the following command:…

replacing “”” by empty character

I need to replace ” (ASCII value 34) char by empty character “”. In output, instead of quote i get an “?” question mark character. I tried to use things like: My code: Any ideas how to fix that? For clarification: the strings in mystring are like: “hello” “place…