OK the internet is great ’cause it’s full of information, and the internet sucks ’cause it’s full of information, not all of it good or what you need. I have spent a lot of time looking for an online equivalent of a well-written perl book (I’ll spend 5 hours searching instead of buying a $30 book ’cause I’m cheap like that). I think the perl community knows O’Reilly and others have some good books, and why write new online docs if good books already exist? I haven’t found good online results for simple tasks like searching and replacing across multiple lines. Until I went to Google Books. Boom, there she was. (continued…)

(Editor’s note: see the wiki for a more structured and updated version…)

I wrote an object-oriented database a few years back using “C++ Database Development” from Al Stevens as inspiration, and I’ve always wanted to dig it out and get it updated. I’m also working on ShareTheDJ, which needs cross-platform object serialization. Robert Ramey implemented boost::serialization and it looks like an excellent way to serialize my objects in a more STL-friendly way. Here’s how to set up under FC3/FC4, gentoo and Windoze…

UPDATE: Sourceforge root changed from [cvs-pserver.sf.net:443] to [boost.cvs.sourceforge.net]. Instructions were updated.

(continued…)

Now that I can ssh from anywhere to my linux box using my new Treo 650 and pssh, I am really enjoying the authoritative command-line versions of bittorrent straight from Bram Cohen. All I needed was a way to easily ssh in, play with torrents, and disconnect without stopping bittorrent. There are three ways that I know of to leave processes running after disconnecting from a terminal:

  • nohup
    This is specifically designed to run processes detached from terminal.

  • double &
    eg: (./btlaunchmany.py torrent/active/ > torrent.log 2>&1 &) &

  • screen
    This is an entire “screen manager” for processes that use the terminal to display output.

    [screen] really kicks booty – screen and btlaunchmanycurses.py are a perfect match:

  • screen btlaunchmanycurses.py –max_upload_rate 1000 /torrents
  • [ctrl-a d] to disconnect and drop to command line
  • [screen -r] to reopen the backgrounded session
  • Killing the session does NOT kill the bittorrent process – relogin and do [screen -r]
  • After reopening, kill bt as usual to end process

    Try it out, it rocks! More on this here

  • Anonymous Coward writes “corey again.. you gotta let me know how to get x-forwarding working right with ssh…… :)”

    On a Windoze (or Mac?) box, use putty:
    1) Run an X server on your box – I use Hummingbird at work, Cygwin-X at home (I love it!)
    2) Putty Configuration->Connection->SSH->Tunnels:

  • [x] Enable x11 forwarding
  • Xdisplay= localhost:0.0
    3) connect through putty and start up an X app

    On linux:
    1) ssh to where you need to go
    2) export DISPLAY=[yourip]:0.0
    3) start up an X app

    Do either of those work for ya?

  • Here’s a good article that explains how well the Visual Studio 2005 compiler can optimize .net managed C++ code. To me, it’s just further argument that “unmanaged” (“native”) (read: portable, non-MS-proprietary) C++ code is far superior. Is there anything in the .net API that is really really necessary that would be more difficult in straight C++? MS is committed to
    making an effort to ensure that there is, so you go with their proprietary solutions. But I will always make an effort to code everything I can in portable clean C++, and link to .net managed C++ only when necessary.

    And to follow up, here’s an article from Paul DiLascia, who’s been kicking a$$ with his C++ Q&A articles for decades, explaining how to link in .net code with unmanaged C++ code, on a MODULE-BY-MODULE basis! Excellent.

    Update: There’s no stopping him, in his next article he shows how to “wrap (.net) Framework classes in a native way so you can use them in any C++/MFC app without /clr”.