linux

Manipulating giant MySQL dump files

What's the easiest way to get the data for a single table, delete a single table or break up the whole dump file into files each containing individual tables? I usually end up doing a lot of vi regex munging, but I bet there are easier ways to do these things with awk/perl, etc. The first page of Google results brings back a bunch of non...

Best way to see what files are Locked in Subversion

I finally got my group to switch from SourceSafe to Subversion. Unfortunately, my manager still wants to use exclusive locks on every single file. So I set the svn:needs-lock property on every file and created a pre-commit hook to make sure the property stays set. We are running Subversion on a Linux server. Most of us use Windows ma...

C MySQL client library behaviour

I have a client application that connects to the MySQL database 4 server using stock libraries on SuSE SLES 9. However, at times when processing a particular reset set from the server, iterating throw the results does not allow me to process all the results that is in the database. This issue happens sometimes, mostly when servers hav...

Linux: Prevent a background process from being stopped after closing SSH client

I'm working on a linux machine through SSH (Putty). I need to leave a process running during the night, so I thought I could do that by starting the process in background (with an ampersand at the end of the command) and redirecting stdout to a file. To my surprise, that doesn't work. As soon as I close the Putty window, the process is s...

Adding Security Message to RHEL 5 Login Screen

What are the steps to configure the login screen of Red Hat Enterprise Linux 5 to display a large paragraph of text? Background Information: The text is a security warning required by the company I work for to be presented to all users prior to them logging in. They must be able to read the text prior to logging in. We are using GDM an...

Trapping second keyboard input in (ubuntu) linux

I have written a program that gets input from a usb second keyboard (actually a barcode scanner). The problem is that if another window is active the data is input there rather than in my program. Could someone give me advice on what I'm doing wrong? #include <stdio.h> #include <string.h> int main(int argc, char * argv[]){ FILE * fp...

How do I translate init.d scripts from Ubuntu/Debian Linux to Solaris?

I have several init.d scripts that I'm using to start some daemons. Most of these scripts I've found on the internet and they all use start-stop-daemon. My understanding is that "start-stop-daemon" is a command that is specific to Linux or BSD distros and is not available on Solaris. What is the best way to translate my init.d scripts f...

Can I print html files (with images, css) from the command-line?

I want to print styled html pages with their images from a script. Can anyone suggest an open-source solution? I'm using linux (Ubuntu 8.04) but would be also be interested in solutions for other operating systems. ...

Mock filesystem in integration testing

I'm writing a ruby program that executes some external command-line utilities. How could I mock the filesystem from my rspec tests so that I could easily setup some file hierarchy and verify it after testing. It would also be best to be implemented in ram so that tests would run quickly. I realize that I may not find a portable solutio...

changing users default login shell on RHEL?

Here is a command on free bsd sudo pw usermod ksbuild -s /usr/local/bin/bash how do I do the equivalent on RHEL? ...

Help with Plesk and Virtuozzo

I I have just moved to a virtual server to host my websites and the service comes with Plesk and Virtuozzo. The documentation is pretty poor and I can find no books on the subject. Does anyone have a simple introduction to Plesk with an idea of what you can do, how you should do it etc. Specifically, I would like to set up a website with...

Recommended techniques for field updating embedded Linux safely

Embedded Linux based devices often require a mechanism to update applications and system files. For example, a (non-networked) lab instrument with a USB port can get software updates from a USB stick. It would be a simple matter to run a script to copy files into place on the device's internal flash memory. However, there is the danger...

Deny login to linux machine for users not in AD "Domain Admins" group?

So I've setup an Ubuntu server running the 8.04 release. I set it up to authenticate with our Active Directory using the likewise-open package using these instructions. Part of that setup was giving Domain Admin users who login to the machine sudo access. Now I'd like to deny login rights for all domain logins except for those users tha...

Print in terminal with colors using python ?

I want to print in the terminal with colors ? how can I do that in python ? Another questions what is the best character that when it is printed it look like a box [brick] ? I want to print colored blocks, it is part of game :) ...

Best way to learn C#

As a student, I don't often get offers for programming jobs, however I was offered a job if I learned C#. I currently know Java, PHP, C/C++, and other supporting languages. What would be the best way to pick up this language quickly? What are its similarities, what are its differences, pitfalls, etc? Is it acceptable to use Mono, because...

How to safely escape a string from C++

I'm writing a simple program to browse the local network and pass on filenames to mplayer using "system". However, sometimes filenames contain spaces or quotes. Obviously I could write my own function to escape those, but I'm not sure exactly what characters do or do not need escaping. Is there a function available in the CRT or somewhe...

Seeking a compact format for HTML ebooks for offline reading under Linux

I have a netbook running Linux and a large collection of computer books and reference material as HTML. I'd like some compact way of storing these books which can be browed without unpacking them first. This would save space and reduce wear on my small SSD. If there was some way to convince Firefox to browse files contained in ZIP file,...

Bash Shell Scripting: what simple logic am I missing

This may be too generic a question as is but... I am stumped by trying to move through the directories from within a shell script. I'm not a *nix power user, but I am comfortable working through the command line for most tasks. I'd like to call a script that can move 'me' to a directory instead of just the script process similar to the f...

alternative to cron?

Does anyone know of a good alternative to cron? I would like something that can be run with different time zones. ...

Resizing a window to a set size in Linux

Hi Anyone knows a good way to resize any window to for example 640x480? Reason is, of course, screencasting. Under windows I've used ZoneSize from donationcoder. (Btw: For Firefox it's easy, just use the web developer toolbar.) ...