Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago. Improve this question I am setting up my first Node.js server on a cloud Linux node and I a…
how to extract a substring in bash
I have the following string in bash with length > 4 and I want to extract into str2 the 5 first charachter of str. So How to do it with bash? Answer Do use the expression So in this case: See other usages: Taken from: – wooledge.org – How can I use parameter expansion? How can I get substrings?…
xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection
I’ve tried various ways to coerce xterm (versions 285 and 292) to copy the selection to the CLIPBOARD clipboard whenever I press Ctrl-Shift-C. The most promising way thus far has been, in ~/.Xresources, to put this: Ctrl-Shift-V works perfectly, but the copying has a nuance… If I restart xterm, hi…
How to distinguish same jars started from different directories?
I started several (eight) jar files with the same name from different directories and different config files. Now I have to kill a specific one. But neither jps and ps gives enough information to distinguish them. How could I find out which java process was started from which directory? Platform : linux (ubun…
hex code implementation for spawning a shell
I am trying to implement the codes given in smashing the stack for fun and profit by Aleph to learn the basics of buffer overflow attacks. Machine architecture: Ubuntu 12.10 64 bit programs compiled using -m32 flag in gcc So far, I have managed to spawn a shell using the assembly instructions. The next step i…
I am really confused with this kind of compilation error( C ffmpeg Qt)
I downloaded the latest ffmpeg source code and successfully installed it on Ubuntu But I failed to compile a simple demo.(I did included proper headers) Here are the error messages ,just to name a few: Can you help me solve this problem? Contents Added: e.g this is my includes e.g AVFormatContext is declared …
C — using chdir() function
I’m trying to use chdir() function but can’t work it out. I’m reading from user and find out if he is using “cd”. I always get an error. What am I doing wrong? Code: Answer If the line being entered is something like: then the directory starts at offset 3, not 2. In addition, fge…
Cutting the column including size
I want to cut the column which include the size of files . I use ls -l to view info about files in current localization . I save info about file in txt file ls -l > info.txt , and now I want to cut the column including size . I do cat info.txt | cut -d” -f6 but i
Grouping common elements using awk
The following table illustrates a brief snapshot of the data that I wish to manipulate. I am looking for an awk script that will group similar elements into one group. For eg. if you look at the table below: Numbers (1,2,3,4,6) should all belong to one group. So row1 row2 row4 row8 will be group “1̶…
Is the sscanf function in the Linux kernel susceptible to buffer overflow attacks?
From what I understand, a typical buffer overflow attack occurs when an attack overflows a buffer of memory on the stack, thus allowing the attacker to inject malicious code and rewrite the return address on the stack to point to that code. This is a common concern when using functions (such as sscanf) that b…