Skip to content

Linux default scheduler alternatives

The Linux kernel implements the Completely Fair Scheduling (SCHED_NORMAL) algorithm as its default scheduling algorithm for scheduling real-time processes. How to modify the linux kernel such that the default scheduling policy is set to round-robin (SCHED_RR) or any other scheduling policy ? Is there a generi…

Linux, scanf in loop, while stdin already loaded

I have trouble with scanf and a loop on linux. If in the shell Linux, if I execute my file like this : Then the result will be this : Here : lol Here : lol Here : lol Here : lol Here : lol Here : lol Here : lol Here : lol Here : lol Here : lol

Building meta-virtualization layer in yocto

I am trying to add the meta-virtualization layer in my yocto project. The layer depends on openembedded-core and multiple layers provided by meta-openembedded. Following is the structure of my bblayers.conf file after adding the meta-virtualization layer and it’s dependencies. However, when I try to bui…

How to remove files without certain extension?

How to remove all files without the .txt and .exe extensions recursively in the current working directory? I need a one-liner. I tried: Answer Try this. The above command will remove all the files other than the .exe and .txt extension files in the current directory and sub directory recursively.

In bash got unwanted newlines after sed and cat >>

I’m trying to substitute some lines in /etc/hosts file with my script here: It searches e.g. for lines like and replaces the line (if it’s found) with a sed command to nothing, but adds afterwards e.g. to I’m having to do (?) this because my LAN network addresses are changing very often (exa…

Get specific day of week of the upcoming Canada day on Linux

How to use cal command to add the calendar of next July to the end of the file, for example, myfile, and what day of the week the upcoming Canada Day fall on? So far I just have this command: I feel like I am not doing it correct and I don’t know which command to use, to find the