linux

Converting UTF-8 Characters to Upper/Lower case C++

Hello All, I have a string that contains UTF-8 Characters, and I have a method that is supposed to convert every character to either upper or lower case, this is easily done with characters that overlap with ASCII, and obviously some characters cannot be converted, e.g. any Chinese character. However is there a good way to detect and co...

Unexpected end of file

Hi, I've been asked to modify a bash script at my internship and since yesterday was the first time I started reading up on Bash syntax, I'm having a hard time figuring out a "syntax error: unexpected end of file" error. I was wondering if anyone would be able to help me out. The last part of the script is: echo " " >>${MAILLOG} ...

How to fix path variable in bash on Mac OSX Snow Leopard

This might be a noob question, but I need help. I screwed up my terminal by trying to alter my path variable using the following command: $ sudo nano .profile Before I did that, if I were to type: $ echo $PATH I would get: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin When I opened .profile in nano it told me that the fil...

How do you get info for an arbitrary time zone in Linux / posix?

Ideally, what I'd like to be able to do is take the name of a time zone and call a function to ask for its corresponding time zone info (offset from UTC, DST offset, dates for DST switch, etc.) in Linux. However, I can't find any way to do this. The information exists in /usr/share/zoneinfo/ in the various binary files there, but I don't...

Linux open() file descriptor

If I open a same file(.txt file) a few times in different threads, the file descriptor returned would be different. If I tried to write() using the file descriptor, any chance of the write function be blocked since when the multiple threads trying to write to the same file? My concern is when a thread call write to a single file, when t...

Bash script for searching and replacing tags.

I have a file have lots of string tags like </usr/share/some_pattern>, all they have in common is they all begin with a < and end with a >, how can write a bash script to remove all these tags(including the strings inside)? ...

Undefined reference while using g++ for compilation

Hi, I am getting following error p.c uses some of the function implemented in md4.c. p.c , when compiled with gcc works but it does not work with g++, gives undefined method error. Am I missing something obivious ? [prafulla@ps7374 sample] $g++ -c -o md4.o md4.c [prafulla@ps7374 sample] $gcc -c -o md4.o md4.c [prafulla@ps7374 sample] $...

which language (python/perl/tcl) on linux doesn't need to install the third-party libs?

When deploy java app on linux, we don't need to install anything, all third-party libs are jar files and we only update classpath in script file. But java needs jre which is quite large. So is there any other language supported by linux can do that? By default our server only support perl/python/tcl, no gcc available, sigh. ...

[Linux - OpenSuse 11.3 - KDE] Mouse not working

Hi Everyone, First of all, I'll appologise, I'm a complete Linux newbie. The thing is I'd gladly learn it and get rid of windows in a while, and OpenSuse seemed like a good place to start. I had to install OpenSuse by using the safemode kernel, otherwise it crashed, but it boots just fine now. The problem is, the (p/s2) mouse and the ...

Install ffmpeg in linux server

Please help me to guide me in how to install ffmpeg and ffmpeg-php extension in linux based server. I surfed a lot in the net. I got lots of answers, all of that says to give some command line script in the linux command promt. I am using the cpanel server and is confused how to do this, also I cant find where to gave these commands. Or ...

How to find out when process exits in Linux?

I can't find a good way to find out when a process exits in Linux. Does anyone have a solution for that? One that I can think of is check process list periodically, but that is not instant and pretty expensive (have to loop over all processes each time). Is there an interface for doing that on Linux? Something like waitpid, except some...

Bash: delete based on file date stamp

I have a folder with a bunch of files. I need to delete all the files created before July 1st. How do I do that in a bash script? ...

error : storage class specified for parameter

I have a c code written.when i compile it on Linux then in the header file it says the following error : storage class specified for parameter i32 , i8 and so on typedef int i32; typedef char i8; I am new to linux....can anyone help plzz ...

Linux VM appliance - best way to edit source code from the Windows host?

I installed a Drupal 6 appliance in VMWare workstation for the development of a new site. I realize that I could have choosen a Windows-based VM that comes with its own GUI, and this problem wouldn't be one. I do prefer the lean and headless Linux VM, though, because it is much more efficient with resources of the host computer, and I ca...

basename_r/dirname_r in Linux

Some POSIX functions are not threadsafe. Examples are dirname and pathname. The dirname() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe. On some platforms there are reentrant versions of dirname and pathname: dirname_r and pathname_r. As far as I found out there ar...

How to read duration of an FLV file in PHP / through shell command?

Hi, How do I determine the length of an FLV file from within PHP or through shell access? I think a dedicated libraries is available, but I'm really looking for a quicker more direct way. ...

Need to Write C code from C++ Code ?

I need to write my 4-5 .cpp and .h file to c code. In C++ code we have defined class,constructor,destructor,function in the class. How to convert them in C code ? Can somebody give me example of it so that i can implement it or provide link so that i can better explore it to my C code ? How to implement all the functionality i mean cons...

Color console boxes in linux terminal

So I have noticed that things (for lack of a better word) like this and are just done in the console using special characters and changing their color. I know how to accomplish this on windows but how would I go about doing this in linux (I am using ubuntu if that matters)? Are there any predefined classes out there to help const...

How do i remove a file from svn's ignore list?

Hi, I'm running Linux and i put some files in svn's ignore list. Now i want to remove it. How could I do that? Command line svn... Thank you ...

Get latest 100MB Of text file in linux.

Hi, How do I get the latest 100MB from a text log on Linux? Is there a tool for it, or could you point me on a script? I have no programming experience on Shell Scripting, Perl or Python, and I don't want to install mono so I can write it in C#. Thanks!! Yvan Janssens ...