How do you get the ip address from a remote machine?
I'm writing c++ code that I need to run on both windows and linux and I'm looking for a function call that will return the ip address of the box the app is running on. Is there such one? ...
I'm writing c++ code that I need to run on both windows and linux and I'm looking for a function call that will return the ip address of the box the app is running on. Is there such one? ...
Hi guys, could u help me out? I run this on cygwin as ./test.sh and I get unexpected end of file on line 51. Any thoughts? Thx in advance LAST EDIT: final version 'runnin on CygWin, the problem was with the line break, CrLf instead Lf. #!/bin/sh ################################################## ## USAGE ##############################...
Hello, I have written a little script which retrieves pictures and movies from my camera and renames them based on their date and then copies them on my harddrive, managing conflicts automatically (same name? same size? same md5?) Works pretty well. But this is ONE script. From time to time I need to check if a picture is already hidde...
Hi all. I've been fighting with crontab recently because in Intrepid the gconftool uses a dbus backend, and that means that when used from crontab it doesn't work. To make it work I have had to export the relevant environment variables when I log in so that it finds the dbus session address when the cron comes to run. Out of curiosity...
I get the following error when restarting my rails app. I've had this problem before, on another server with another app, but can't remember what the problem was, or how I solved it. Rails Error: Unable to access log file. Please ensure that /apps/staging/releases/20090310162127/log/staging.log exists and is chmod 0666. The log level ha...
Am trying build pysqlite 2.5.3 package on SLSE 9, and am getting all sorts of compilation errors i.e. ... src/module.c:290: error: initializer element is not constant src/module.c:290: error: (near initialization for `_int_constants[27].constant_value') src/module.c:290: error: initializer element is not constant src/module.c:290: erro...
What is the easiest way in Linux to have a script run on startup and another on shutdown? ...
Hi, how can I get information on the state of a process (i.e. if it is a zombie) using C under Linux? After reading the answers so far I want to narrow my question somewhat: I would prefer a pure C solution. After reading the ps source (which reads /proc/) I thought that there should be a better way and asked here :) ...
I want to copy an entire linux server that is going to be decommissioned over the network so we are sure nothing is lost. I did du / and was told there are 60 GB of under / Then I did rsync -r / root@newserver:/old-server and when doing du in the old-server dir I got 22 GB. So why is that difference? Is there something that du can see...
Hello I'd like to sell headless Linux servers to SOHO users. Typically, they'll have a DHCP-capable ADSL modem cum switch to which they'll connect their workstation and the server. In order to just show up with the server, I need to find a way to just plug the server into the switch to get an IP address from the modem, and then have th...
If someone sends me a document (.pdf,.doc,.xls, ppt, .ogg, mp3, png, etc) without the extension, how can I determine the file type? The /usr/bin/file command doesn't always guess right or it simply says that I have a Microsoft Office document. I would like to know exactly so I can add the extension to the file name. ...
How can I remove everything else in a folder except FileA, even hidden files? I use Ubuntu. I tried the following unsuccessfully rm [^fileA] ...
I have a project which has several components loaded by a single preloader swf. The preloader swf is strictly AS3 (No flex) and uses Loaders to load two different swfs which both use the flex library (Statically compiled, not rsl). When I compile all three under linux and run the resulting preloader, one of the swfs fails to load prop...
Hopefully short version of the question: If I'm on a machine that has a particular package installed, is there a yum command that will tell me which of it's configured repositories provided that package? (Or alternately, what repository would provide a yet-to-be-installed package.) Background in case some context is needed: We have a m...
We have a smart media card with a linux install on it that we need to duplicate. We created an img with DD and then used dd to write the img back to a couple of new smart media cards. We have compared the MD5 checksum of both the original and the new copies and they are different. Here is what we used: dd if=/dev/sdb of=myimage.img d...
Hi, I recently started using Linux (where I work is a Microsoft shop, so I only code in C#, work with MS products etc). I'm trying to understand at a high level how some basic things in Linux hang together. I've been reading www.linfo.org which is an amazing resource. Anyway I've never quite got what X is. From reading this article ...
Are they the same or not? Can certain things done with one but not with the other? What? Or is it, at the end of the day, and issue of acquaintance with either tool? ...
Our production machines are running on debian etch. Now, they finally released lenny, the day will come we need to upgrade these systems. How can I do this with minimal risk? Are there any premises, preparations of fall-back scenarios and do I need a plan B in case something goes wrong? Besides the binary packages handled by the debian i...
Is there any way to find out if the current session user is running an Xserver (under Linux) ? I'v started off with things like: ps -e | grep X but this doesn't work always and one more thing I tried is checking the $DISPLAY variable Are there any other ways to check this? EDIT: Some people suggested using the $DISPLAY variables b...
I admit the linux network system is somewhat foreign to me, I know enough of it to configure routes manually and assign a static IP if necessary. So quick question, in the ifconfig configuration files, is it possible to add a post connect hook to a python script then use a python script to reassign a hostname in /etc/hosts and spawn off...