linux

How to obtain MAC address of WiFi network interface?

It seems the java.net.NetworkInterface implementation of android does not have a byte[] getHardwareAddress() method http://developer.android.com/reference/java/net/NetworkInterface.html I've found several forums of people trying to do this with no definitive answer, I need to get a somewhat cross-device UUID, so I can't rely on phone n...

Screen reading / mouse clicking under Linux / X Window System?

I'm learning about AI and (just for fun and practice, not profit or anything evil) I'd like to write a little bot to play a rinky-dink Flash game for me. As a Microsoft hater, I'm embarrassed to say that I know and have used the required function calls some time ago under Windows, programming in Delphi. But these days I try to do everyt...

Webserver sending corrupt or corrupting served files

EDIT: Looks like the problem was a rootkit that corrupted a bunch of low level linux commands, including top, ps, ifconfig, netstat and others. The problem was resolved by taking all web files off the server and wiping it. A dedicated server we operate is having a strange issue. Files are not be sent complete or are showing up with ga...

Executing / Running a python script from ubuntu server

Can anybody help me how to run a python script through command line? My python script http://buffis.com/2007/07/25/getting-info_hash-for-xbt-tracker/comment-page-1/ I am using this command /var/www/hash_info.py /var/www/Muha_Album.7912.torrent I have copied dependency file bencode.py mentioned in article link above. When I execute the...

Passing lines as args to a script

How do I pass each line from a text file as an argument to a script I have written? So each line is then in itself a single arg to the script each time. ...

Split a PDF by Bookmarks?

Going to be getting a single PDF that has been created by 'merging' multiple pdf's. When I view the merged PDF each single PDF is displayed as a bookmark. Is there any way to automatically split this up by bookmarks with a script? We would not know the page numbers, so that's not an option. Linux tool would be preferred. ...

Using Valgrind tool how can I detect which object trying to access 0x0 address ?

I have this output when trying to debug Program received signal SIGSEGV, Segmentation fault 0x43989029 in std::string::compare (this=0x88fd430, __str=@0xbfff9060) at /home/devsw/tmp/objdir/i686-pc-linux-gnu/libstdc++-v3/include/bits/char_traits.h:253 253 { return memcmp(__s1, __s2, __n); } Current language: auto; currently ...

Getting n-th line of text output

I have a script that generates two lines as output each time. I'm really just interested in the second line. Moreover I'm only interested in the text that appears between a pair of #'s on the second line. Additionally, between the hashes, another delimiter is used: ^A. It would be great if I can also break apart each part of text that is...

PHP Default Timezone issue on Fedora + Zend Server CE

I have ZendServer CE (PHP 5.2) installed on a Fedora VM, and I have the system timezone set to 'America/Chicago'. I have date.timezone = 'UTC' in my php.ini file, and when I call date_default_timezone_get(), or display date('T') on a web page, it says 'CDT'. The documentation on php.net for date_default_timezone_get() says it follows th...

Opening SSL URLs with Python

Hi folks, I'm using mechanize to navigate pages, it works pretty well. Unfortunately I have a random error come up, by random I mean it occasionally appears. URLError at /test/ urlopen error [Errno 1] _ssl.c:1325: error:140943FC:SSL routines:SSL3_READ_BYTES:sslv3 alert bad record mac> I really need help on this one :) ...

PHP set timeout for script with system call, set_time_limit not working

I have a command-line PHP script that runs a wget request using each member of an array with foreach. This wget request can sometimes take a long time so I want to be able to set a timeout for killing the script if it goes past 15 seconds for example. I have PHP safemode disabled and tried set_time_limit(15) early in the script, however ...

Pre-generating GUIDs for use in python?

I have a python program that needs to generate several guids and hand them back with some other data to a client over the network. It may be hit with a lot of requests in a short time period and I would like the latency to be as low as reasonably possible. Ideally, rather than generating new guids on the fly as the client waits for a re...

Pervasive & Linux

I'm interested in quering a Pervasive DB server running on a Windows platform from Linux. Would anyone happen to know if this is possible, what's required and what resources there are for me to read up on it? Thanks! ...

nautilus extesions using mono?

Is it possible to write nautilus extensions using mono? I seem to find only c and python references. ...

How to build Linux system from kernel to UI layer

Hi, I have been looking into MeeGo, maemo, Android architecture. They all have Linux Kernel, build some libraries on it, then build middle layer libraries [e.g telephony, media etc...]. Suppose i wana build my own system, say Linux Kernel, with some binariers like glibc, Dbus,.... UI toolkit like GTK+ and its binaries. I want to compile ...

how to disable specific warning when -Wall is enabled

Hi, I have used -Wall -Werror in my Makefile but I want to disable following specific type of warning : warning: '_wrap_delete_DMXTSFILTER' defined but not used How shoud I do that? ...

how to create shell script for logs

Hello everybody, I'm currently watching my log files like this tail -f and every now and then I press up key and hit return so new changes in log print into console, how to make it print itself when change in log file occur? Here is the requirement : START loop 1. Check file.log 2. If file.log has changed print the changes 3. else print...

List CPAN modules that have been made but not installed

Is there an easy/clean way to do this in Linux/ a Linux-like environment? Purpose My aim is to run CPAN with admin permissions only during the installation phase, not at the get/make/test phases. ...

How to debug problems in Linux kernel module `init()`?

I am using remote (k)gdb to debug a problem in a module that causes a panic when loaded e.g. when init() is called. The stack trace just shows that do_one_initcall(mod->init) causes the crash. In order to get the symbol file loaded in the gdb, I need to get the address of the module text section, and to get that I need to get the module...

Linux, how to capture screen, and simulate mouse movements.

Hi All I need to capture screen (as print screen) in the way so I can access pixel color data, to do some image recognition, after that I will need to generate mouse events on the screen such as left click, drag and drop (moving mouse while button is pressed, and then release it). Once its done, image will be deleted. Note: I need to ...