linux

Why just file locking in multi-user systems is not sufficient?

Ritchie claims that file locking is not sufficient to prevent the confusion caused by programs such as editors that make a copy of a file while editing and then write the original file when done. Can you explain what he meant? ...

Algorithm for allocating memory pages and page tables

I want to design an algorithm for allocating and freeing memory pages and page tables. What data structures would allow best performance and simplest implementation? ...

Add a prefix string to beginning of each line

Hi, I have a file below : line1 line2 line3 And I want to get prefixline1 prefixline2 prefixline3 I could write a ruby script but it is better if I don't need to. EDIT: prefix will contains / , it is a path , /opt/workdir/ for example. ...

Is there an ftp plugin for gedit that will let me work locally?

I'm trying to switch from a windows environment to Linux. I'm primarily PHP developer, but I do know quite a bit about other languages such as CSS, XHTML and Javascript. I need a way of editing my files locally because I work in a git repository and need to commit my saves. On windows I used Aptana and PDT. I'd save my files, upload via ...

Graphviz subgraph fixed width with unlimit height

//input.dot digraph G { graph [bb="0,0,10,1000"] node [width=1 height=0.5 fixedsize=true]; 1[shape=rectangle]; 2[shape=rectangle]; 3[shape=rectangle]; 4[shape=rectangle]; 5[shape=rectangle]; 6[shape=rectangle]; 7[shape=rectangle]; 8[shape=rectangle]; ...

Linux Text File Manipulation

Hi, I have a file of the format: <a href="http://www.wowhead.com/?search=Superior Mana Oil"> <a href="http://www.wowhead.com/?search=Tabard of Brute Force"> <a href="http://www.wowhead.com/?search=Tabard of the Wyrmrest Accord"> <a href="http://www.wowhead.com/?search=Tattered Hexcloth Sack"> I need to select the text after the = but ...

Background java process not exiting

I'm starting a java program in background with java what.ever.Class &. It throws an exception in the first line and prints out the stack. I'd expect the java process to exit at that point, but for some reason it stays there waiting (no code running, not threads spawned, etc.). It's not a zombie, because it exits properly on the first SI...

Building Solaris packages on Linux?

One of our projects is a cross-platform piece of code. We build it on Windows, Linux, and Solaris/SPARC mostly. Of the 3, we deal with Solaris the least and it's a maintenance pain to keep our SPARC box up and running and in general Solaris administration is not our competency. A few years back I built a working cross-compiler for SPA...

Referencing libraries for a Linux executable

I have written an application in Java and succesfully compiled it using gcj. It worked surprisingly well, but I've run into a hurdle: I can only run the executable through a shell script, because I have to specify the library paths. The libraries I need are SWT, Xerces and GNU-crypto. Is there a way to statically link the libraries whe...

Linux Text File Manipulation with sed/awk

Hi, I have a list in the following format 77 Infinite Dust 4 Illusion Dust 12 Dream Shard 29 Star's Sorrow I need to change this to: 77 <a href="http://www.wowhead.com/?search=Infinite Dust">Infinite Dust</a> 4 <a href="http://www.wowhead.com/?search=Illusion Dust">Illusion Dust</a> 12 <a href="http://www.wowhead.com/?search=Dream...

How to update website files in repository with files that have changed in unversioned copy.

I have set up a SVN repository on a development that contains a website. The website files were imported using the svn importa few days ago. I also have the same website in an un-versioned state on the same server which is a mirror or the site on our live production server. This is in-case our live server crashes we can quickly reupload...

Why does a native library use 1.5 times more memory when used by java as when used by a C-Programm under linux?

I've written a library in C which consumes a lot of memory (millions of small blocks). I've written a c program which uses this library. And I've written a java program which uses the same library. The Java program is a very thin layer around the library. Basically there is only one native method which is called, does all the work and re...

Can't make JDBC connection to MySQL (using Java, IntelliJ, and Linux)

I am having issues trying to get a database connection using the code below: try { Class.forName("com.mysql.jdbc.Driver"); Properties p = new Properties(); p.put("user", user_name); p.put("password", password); connection = DriverManager.getConnection("jdbc:mysql://127.0.0.1/jsp_test", p); }...

Linux Kernel: System call hooking example

I'm trying to write some simple test code as a demonstration of hooking the system call table. "sys_call_table" is no longer exported in 2.6, so I'm just grabbing the address from the System.map file, and I can see it is correct (Looking through the memory at the address I found, I can see the pointers to the system calls). However, wh...

Running a server in a VM in Fusion on OS X..connecting externally?

Hi, I'm running a piece of software listening on a particular port inside an Ubuntu VM using VMWare fusion on OS X. I can connect to the port from OS X but I can't get to it via other, separate machines. I suspect that the OS X firewall is blocking access but I'm not sure how to verify that or really what port to open. I can't imagine ...

How much disk space do shared libraries really save in modern Linux distros?

In the static vs shared libraries debates, I've often heard that shared libraries eliminate duplication and reduces overall disk space. But how much disk space do shared libraries really save in modern Linux distros? How much more space would be needed if all programs were compiled using static libraries? Has anyone crunched the numbers ...

Multi-line menu item descriptions in curses

I've got a menu in curses that I'd like to put multi-line descriptions onto. My code puts the description fields on but they don't display if they don't fit on the line. Curses is happy enough printing multi-line text as strings (not as menu descriptions) Any ideas how to get multi-line descriptions working ? ...

Error Installing Gitosis on Fedora Core

I'm trying to follow these instructions on installing gitosis: http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way and these: http:// www.webtop.com.au/installing-git-and-gitosis-on-fedora-10 And at the point where I need to clone the gitosis-admin.git repository from the server I'm setting up, I am receivi...

Why is my Slave not starting on MYSQL?

mysql> start slave; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> show warnings; +-------+------+--------------------------+ | Level | Code | Message | +-------+------+--------------------------+ | Note | 1254 | Slave is already running | +-------+------+--------------------------+ 1 row in set (0.00 sec) mys...

Combine Text Lines That Match Criteria, Linux/sed/awk?

Hi I have a file like the following: 1, cake:01351 12, bun:1063 scone:13581 biscuit:1931 14, jelly:1385 I need to convert it so that when a number is read at the start of a line it is combined with the line beneath it, but if there is no number at the start the line is left as is. This would be the output that I need: 1,cake:01351 12...