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…
Tag: linux
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 …
Is there an easy way to aggregate disk usage by file type in a directory?
I have a folder, which contains 10 folders, which contain a huge mess of files. I’d like to see, not which files specifically are using the most, but which kinds of files (.png, .jpg, .txt etc.) are using the most disk space. I saw a previous post that listed the disk usage of a file type by giving the …
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,…
Centos 7 with PHP 7.2 Pthreads unable to load redis.so
I recently setup a new Centos 7 system with php 7.2 and Redis. This is working fine. This was my yum install of the php packages. yum install php72.x86_64 php72-php-cli.x86_64 php72-php-common.x86_64 php72-php-devel.x86_64 php72-php-fpm.x86_64 php72-php-gd.x86_64 php72-php-json.x86_64 php72-php-mbstring.x86_6…
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…