linux

C++ ctor question (linux)

environment: linux, userspace-application created via g++ from a couple of C++ files (result is an ELF) there is a problem (SIGSEGV) when traversing the constructor list ( __CTOR_LIST__ ) (note: code called via this list is a kind of system initialisation for every class, not the constructor-code I wrote) when I understan...

What make g++ include GLIBCXX_3.4.9?

I compiled 2 different binaries on the same GNU/Linux server using g++ version 4.2.3. The first one uses: GLIBC_2.0 GLIBC_2.2 GLIBC_2.1 GLIBCXX_3.4 GLIBC_2.1.3 The second one uses: GLIBC_2.0 GLIBC_2.2 GLIBC_2.1 GLIBCXX_3.4.9 GLIBCXX_3.4 GLIBC_2.1.3 Why the second binary uses GLIBCXX_3.4.9 that is only available on libstdc++.so.6.0...

How can a bash script know the directory it is installed in when it is sourced with . operator?

What I'd like to do is to include settings from a file into my current interactive bash shell like this: $ . /path/to/some/dir/.settings The problem is that the .settings script also needs to use the "." operator to include other files like this: . .extra_settings How do I reference the relative path for .extra_settings in the .setti...

Stop and start running again processes in Linux using C++

Hello, I have two process and a shared memory zone, my workflow is like this. The process A write some data in the shared memory, after that it should wait and send a signal to other process B to start running. The process B should read some data from the shared memory do some stuff write the result, and send a signal to the process A t...

how to convert string to binary integer file using command line under linux

What i want is to take an integer represented as a string, for example "1234", and convert it to a file called int, containing a 32-bit big endian integer, with the value 1234. The only way I have figured out to do this is something like echo 1234 | awk '{printf "0: %08X", $1}' | xxd -r > int which is a bit nasty! Does anyone know a...

Provisioning new LVM volumes?

I looking to use LVM to easily limit a users usable disk space. Is it possible to provision new LVM volumes from unallocated space LVM space without having to create/initialize all the drives and partitions again? Lets say I have a volume group named "datag". Can create new logical volumes as needed (lvcreate)? Or do I need to create ...

Programmatic iPod Backup on Linux

Are there any publicly available libraries or APIs out there on Ubuntu that allow me to programmatically archive the contents of my iPod? If no library or API exists, what alternative options do I have for saving the contents of my iPod? ...

What size should I allow for strerror_r?

The OpenGroup POSIX.1-2001 defines strerror_r, as does The Linux Standard Base Core Specification 3.1. But I can find no reference to the maximum size that could be reasonably expected for an error message. I expected some define somewhere that I could put in my code but there is none that I can find. The code must be thread safe. Whic...

Bash Shell - What is equivalent of DOS shell F8 ?

When working an interactive bash session, one aspect from the Windows shell I miss is the F8 key where you start typing a command, hit F8 and the shell finds the most recent command entered in history that matches what you have typed so far. e.g. me@Ubntu07:~>cd /home/jb<F8 Key Here> brings up my prior command: me@Ubntu07:~>cd /home/...

Which way to go in Linux (Qt or KDevelop)

Which one of the IDE is good in terms of support for debugging, implementation and usabality. Qt or KDevelop? Various duplicated: http://stackoverflow.com/questions/24109/c-ide-for-linux http://stackoverflow.com/questions/86676/is-there-a-good-and-free-ide-for-cc-in-linux http://stackoverflow.com/questions/164693/whats-the-best-stab...

Profiling a multi-process program

I'd like to profile a program that forks and spawns several child processes. I want to see how much time is spent in some of the functions. What profiler can handle this job? ...

What tools do I need to develop in actionscript (in Linux)

I've never developed flash before but I have a project where I want to use an actionscript 3 library and I'm not sure what tools I need to start. To further complicate things my main development box is an ubuntu box. Are there any necessary packages I need to install? Or any .deb's I can buy? Thanks ...

How to test Internet connection speed from command line?

There's plenty of websites for it, but they're all Flash, not of much use for servers without graphics mode. Any tool I can use to test up/down bandwidth from Linux command line? ...

How do I (successfully) decode a encoded password from command line openSSL?

Using PyCrypto (although I've tried this in ObjC with OpenSSL bindings as well) : from Crypto.Cipher import DES import base64 obj=DES.new('abcdefgh', DES.MODE_ECB) plain="Guido van Rossum is a space alien.XXXXXX" ciph=obj.encrypt(plain) enc=base64.b64encode(ciph) #print ciph print enc outputs a base64 encoded value of : ESzjTnGMRFnfV...

Do line endings differ between Windows and Linux?

Hi all, I am trying to parse the linux /etc/passwd file in java. I'm currently reading each line through the scanner class in java and then using string.split() to delimit each line. The problem is that the line "list:x:38:38:Mailing List Manager:/var/list:/bin/sh" is treated by the scanner as 3 different lines: 1) "list:x:38:38:Maili...

Is it possible to predict a stack overflow in C on Linux?

There are certain conditions that can cause stack overflows on an x86 Linux system: struct my_big_object[HUGE_NUMBER] on the stack. Walking through it eventually causes SIGSEGV. The alloca() routine (like malloc(), but uses the stack, automatically frees itself, and also blows up with SIGSEGV if it's too big). Update: alloca() isn't f...

Finding an interface name from an ip address

I need to get the interface name by providing ip address.There is no system call to get this. I need an implementation for this in c or c++ Already thee reverse of this is available in this forum. http://stackoverflow.com/questions/259389/finding-an-ip-from-an-interface-name ...

How to extract a text part by regexp in linux shell?

How to extract a text part by regexp in linux shell? Lets say, I have file where in every line is an IP address, but in different position. What is the most simple way to extract those IP addresses using common unix command-line tools? ...

What's the best way to compile Ruby from source on 64-bit RedHat Linux

On RedHat Enterprise Linux 5 the latest Ruby version available via RPM is 1.8.5. My Rails app requires 1.8.6 or above so I need to compile Ruby from source. I have tried the following to build it and it seems to build ok, but then I'm seeing gcc compilation errors when trying to run a plug-in which requires RubyInline. There seems to ...

Setting the umask of the Apache user

I am setting up a LAMP server and would like to set Apache's umask setting to 002 so that all Apache-created files have the group write permission bit set (so members of the same group can overwrite the files). Does anyone know how to do this? I know that on Ubuntu, you can use the /etc/apache2/envvars file to configure the umask, but...