linux

How to change the connection string with sed

Hello, guys! I have a connection string in a ini file as following: 1 ... 2 ... 3 #someline: n ConnectionString = "Data Source=localhost;Database=grid;User ID=grid;Password=grid;" And I would like to locate to the line n and replcate Data Source, Database, User Id and Password field. So how can I make it in sed? ...

How to upload (FTP) images with a certain group ?

I've configured a IP Camera that upload images in a Ubuntu Server. In Ubuntu server is runnig Apache http server and vsftpd (Very Simpe FTP Daemon). I have to catch the images from a wep application, how I have to configure the permissions ? (without security problems) I thought that I can set the group of uploaded images to www-da...

incremental backup of folder in linux whilst retaining attributes/ownership

I'm trying to backup a folder (e.g) /web/sites to /backups/websites and retain attributes, etc. cp -Rp retains the information, yet isn't incremental rsync -va seems to be great for incremental yet doesnt retain the attr/owner Is it possible to tar, and pipe it through and untar whilst retaining attr/owner, if so, how can I do this? ...

Question about how to make a filter using script

Hello everyone, I'm trying to make a filter on script to make this happen: Before: 123.125.66.126 - - [05/Apr/2010:09:18:12 -0300] "GET / HTTP/1.1" 302 290 66.249.71.167 - - [05/Apr/2010:09:18:13 -0300] "GET /robots.txt HTTP/1.1" 404 290 66.249.71.167 - - [05/Apr/2010:09:18:13 -0300] "GET /~leonardo_campos/IFBA/Web_Design_Aula_17.pdf ...

Has anyone successfully implemented OpenID with Mono?

I am working on a web project where I'd like to use OpenID with Mono on Linux. DotNetOpenAuth has wiki on for configuring OpenID with XSP, but it also listed known issues that have yet to be resolved such as throw an error when using a https certificate. What has been your experience? ...

php related error in linux terminal while setting up symfony framework

Hi i am trying to setup a new symfony framework project on ubuntu by following the documentation. But all the commands mentioned in the docs starting with 'php' give out the following error. The program 'php' is currently not installed. You can install it by typing: sudo apt-get install php5-cli bash: php: command not found. But php...

efficient way to merge a head file and part of a tail file and then to stdout

Actually I am in great agony recoverying a corrupt gzip file, possibly due to interrupted ftp transfer and then resume. After googling I found Recovering a damaged .gz file and am trying as it reads. What I'm doing now is merging a gzip header file with some last part of the damaged file varying the size of the last part. Then I test th...

Trying to make a filter with grep

I'm trying to make a filter that capture all the .exe file lines. For example, from this: [05/Apr/2010:11:00:01 -0300] /~mauro/Lista_conceitos_BD_2004.DOC 200 46080 [05/Apr/2010:11:00:54 -0300] /~lucia/articles/PROPOR96-Rino.pdf 200 153253 [05/Apr/2010:11:01:32 -0300] /~daniel_leite/RenomearTudo/setup.exe 200 1692017 [05/Apr/2010:11:...

How do I find the current system timezone?

On Linux, I need to find the currently configured timezone as an Olsen location. I want my (C or C++) code to be portable to as many Linux systems as possible. For example. I live in London, so my current Olsen location is "Europe/London". I'm not interested in timezone IDs like "BST", "EST" or whatever. Debian and Ubuntu have a file /...

how to send email from web app with mail() in php on CentOS (sendmail, postfix, ...?)

We are building a web app and will need to send emails on a frequent basis using php's mail() function. We are using it to send mails when e.g. a user signs up for the app, when a client has a new product order, and so on. What do we install best on our CentOS server to make this happen? I've read a lot about sendmail vs. postfix vs. ot...

Script to change FTP password

I have the following script to update one of my FTP passwords every 15 days through a cronjob and e-mail the appropriate people after the attempt has been made. It randomly will fail and so I will run it again manually and it will work. I can't seem to find where it's going wrong. The script is connecting to a local mysql database grabb...

does the linux kernel in an SMP system guarantee that UDP packets arriving from a network in order will be read from a socket in order?

on a project I am working on, we are seeing out-of-order issues in certain circumstances on a SMP system when we are reading a UDP stream from the network. We can see it arrives from the network in order by sniffing off a hub connected between the sender and receiver. However sometimes it appears to arrive out of order when read from the...

Getting started Java with Linux OS

I know this is very basic question, but these days I have done all my Java programs on Windows OS. But now I like to go with Linux. How JDK and all be installed in Linux OS? I am using Ubuntu 10.04 LTS. ...

Is there a way to stop a program after it outputs n lines?

Ive tried the following, but it still waits for the program to finish executing lnx>someprogram | sed -n '1,10p' Maybe a pipe may not be the correct way to go about this. Any feedback would be appreciated! Regards, Puji ...

Invoke make from different directory with python script

I need to invoke make (build a makefile) in a directory different from the one I'm in, from inside a Python script. If I simply do: build_ret = subprocess.Popen("../dir1/dir2/dir3/make", shell = True, stdout = subprocess.PIPE) I get the following: /bin/sh: ../dir1/dir2/dir3/make: No such file or directory I've tr...

How to convert large SVG file to tiled PNGs?

I have a large SVG file (approx. 60 MB, 10000x10000 pixels but with the potential to get much larger), and I'm wanting to create, say, many tiled 256x256 PNG images from it (in that example there would be 1600 images; round(10000/256)^2). Does anyone have any idea of how to do this on a web server (running PHP amongst other things)? I ...

Where is the entry of hypercalls in kvm?

Hello, I am trying to understand the virtio mechanism in linux. I read that the kick function will notify the host side about the newly published buffers. I am looking especially at virtio_net.Once a packet is ready for transmission the kick function is called here. From here i traced the call and i think it goes to this. From here whe...

How do I calculate the mean of a column

Hello every one... Anyone know how can I calculate the mean of one these columns (on linux)?? sda 2.91 20.44 6.13 2.95 217.53 186.67 44.55 0.84 92.97 sda 0.00 0.00 2.00 0.00 80.00 0.00 40.00 0.22 110.00 sda 0.00 0.00 2.00 0.00 144.00 ...

Communication between two application in the same local machine.

Hi, I am using C language and Linux as my programming platform. I am developing a user-space application that runs in a background, like a daemon. And my problem is, I want another user-space application to communicate with this daemon. I know that I have to use Interprocess Communication method but I don't know what is the correct i...

What's the easiest way (language, tools, etc) to write quick-n-dirty ad-hoc GUI apps in Linux?

For example to create a simple form with couple of controls, doing some simple logic on them, generating a shell command or a web service call and executing it here and now, assuming that it is going to be no tomorrow for this application, no unexpected things can occur to be handled, computer resources are unlimited, etc. The code'd be ...