linux

string/array operations in bash?

I want to so something like that in bash (.bashrc) so the alias is set based on which comp the user logged in. I don't know how to get the 210 from 10.0.0.210 and then the best way of going through of the list 'user=xxx' $radek ='210' $mike ='209' #SSH_CLIENT='10.0.0.210 53039 22' <--- system variable $user = based on the 4th part of...

Physical location aware user space memory allocation in Linux (memory controller affinity)

I want to test the performance variations that may happen if memory is allocated and accessed from different physical CPUs and from different embedded memory controllers for a 64 bit, 2 CPU, 16 core Intel Xeon 5500 CPU based server. (Dell T710) Looking at the vendor white paper i can see each physical CPU has 3 independent memory contro...

Installing phpMyAdmin on Cent OS 5.5

Sorry guys, I posted it on here by mistake... I have created it over at server fault: http://serverfault.com/questions/167302/installing-phpmyadmin-on-cent-os-5-5 ...

Query DNS in Ubuntu

Hello, I use two DNS servers a public one (8.8.8.8) and a local one (192.168.1.20) In ubuntu, If I wrote both DNSs 192.168.1.20, 8.8.8.8 it will always query the first and until the first is down and then it will start querying the second. And of course I have to make the local point again to 8.8.8.8 Like this i have almost no problems...

how does kernel handle new file creation

hi, I wish to understand the way kernel works when a user/app tries to create a file in a directorty. The background - We have a java applicaiton which consumes messages over JMS, processes it and then writes the XML to an outbound queue+a local directory. Yesterday we obeserved unsual delays in writing to the directory. On 'ls|wc -l' ...

Can I reliably use the value os.version to determine the Linux distro?

I'm parsing customer logs, I need to want to figure out which distro they are running. I can't run commands on their systems, all I have is the logs. The property os.name always returns, Linux, but the os.version returns what appears to be the kernel version? For instance, 2.6.9-42.0.3.ELsmp or 2.6.5-7.283-smp. After some google is app...

Export sqlite3 table to a text file from C program

Iam having a database in Sqlite3. I am doing all my operations by writing application in Linux C(API:sqlite3_exec). Currently Iam trying to export the database to a text file. Can anyone suggest query statements fro the same. ...

How to debug program with signal handler for SIGSEGV

I am writing a plugin for a application, occasionally a SIGSEGV would be throw out. However, the application catches the signal SIGSEGV. In other word, The plugin is a dynamical library. The error occurs in my plugin and dynamical library. But the applcation handle the sSIGSEGV and exit normally. So, it is quite difficult for me to debug...

Checking changes made before/after installing application?

On Linux, I need to know which files were added/modified/moved/deleted after compiling and installing an application from source code, ie. the command-line, Linux equivalent to the venerale InCtrl5. Is there a utility that does this, or a set of commands that I could run and would show me the changes? Thank you. Edit: The following...

Migration from OSF/Motif & Xt to GTK+

I have a class called XClient written with the Xt (X Tools Intrinsic library) to setup a multisocketed connection. This XClient class was meant for OSF/Motif GUIs to extend XClient (so the GUI could talk on sockets). I am trying to migrate into a GTK+ environment which does NOT use the Xt library for portability reasons. Is it still p...

Statically linking new libc symbols to use with a lower libc version

I have an app that uses eventfd and timerfd kernel syscalls. For that use you need a modern kernel and a libc that supports them, at least 2.8. My current situation is, I have a system with the proper kernel but a 2.7.11 libc version which obviously does not support the required functions for the new syscalls. But, as those 2 interfaces...

Xt (X Tools Intrinsic) Toolkit. What is an application context?

Hi. I found a GTK-Xt wrapper from SourceForge, that basically allows the creation of an XtAppContext app_context variable from GTK+. What is the purpsoe of this app_context? Will I be able to use Xt functions in conjunction with GTK+ ? Thanks, friends. ...

802.3 header length always 256 when using raw sockets in Linux

I have the following code to open a raw socket and send over it. In the send function I have a trace statement showing me that the length of my packet is 21. However, when I view the packets on the receiving end using a packet sniffer, I see: The actual packet length is 60. The length (as given in the 802.3 header) is 256. Neither of...

observing stdout of another process

Here's the hypothetical scenario: I'm running a test script on some hardware attached to box A, which I have root access to. This test script requires minimal user input (flip a switch every half hour or so). About an hour and a half into the test process, I realize that this script takes a long, long time to finish, to the tune of eig...

How to tail -f the latest log file with a given pattern

Hello, I work with some log system which creates a log file every hour, like follows: SoftwareLog.2010-08-01-08 SoftwareLog.2010-08-01-09 SoftwareLog.2010-08-01-10 I'm trying to tail to follow the latest log file giving a pattern (e.g. SoftwareLog*) and I realize there's: tail -F (tail --follow=name --retry) but that only follow o...

what is unix/linux internals ?

When somebody asks me about how strong you are in unix/linux internals ? What do they really mean ? Though i have some idea, i would like to hear from some experts that, what is really meant by unix/linux internals. My ideas are, i have to be strong in, linux boot process user creation how does a command executes filesystem related ...

Set environment variables in C

Hi, Is there anyway to set environment variables in linux using C? I tried setenv() and putenv(), but they don't seem to be working for me. Thanks in advance. ...

Editing System Files With Elevated Permissions and PHP

I am attempting to create a very simple web interface for changing some system settings on a network appliance. I am fairly new to PHP and becoming painfully aware of how easy it is to do things in hacky ways, so I am trying to write everything with the best practices in mind. That said, what would the best practice be for editing files...

Perl system call causes core dump but $? remains zero

I've got a Perl script (running on Xubuntu Lucid Lynx within VirtualBox) that wraps around several C/C++ binaries feeding the inputs of one into the others. One of the lines consists of generally: my $ret_code=`cat $input | c_binary`; my $ret_val= $?; For some input files the code causes a coredump, but both $ret_val and $ret_code are...

How to tell if user selected "Run In Terminal"

When you double-click a bash script, Ubuntu asks if the user wants to Display, Run, or Run In Terminal... Is there a way within the script to determine if the user chose "Run In Terminal"? ...