I need to use a ffmpeg wrapper (so we can use it in unity) for a lecture. Unfortunately the teachers only provide a solution to do this for Windows. They are referring to https://github.com/Ruslan-B/FFmpeg.AutoGen which we should use to generate a wrapper for our OS. That’s where my problems begin: I ha…
Linux: Append variable to end of line using line number as variable
I am new to shell scripting. I am using ksh. I have this particular line in my script which I use to append text in a variable q to the end of a particular line given by the variable a containing the line number . Now the variable q can contain a large amount of text, with all sorts of
Is there a quick method on linux to switch to recently accessed n folders (n > 1)?
We can use cd – to access the most recently accessed folder, but what if I want to quickly switch to the last but one folder accessed? Answer Sure there’s a way! You want the shell builtin pushd.
Undefined reference error while compiling
I’m trying to compile a project that has multiple *.c files and *.h file when I type the following command: the hdr folder is where the *.h files are located, the .o files are created but when I try to link them using the command: I see errors Answer Using a Makefile is very common for this task example…
common profile to record ssh sessions
I need to be able to record all ssh sessions on my server. After fumbling around with pam.d auditd, I found this enter link description here. And it looks to be working pretty well. However, when you “clear” the screen, your session log gets wiped as well. Is is possible to open a new log file whe…
Environment variables missing when executing via pkexec
If I execute print os.environ without pkexec I get lots of useful system environment variables, however, once I execute with, most of them are gone. How can I get them back with using pkexec? I understand there’s a workaround using sudo but haven’t found one yet for pkexec Answer In short, you can…
Change child process’ termination signal at runtime
Using clone() to fork a process you can specify the signal a child process should send its parent on death instead the “normal” SIGCHLD. Is it possible to change the set termination signal after the child was created? Either by the child or the parent? Answer I (quickly) scanned Linux’ sourc…
loadable library and perl binaries are mismatched
Can not run Pac-manager after installing deb file, Downloaded Pac Manger from : https://sourceforge.net/projects/pacmanager/ When run pac in the terminal , showing below problem xs/Vte.c: loadable library and perl binaries are mismatched (got handshake key 0xdb00080, needed 0xdb80080) System: Linux PC-pc 4.4.…
How do I match and kill a specific process without accidentally including unrelated processes?
I have two Tomcat processes, one is called event-ws, another is called app-event-ws. I sometimes need to kill event-ws from a shell script: The above will find and kill both of them; how can I find exactly find one of them? Answer pgrep / pkill are the best tools to use in this case, instead of ps: Each comma…
For zless to read empty gz file
I have tried to use zless to read (.gz) files. However, when (.gz) file is empty, it shows a message How to force zless to read an empty gz file without typing Y for many times. or Is that possible to return something like Answer zless is just a wrapper around less. You need to look at man less: -f