Skip to content

Using sysctl interface from kernel module

I am trying to access tcp_pacing_ss_ratio defined in tcp_input.c from a kernel module. The variable can be modified using the sysctl command in user space. It is however not exported and cannot be referenced directly from the module. What is the simplest way to access a sysctl entry from a kernel module? Answ…

ld fails to find glfw3

I’m trying to build the OpenGL Super Bible 7th edition code samples on Ubuntu 16.04. First I have to run cmake, which seems to work, and then I have to run make to compile. I believe I have installed glfw3 and the Mesa OpenGL packages. When I execute cmake (after installing libglfw3 and libglfw3-dev), I…

Where is mono’s log file?

I’m having an issue with a program crashing on mono, I have an idea why but I can not confirm it as I can not find the log location for mono on ubuntu. I’m developing on windows however I’m deploying to a ubuntu server. So my question is, where is the standard log location for mono on ubuntu…

Using `groupadd` in Docker container

I’m using Ubuntu 14.04 Trusty Tahr, and a quick peek at /etc/group reveals When I tried to add staff, I got an error message as I would expect (being that staff is already defined with gid 50). The unexpected part is when I tried to add a user with the staff group. What am I doing wrong here? It don&#82…

set length of captured group

I would like to format the log of my server to be readable easily when I do a “tail -f”. My log look like : I would like to obtain : Where ‘_’ is a white space. For now I use : And I get : It is possible to set the length of captured group 1 2 3 ?

if condition implementation in linux shell script

I have a list of 100+ folders in a linux at a folder path “files/data” where I already have basic script “list.sh”. When I run it… It is listing all the 100+ folders (amazon, apple, cola, pepsi, and etc…) in side the “files/data” folder. But I am looking for som…

Matching files using awk in linux

I have 2 files: 1.txt: 2.txt: I want 2 files as output: One is result.txt which contains lines from 2.txt whose match is in 1.txt and another is left.txt which contains lines from 1.txt whose match is not in 2.txt Expected output of both files is below: result.txt left.txt I tried 1-2 approaches with awk but …

Copying folders but not tar files in linux

I have a folder, which consists of many folders and many tar files. (this many is around 1000) I want to write a script to copy all folders with their contents to another directory, but I do not want to copy tar files. I already know by writing cp -a /source/ /path/ I can copy a directory with its contents