linux

Is gettimeofday() guaranteed to be of microsecond resolution?

So I find myself porting a game that was originally written for the Win32 API to Linux (well, porting the OS X port of the Win32 port to Linux), and have implemented QueryPerformanceCounter by giving the uSeconds since the process start up: BOOL QueryPerformanceCounter(LARGE_INTEGER* performanceCount) { gettimeofday(&currentTime...

GTK implementation of MessageBox

I have been trying to implement Win32's MessageBox using GTK. The app using SDL/OpenGL, so this isn't a GTK app. I handle the initialisation (gtk_init) sort of stuff inside the MessageBox function as follows: int MessageBox(HWND hwnd, const char* text, const char* caption, UINT type){ GtkWidget *window = NULL; GtkWidget *dialog ...

Is it possible to drag windows between workspaces when using Compiz?

When I used Metacity, I could drag windows between workspaces using the small icon view of my workspaces. I recently started using Compiz for all the cool desktop effects, however this drag and drop feature isn't working. I use the cube effect for switching workspaces, but I noticed the wall effect doesn't allow it either. Is this jus...

Getting root permissions on a file inside of vi?

Often while editing config files, I'll open one with vi and then when I go to save it realize that I didn't type sudo vi filename Is there any way to give vi sudo privileges to save the file? I seem to recall seeing something about this while looking up some stuff about vi a while ago, but now I can't find it....

Gtk SSH client for Linux?

I realise purists would say "use the command-line" but this is the age of Ubuntu and since I spend most of my time behind a proxy server I find it easier to configure and use PuTTY on Windows than configure ssh with connect.c I also realise PuTTY is available on Linux but it seems to use some weird GUI widget set that is rather nasty t...

What should a longtime Windows user know when starting to use Linux?

We've finally moved our websites to a decent host, and for the first time we have Shell Access. I know very little about using Linux, I can navigate through the file system, read files with Vim and I'm aware of the man command, and I have been able to work out solutions to problems as they show up (eventually), but I know I'm unaware of...

XML Editing/Viewing Software

What software is recommended for working with and editing large XML schemas? I'm looking for both Windows and Linux software (doesn't have to be cross platform, just want suggestions for both) that help with dealing with huge XML files....

Shell scripting input redirection oddities

Can anyone explain this behavior? Running: #!/bin/shecho "hello world" | read var1 var2echo $var1echo $var2 results in nothing being ouput, while: #!/bin/shecho "hello world" > test.fileread var1 var2 < test.fileecho $var1echo $var2 produces the expected output: helloworld Shouldn't the pipe do in one step what the redirection to t...

Lightweight IDE for Linux

Even though I have a robust and fast computer (Pentium Dual Core 2.0 with 2Gb RAM), I'm always searching for lightweight software to have on it, so it runs fast even when many apps are up and running simultaneously. On the last few weeks I've been migrating gradually to Linux and want to install a free lightweight yet useful IDE to prog...

Text Editor For Linux (Besides Vi)?

Let me preface this question by saying I use TextMate on Mac OSX for my text needs and I am in love with it. Anything comparable on the Linux platform? I'll mostly use it for coding python/ruby. Doing a google search yielded outdated answers. Edit: Since there has been some concern about the 'merit' of this question. I am about to ...

Linux - files and scripts that execute on boot

If I want to make something run on startup on Linux, where is the preferred place to put things? I would like a description of each script or file that is executed at boot, and that script or file's purpose as to how you edit it, or what sorts of things are normal to put in it to make run on startup....

what's in your .bashrc ?

.bashrc modifications are like nesting for developers. All I have right now is a few aliases and some PATH modifications. What's in yours?...

Programmatically talking to a Serial Port in OS X or Linux

I have a Prolite LED sign that I like to set up to show scrolling search queries from a apache logs and other fun statistics. The problem is, my G5 does not have a serial port, so I have to use a usb to serial dongle. It shows up as /dev/cu.usbserial and /dev/tty.usbserial . When i do this everything seems to be hunky-dory: stty -f /d...

Personal Linux web server

I'd like to set up a cheap Linux box as a web server to host a variety of web technologies (PHP & Java EE come to mind, but I'd like to experiment with Ruby or Python in the future as well). I'm fairly versed in setting up Tomcat to run on Linux for serving up Java EE applications, but I'd like to be able to open this server up, even j...

How do you find the age of a long-running Linux process?

I have a problem with some zombie-like processes on a certain server that need to be killed every now and then. How can I best identify the ones that have run for longer than an hour or so?...

Any IcedTea war stories?

Okay, my first serious question. :-D I'm playing around with OpenJDK (7, not 6), and am about to start trying to build IcedTea on my Ubuntu system. I'm keen to hear from those who have played with IcedTea and have stories (successes, pitfalls, etc.) to tell. All stories welcome, whatever distribution you use. Chances are, I'll very soo...

Mapping my custom keys in Debian

Hi Folks, I have a Microsoft keyboard with a series of non-standard buttons such as "Mail", "Search" , "Web/Home" etc. It would be nice to be able to bind these keys so they execute arbitrary programs. Does anybody know how to do this in Debian Etch? Thanks in advance, Simon...

Best Linux Distro for Computer Repair

My PC has had trouble recently but now it won't boot into windows. I put in a new HDD and reinstalled windows but now I want to get the info off the old HDD. What linux distro can allow me to read and possibly repair my old hard drive? I've used Knoppix a while back and it was good, but is there something I can download that is much sma...

showing a message box from a bash script in linux

I'm writing a few little bash scripts under Ubuntu linux. I want to be able to run them from the GUI without needing a terminal window to enter any input or view any output. So far the only input required is a password for sudo - and gksudo handles that fine. But I haven't found an easy way to show a message box yet. Is there some kind ...

How do I setup Public-Key Authentication?

How do I setup Public-Key Authentication for SSH? ...