linux

scp file not setting correct owner

Does SCP have a problem setting file permissions or have I misconfiguration my server? Updated (19/Mar/09): Actually: There is no problem - I have just misunderstood the way permissions work - they don't change when the file contents are changed Use case: There is a file on a server that I want to edit called "importantFile.txt". The ...

Entries in /proc/meminfo

I can make sense of most of the information contained in /proc/meminfo like total memory,buffers, cache etc. Could you tell me what do the less obvious ones like *AnonPages,Mapped,Slab,NFS_Unstable,Bounce,VmallocTotal,VmallocUsed,VmallocChunk* mean? ...

Switch GNOME Terminal Profile from the command line

If I'm running gnome-terminal with multiple tabs open, is it possible to switch the profile of a given tab at the bash prompt, with instant effect, and without altering the profile of the other tabs? I understand how to use gconftool or gconftool-2 to change elements of a profile (such as the background), but I don't know how to actuall...

How do you hide the mouse pointer under Linux/X11?

How do I hide the mouse pointer under X11? I would like to use the built in libraries in order to do this and not something like SDL (SDL_ShowCursor(0)) or glut (glutSetCursor(GLUT_CURSOR_NONE)). Also, the mouse pointer should be hidden no matter the pointer location, not just in its own window. ...

Access to errno from Python?

I am stuck with a fairly complex Python module that does not return useful error codes (it actually fails disturbingly silently). However, the underlying C library it calls sets errno. Normally errno comes in over OSError attributes, but since I don't have an exception, I can't get at it. Using ctypes, libc.errno doesn't work because e...

How can I use the BCP Command in Linux?

I want to use the bcp command in Linux as the following: bcp "EasyCash.dbo.user" out "[EasyCash].[dbo].[user].dat" -q -c -t "<EOFD>" -r "<EORD>" -Usa -P123456 -S192.168.1.5 The message in Linux shows like that: -base bcp: command not found Can anyone solve my problem? ...

What are the differences between MySQL hosted on Windows and Debian (Linux)?

Hi All, I'm in the process of migrating a MySQL database from Debian to windows vista (localhost using Apache - installed and running via EasyPHP). The database is essentially a carbon copy, every entry is the same, however when I try to access the database, I get some strange errors (for example, in some cases the first few entries in...

socket behaviour when in blocking mode

I'm interested in the behavior of send function when using a blocking socket. The manual specifies nothing about this case explicitly. From my tests (and documentation) it results that when using send on a blocking socket I have 2 cases: all the data is sent an error is returned and nothing is sent In lines of code (in C for exampl...

How to ensure only one instance of a ruby script is running at a time

I have a process that runs on cron every five minutes. Usually, it takes only a few seconds to run, but sometimes it takes several minutes. I want to ensure that only one version of this is running at a time. I tried an obvious way... File.open("/tmp/indexer_lock.tmp",'w') do |f| exit unless f.flock(File::LOCK_EX) end ...but it's n...

"No X11 DISPLAY variable" - what does it mean?

Hello, I am trying to install a program (a Java application) on my linux machine (I am using Slackware). I have received the following mistake, and I do not understand it. Could you advise me how to approach the problem? I am not sure whether this is a kind of question I could ask here, because it is not exactly a programming question, ...

Memory usage of a kernel module

While trying to estimate the amount of memory consumed by a kernel module (usually device drivers),I tried using the size utility which gave the size of the static memory areas of the .ko ( .bss, .data, .text etc). So I was expecting the sum of these values to be exactly equal to the output given by the lsmod command immediately after in...

Can someone explain about Linux library naming?

When I create a library on Linux, I use this method: Build: libhelloworld.so.1.0.0 Link: libhelloworld.so.1.0.0 libhelloworld.so Link: libhelloworld.so.1.0.0 libhelloworld.so.1 The versioning is so that if you change the public facing methods, you can build to libhelloworld.so.2.0.0 for example (and leave 1.0.0 where it is), so that ...

Putting code and data into the same section in a Linux kernel module

I'm writing a Linux kernel module in which I would like to have some code and associated data in the same section. I declare the data and the functions with the attribute tags, like: void * foo __attribute__ ((section ("SEC_A"))) = NULL; void bar(void) __attribute__ ((section("SEC_A"))); However when I do this, gcc complains with: e...

Is it worth starting a new open source project or joining in?

There are a few various open source projects that I'm not particularly happy with, for example, I feel that various aspects of sound on Linux is simply appalling when compared to Windows. I know this is because sound card manufacturers make their hardware for Windows, and it's probably their fault that support is so bad. But I'm sure we ...

Change in Server Permits script not to work. Can this be due to PHP.ini being different?

Hello all, Here is proof that my site is not portable. I had some regex that worked perfectly on my old server. I have now transferred my site to a new server and it doesn't work. $handle = popen('/usr/bin/python '.YOUTUBEDL.'youtube-dl.py -o '.VIDEOPATH.$fileName.'.flv '.$url.' 2>&1', 'rb'); while(!feof($handle)) { $progress = fr...

Good tutorials for GTK+ in C on Linux for experienced C# developer

I've been working in C# for a while now (about 2 years). I started out programming in C++ but just learned about pointers/classes/etc..., then moved to C#. I've always wanted to learn C but thought it was too much of a challenge for what people were telling me was an almost dead language. I'm a Linux user (GNOME) and want to make some GT...

export problem

Hi. I run the following script in bash 3.2.48: #!/bin/bash export var1='var1' echo "UID=$UID" if [ x"$UID" != x"0" ] then export var2='var2' while ! { sudo -v; }; do { sudo -v; }; done; sudo $0 exit fi echo $var1 echo $var2 exit 0 What I get as output is: UID=1000 UID=0 var1 My question: Why is var2 not exported...

combining static libraries

Suppose I have a number of C static libraries say libColor.a which depends on libRGB.a which in turn depends on libPixel.a . The library libColor.a is said to depend on library libRGB.a since there are some references in libColor.a to some of symbols defined in libRGB.a. How do I combine all the above libraries to a new libNewColor.a whi...

Where can I get the Psiphon source code and how do I compile it on CentOS 5?

No matter how much googling I do, I can't seem to find the Psiphon source code (the download page on psiphon.ca gives me a '404'). Furthermore, linux installation instructions don't seem to exist. Any help would be greatly appreciated. ...

Better script to restart mysql on Ubuntu 8.04

When I say sudo /etc/init.d/mysql restart on Ubuntu 8.04.2 sometimes there remains a "mysql_safe" process eating 99% of cpu. Making the machine practically inusable. Is there a better way to restart mysql? I thought about writing a script: sudo /etc/init.d/mysql stop sleep 10 sudo killall mysql_safe sudo /etc/init.d/mysql start But t...