linux

fonts on org.eclipse.swt.widgets.Composite are messed up on Linux

I extend org.eclipse.swt.widgets.Composite and create many widgets on it, (labels, table, text etc). The problem I am facing is that the labels' text is getting truncated on linux while it appears fine on windows. When I change the linux's font to gothic the truncation is little less but still there. Is there way to homogenize the wind...

Use dll win32 in linux platforms.

I want to use a dll library for Win32 in linux. I thinkd can do it if I use a library of wine... Please help it.or http://okyuu.com/en/question/5785 ...

Does cron expression in unix/linux allow specifying exact start and end dates

I want to be able to configure something like this. I want to run job 'X' at 7 AM everyday starting from 29/june/2009 till 30/12/2009. Consider current date as 4/4/2009. ...

Does Linux guarantee the contents of a file is flushed to disc after close() ?

When a file is closed using close() or fclose() (for example), does Linux guarantee that the file is written back to (persistent) disc? What I mean is, if close() returns 0 and then immediately afterwards the power fails, are previously written data guaranteed to persist, i.e. be durable? The fsync() system call does provide this guara...

Will blocks of a recently-created subsequently deleted file ever be written back to disc?

Suppose I have a process which creates a file, writes some data to it, then after a short amount of processing (by itself or another process), deletes it and closes all remaining file descriptors. I am assuming here that there is enough ram to keep the pages in memory until the file is deleted, and that nobody calls sync() in the interi...

Calendar calculations in bash

Hi. I want to do some calendar manipulations in bash - specifically, I want to figure out the last date of a given month (including leap-year, and a preparing a table for a lookup is not a valid solution for me). Supposedly I have the following code: $year=2009 $start_month=2 $end_month=10 for $month in $(seq $start_month $end_month); ...

Why doesn't my awk one-liner work when I call it from Perl?

Dear all, I have no problem using the following command of AWK as a stand alone command, without any error: $ awk '$9 != "NTM" && $9 != ""' myfile.txt | less -Sn But when I apply them inside Perl's script for qsub (i.e. running job in linux cluster) command, like this: use strict; use Data::Dumper; use Carp; use File::Basename; my...

Replacing String Columnwise Using Sed

Given this data 34 foo 34 bar 34 qux 62 foo1 62 qux 78 qux I want to replace the string at 2nd column into "" if it is "qux". Resulting: 34 foo 34 bar 34 62 foo1 62 78 How do you do that with sed? In particular the data is very big with ~10^7 lines ...

Applying Unix's Head on AWK Through Find Command

I want to output top 10 lines of AWK command in the list of files given by find, using this snippet: $ find . -name "*.txt" -print -exec awk '$9 != ""' \| head -n10 {} \; Note also that I want to print out the file names being processed. But why I get such error: awk: cmd. line:2: fatal: cannot open file `|' for reading (No such fi...

PHP APC and Imagick with cpanel

I currently purchased a dedicated server hosted at iWeb and got it administered by them. I recently asked after registration to add php_apc and php_imagick to the available libraries. It seems according to them that it is not possible as it is not supported with cPanel. I would apparently need to do that myself... is there any risks to...

are you supposed to use both NICs on a linux server?

this may sound ridiculous, but i'm really not sure whether to use the 2nd NIC on a linux server. what do you do with your 2nd NIC? is it for redundancy or for throughput? on our mail server (postfix), we're very confused as to what is the optimal use of that 2nd NIC. thanks so much! ...

Linux iptables TRIGGER target description

I'm writing application which controls Linux firewall (using iptables). I need to implement some port triggering. There is TRIGGER target which seems to be suitable for it. However, I can't find good documentation of it (actually it's really hard to find any documentation of this target). Does anybody can redirect me to any information a...

MySQL synchronisation between 2 db

I am currently looking for a quick way to sync my production db and my dev-db. I was thinking of doing it with something like this : mysqladmin -u <user> -p<password> <dev-db_name> | mysqldump -u <user> -p<password> --databases <production-db-name> --add-drop-table but it seems that it just prints all of the drump on the screen inste...

Linux, Mono, shared libs and unresolved symbols

I have a shim library (shared, C++) which calls functions in another shared library (libexif) and presents a simple interface to C# for Platform Invoke calls. (That is, a C# program uses PInvoke to call my custom shared library which in turn calls another shared library.) In Windows, my custom shared library links to the shared library ...

how to read() write() into pipe() via dup2() with stdin and stdout

I need to simulated a Linux command line utility "cal -3" where it will displays three calendar side by side. What I need right now is to get my pipe working. I've been told that I can't use fork(), rather using dup2() and write(), read(), close() to call system("myCustomCommand") tree times. Right now my program does not display calenda...

Commit changed files, added new files and omit some files to an external server in Subversion on Linux / Ubuntu

I am running Subversion on Ubuntu. I have checked out the files for a project from an external server, done some changes on the files plus added some new files. Now I want to commit all the changes and the new files. However I modified the database configuration file to function with my local server so I don't want to commit that change ...

GetTcpTable equivalent on Linux

Is there an API call on Linux which returns currently opened TCP connections on the system (like GetTcpTable call on Windows)? Thanks. ...

Reading/writing from named pipes under mono/Linux

I would like to read/write from a named pipe/FIFo queue under Linux. I have tried the standard classes StreamWriter and other classes from System.IO, but it fails because it is using seek. Has anyone ever written/read from a named pipe using Mono?. I am managing to read and write - but not the same time... ...

Execution without OS

How do you compile a C program in to a valid ELF format(or RAW format) so that it can be executed directly from RAM without any OS? Assume that a bootloader exists which is capable of loading the code to any location in RAM and start execution at that address? To be precise , what should be the compiler(GCC) flags? Is there a need for a...

SVN: Ignoring an already committed file

I have a settings file that is under version control using subversion. Everybody has their own copy of this file, and I need this not to be ever committed. However, like I said, there is already a copy under version control. My question is: how do I remove this file from version control without deleting everyone's file, then add it to th...