linux

How do I exclude absolute paths for Tar ?

I am running a PHP script that gets me the absolute paths of files I want to tar up. This is the syntax I have: tar -cf tarname.tar -C /www/path/path/file1.txt /www/path/path2/path3/file2.xls when I untar it create the absolute path to the files. I do I get just /path with everything under it to show? ...

Version control for my web server

I'm building a Web2Py-based web application and am doing most of my development right on a remote EC2 development server. I would like to version control the entire system, including all python modules, web pages, and Apache config files. The files are obviously scattered across my Linux box, but I would like to be able to checkout/com...

how to optimize a wordlist for the english language

i'm looking to optimize a wordlist for the english language using sed or a similar linux application.. in order to do this i need to: Remove lines containing anything except a-z, 0-9, or special characters Remove urls - maybe detection of the "\" character Remove lines over 16 characters long, and 4 characters or shorter. (5-16 chars...

how to detect a buffer over run on serial port in linux using c++

Hey Guys We have a big problem. At present we are accessing a serial port via the following hooks fd = open( "/dev/ttyS1", O_RDWR | O_NOCTTY ) then we read from it using the following chunk of code i = select( fd + 1, &rfds, NULL, NULL, &tv ) . . . iLen = read( fd, buf, MAX_PACKET_LEN ) the problem is that before we read, we need t...

Which file should I pass as pathname argument of ftok()

It is mentioned in ftok() manual key_t ftok(const char *pathname, int proj_id); The ftok() function uses the identity of the file named by the given pathname (which must refer to an existing, accessible file) ... I am confused about const char *pathname. What would be the best practice for it? On my current system I can pass "...

How do I revert back to a previous SVN commit?

Suppose I'm at revision 50. But, I want to revert back to revision 45, and commit back as the stable version. How do I do that, in the most simple way? What if I want to do that with one file? What if I want to do that with the entire repository? ...

What do I change in my VIM config to do this? (remove the arrows)

My files have this "invisible arrows" How do I disable this completely? --->--->--->--- This is my vim config. What do I have to change to do this? set nohlsearch set ai set bg=dark set showmatch highlight SpecialKey ctermfg=DarkGray set listchars=tab:>-,trail:~ set list autocmd BufRead *.py set smartindent cinwords=if,elif,else,f...

How to test a function that deals with setting file ownership without being root

I wrote a function that copies the /etc/skel directory on a linux machine during a "create new user" RPC call. Now, there is quite a few things about this I want to test, for example the files in /etc/skel and the targets of symlinks should not have changed permissions afterwards, whereas the copied files including the actual symlinks sh...

How can I dump symbols in .la file on Ubuntu Linux?

How can I dump symbols in .la file on Ubuntu Linux? I get this linking error: main.c:(.text+0xbfb): undefined reference to `Browser_new' And I think my main.c is linking against libwebkit-1.0.la. So how can I find out if libwebkit-1.0.la has the symbol 'Browser_new'? CXXLD libwebkit-1.0.la CCLD Programs/GtkLauncher ...

What's the best library for video capture in Python on linux?

I want to write an application to video capture from web-cams in linux. Is there a python library to do that? ...

unmount fuse fs from python script

I have developed fuse fs with python and now want to write tests for it. Before testing I mount fs to some dir: fs = MyFuseFS() fs.parse(errex=1, ['some_dir']) fs.main() After testing I want unmount my fs, want to do something like this: fs.unmount() Is it something like "unmount" method? Maybe there is another ways...

How to rename in Cvs

I have checked a file temp.pl but now i want to change into temp . I have tried cvs rename temp.pl temp but its not working How to rename checked file in cvs ? ...

Warning: realpath() [function.realpath]: Unable to access / Plesk issue

I've just upgraded my server to version 9.3 of plesk from parallels. Now all my joomla sites ( and others) are showing a Warning: realpath() [function.realpath]: Unable to access / "file location" error. Any ideas what I can do to resolve it?? thanks ...

Error while using libsoup

Hi, I am writing a client using libsoup APIs. I have done the following. `session = soup_session_sync_new(); msg = soup_message_new("GET","http://www.google.com"); status = soup_session_send_message(session,msg);` However now i am getting the following error code in status. I print the reason phrase and it says the status= 4 , msg-...

remove all but last 5 directories with shell script and find command

-not sure if this belongs here or on serverfault- What I want to do it list all directories in a directory and delete all of them, except for the last 5. We have a deployment system in place that will incrementally do something link this: /var/www/html/build1 /var/www/html/build2 /var/www/html/build3 /var/www/html/build4 /var/www/html/...

How to delete many number of 0 byte files in linux?

Hi all, I've a directory with many number of 0 byte files in it. I can't even see the files when i use the ls command. I'm using a small script to delete these files but sometimes that does not even delete these files. Here is the script: i=100 while [ $i -le 999 ];do rm -f file${i}*; let i++; done Is there any other way to d...

virtual machine query?

hi i have installed ubuntu 10.4 as guest OS on vmware and windows xp is my host. now i want do know does vmware give a new ip address to the linux os.. if yes how do i get that ip address ...

what could make 32 bit app incompatible with 64 bit linux OS?

It seems that most 32 bit applications will run on 64 bit linux assuming all the 32 bit libraries are present. But it seems to me there could be issues with architecture-dependent functions, and here I'm thinking of signals and setjmp/longjmp. I'm wondering if someone with greater experience could comment on what functions (if any) woul...

PHP JSON. Confusing issue

Ok I am running CentOS, with PHP 5.2. I recently added the JSON extension. When running php -i .. after installing JSON, it says json json support => enabled json version => 1.2.1 But when I run phpinfo it's not showing the JSON extension as being enabled. I have added the extension to the php.ini file so it loads the json.so file...

Manage source under git and svn simultanously - does it make sense?

This is maybe unusual so let me set the scene: We have an SVN repo containing our project history - an embedded system based on Linux. The SVN repo contains Linux kernel, U-Boot, busybox etc. sources and all our in-house apps, filesystem and such. The Linux kernel we have is old and crusty and I am working on porting to the mainline, w...