The way I understand it, the code above allows arbitrary code (or program) execution — what makes this vulnerable, and how does one take advantage of this? Answer You can override the PATH variable to point to a directory with your custom version of echo and since echo is executed using env, it isn’t tr…
Tag: linux
What is a .pid file and what does it contain?
I recently come across a file with the extension .pid and explored inside it but didn’t find much. The documentation says: A Pid-File is a file containing the process identification number (pid) that is stored in a well-defined location of the filesystem thus allowing other programs to find out the pid …
Undefined references in makefile
Ok, ive read about 10 tutorials, but i keep getting errors all the time, i have 5 files, main.cpp class.cpp, class.h and functions.cpp and functions.h. All of those use functions from different objects meaning that functions in functions.cpp uses objects from classes.cpp. My makefile looks as follows I keeps …
Using elisp, how to start, send-keys-to, and stop a command in emacs terminal emulator?
Using elisp (not interactive key-chords), how can I run a command in emacs terminal emulator; and how can I send key-presses to that buffer? Starting term seems to require (term “/bin/bash”), which has no scope for running a command. I assume that might be because term is intended as an interactiv…
Copy n bytes of data x to file
How we can copy for example 10 bytes of ‘7’ to a file? How can I generate those 10 bytes of 7? For example for n bytes of zero I’m doing dd if=/dev/zero of=myFile bs=1 count=10. Answer You can send the zeros to stdout and translate them to 7, or what ever you like.
Git man page seems incorrect
I’m new to git, so please excuse me if this is a dumb question. I have installed git 1.7.7.4 from source on SLES Linux, and all looks good. I have added the following to $MANPATH: When I do man git, I’m presented with This doesn’t look like a man page for the git command I use from the comma…
taking a screen shot of a specific area on the screen once every second
I would like to be able to take screen shots of a specific area on the screen once every second and have the file named MMDDYYYYHH:MM:ss is this possible using the command line and a program. I was thinking of using a script like this But I don’t know the commands to access the program to change the are…
Adding a status bar to c++ console applications
I am making a linux application using C++ and it will print info out to the console. Parts of the program will take a while to compute and I would like to add a status bar in the console similar to the one used in wget (I put my own depiction below). What would be the best way to accomplish
Compiling and linking a 32 bit application on Debian 64 bit
I am currently trying to compile and link a 32 bit application on my Debian 64 bit, but it fails at link time. The command I’m using (in my Makefile) to compile is: This seems to work. Then I link with the following command: This fails and gives the following errors: What I’ve tried so far (usual …
A simple C++ shared memory program written on linux: segmentation fault
I got the code from a tutorial on shared memory. It worked until I defined struct LOCK and tried to write LOCKs instead of char* into the shared memory. Could someone please help me figure out the problem here that causes the segmentation fault? Answer You are placing vectors and strings into shared memory. B…