Skip to content

Tag: linux

Weird behavior in GDB when defaulting copy/move constructors

I have the following code which seems to behave weirdly in GDB depending if the copy/move constructors are defaulted or not. I fire up GDB, add a breakpoint on the last cout in main and run “p t.get()” and I expect it to be 42 but depending on the value of the macro CUSTOM I get either 42 (when CU…

Control loop time with usleep

I try to make sure the execution time of each loop to 10ms with usleep , but sometimes it exceeds 10ms. I have no idea how to solve this problem, is it proper to use usleep and gettimeofday in this case? Please help my find out what i missed. Result: 0.0127289 0.0136499 0.0151598 0.0114031 0.014801 Answer To …

Prevent removal of busy kernel module

I have a simple kernel module that creates a character devices and does nothing with it. I wrote this user-space program that tests the character device. The program exits after 10 seconds. But if in the meantime I remove the module with rmmod or modprobe, then after 10 seconds the program segfaults or hangs,…

File is not sort after sort

I have a problem with sorting my file. My file look like this geom-10-11.com 1 geom-1-10.com 9 geom-1-11.com 10 geom-1-2.com 1 geom-1-3.com 2 geom-1-4.com 3 geom-1-5.com 4 geom-1-6.com 5 geom-1-7.com 6 geom-1-8.com 7 geom-1-9.com 8 geom-2-10.com 8 geom-2-11.com 9 geom-2-3.com 1 geom-2-4.com 2 geom-2-5.com 3 g…

Replace string pattern with a string in linux file [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago. Improve this question I am a newbie to Linux. Need to replace With using sed or some alternative…

Troubles with case of files extensions on Windows

I have a makefile I use under both Linux and windows using arm-none-eabi tool chain. The project contains assembler files with either .s or .S extension depending on the need of the preprocessor. Under Linux, the makefile rules can easily distinguish those target files and separate rules are use for each of t…

Arin Bulk whois data perl Can’t locate BulkWhois/Schema.pm in @INC

I have tried this on two operating systems (first on Fedora then on Ubuntu(recommended)) and I am still confused so I am reaching out to the community. I have access to ARIN’s bulk whois data and want to parse the xml file and throw it into a database. I came across a Perl script that does exactly this …

Iterating Ansible setup command

I want to use ansible setup module to retrieve hosts specs and I tried with a bash for loop. Ansible version: 2.4 My hosts inventory has been defined in a group of machines which I called rhelmachines I would like to collect the following list of variables called “specs” I am then trying to includ…