I am new to Linux and I am trying to compile some code that needs environment variables set first. The script is in cshrc, but whenever I try to run that code I get "if: badly formed number" errors. I want to run it in bash instead. Is there an easy way to convert cshrc to bashrc?
...
The function which creates shared memory in *inux programming takes a key as one of its parameters..
What is the meaning of this key? And How can I use it?
Edit:
Not shared memory id
...
On a Linux device (using Android [Eclair] with a 2.6.29 kernel), I seem to have some contents in my cache that never go away.
I would like to be able to examine the contents of my cache to find the culprit. I've looked at mount for any tmpfs that may be causing it, but they are taking up very little space.
What other types of things co...
My Perl code installed several (4) rpm files as root. the next install removes them (rpm -e) before installing a newer version. One does not remove, with rpm -e giving the error that it is not installed. However, later when the updated file is installed, the message is given that it is already installed.
Manual attempts to remove give...
How on earth does plesk actually work? I have a VPS which is on centos 5.2 and has php 5.1.6. I have updated plesk to version 9.52 and it claimed to do some form of php update but it hasn't as far as i can see. How can i update to php 5.2 (centos 5.4) without breaking plesk Virtuozzo?!
Plesk seems to be some kind of crazy black magic th...
I have a PHP script that runs a .bat file on my windows machine using
$result = system("cmd /C nameOfBatchFile.bat");
This sets some environmental variables and is used to call Amazon EC2 API from the command line.
How do I do the same from a Linux server? I have renamed my .bat file to a shell (.sh) and changed the script to use 'ex...
Receiving error: [debug] mod_headers.c(663): headers: ap_headers_output_filter()
after I included this within the htaccess file:
# 6 DAYS
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=518400, public"
</FilesMatch>
# 2 DAYS
<FilesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=172...
I'm trying to do something like this:
mysqldump --user c1bt3 --password=blah c1bt3 > c1bt{date}.sql
where date is replaced with the current date, i.e. c1bt5-11-10.sql, and I'm trying to do it from a linux shell script.
Any ideas how I can do this?
...
I am currently involved in a project which requires me to repeatedly take snapshots of the screen. I am using qt's grabScreen function to do the same.
The screen freezes for half a second every time the program takes a snapshot causing the computer to seem to be very slow :(
Can anybody suggest me a better method of doing this ?
...
Hi All,
Big picture: I want to render an RGB image via GTK on a linux box.
I'm a frustrated GTK newbie, so please forgive me.
I assume that I should create a Drawable_area in which to render the image -- correct?
Do I then have to create a graphics context attached to that area? How?
my simple app (which doesn't even address the r...
I ended up with a huge, single line string literal (don't ask me how) where everything is escaped (mostly), including new lines and double quotes. Problem is, I want the original string. The string is huge so I'm not even sure how to begin. Here's what I have:
"This\n is \"nice\",\nain\'t it?"
This is what I want:
This
is "nice",
ai...
I have a doubt in accessing some invalid data. How can the OS cause a segmentation fault for a scenario like this:
Suppose a chunk of data is 100 bytes long, aligned at the beginning of a 4K page. If we access the valid data within the first 100 bytes of the page, this will load the page into memory, and put the page table entry is in T...
XML one is something like that:
<dict>
<key>2</key>
<array>
<string>A</string>
<string>B</string>
</array>
<key>3</key>
<array>
<string>C</string>
<string>D</string>
<string>E</string>
</array>
</dict>
XML Two is something like that:
<dict>
<key>A</key>
<ar...
So, How Do I find and copy all files,
*.a
that are in,
~/DIR{1,2,3,...}
to
~/tmp/foo?
...
I've installed the development version of Crunchbang, a linux distro based off Debian. I got Ruby and Rubygems installed, but I can't get the gems I've installed to load. Here is a command-line session:
$ ruby -v
ruby 1.9.1p378 (2010-01-10 revision 26273) [i486-linux]
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.6
...
I have a few files in a directory with names similar to
_system1.log
_system2.log
_system3.log
other.log
but they are not created in that order.
Is there a simple, non-hardcoded, way to cat the files starting with the underscore in date order?
...
I am using RSync to copy tar balls to an external hard drive on a Windows XP machine.
My files are tar.gz files (perms 600) in a directory (perms 711).
However, when I do a dry-run, only the folders are returned, the files are ignored.
I use RSync a lot, so I presume there is no issue with my installation.
I have tried changing permi...
It seems that the RPM logic is quite different from what I know already and I am having some issues understanding the "RPM logic". For my work, I have to create a documentation on "How-to create a RPM package on Red Hat 5".
I'm used to Debian and it's derivatives (Ubuntu, and so on) and thus to Debian packages (aka. .deb files).
From ...
Plus, The program runs on a arm device running Linux, I can print out stack info and register values in the sig-seg handler I assign.
The problem is I can't add -g option to the source file, since the bug may won't reproduce due to performance downgrade.
...
Given that I have a pointer to a function (provided by dlsym() for example) and a linked list of typed arguments, how can I construct a C function call with those arguments?
Example:
struct param {
enum type { INT32, INT64, STRING, BOOL } type;
union { int i32; long long i64; char *str; bool b; } value;
struct param *next;
};...