Skip to content

Is there an invalid pthread_t id?

I would like to call pthread_join for a given thread id, but only if that thread has been started. The safe solution might be to add a variable to track which thread where started or not. However, I wonder if checking pthread_t variables is possible, something like the following code. Where some_invalid_value…

Change process name in Linux

I’m on Linux and I am forking/execing a new process out of my C spawn application. Is it possible to also change the naming of these new child processes? I want to be able to identify the process being started in case something goes wrong and I need to kill it manually. Currently they all have the same …

clear scrollback buffer of Linux Virtual Console Terminals

I’d like to clear the scrollback buffer on Linux console VTs programmatically. i.e. not just clear the current visible screen, but the entire scrollback buffer, too. I.e. everything that after a clear screen would still be visible with Alt-PgUp should be gone too. Anybody got an idea how to achieve that…

How to get formatted date time in python

I want my Linux Filename like this How can i get the date variable formatted like above in Python IN bash i write Answer You can use the same formatting string in strftime on a datetime object: Incidentally, I’d just like to put a word in for the joy of ISO-8601 date formatting