Foundation

  • Post author:
  • Post category:Book

Foundation is an interesting book, as its quite old and was originally written as a series of short stories (as much early science fiction was). Because I am reading the books of the extended Foundation series in the order that Asimov recommended towards the end of his life, I have read the two prequels to Foundation (Prelude to Foundation and Forward the Foundation) before Foundation itself. This means that the time line is a little inconsistent, specifically about how the Foundation project ends up on Terminus (Was it lobbying or exile? Did Hari go or not?). That's not too bad though, and the book is very good. [isbn: 0586010807]

Continue ReadingFoundation

Forward the Foundation

  • Post author:
  • Post category:Book

This is a Foundation prequel, coming after Prelude to Foundation and before Foundation. The book is almost a series of short stories or novelettes -- there are several year gaps between these stories. That was a shame in a sense, because each of these separate stories has its won startup cost -- the time it takes me to get into what is happening. For some reason I don't find that as much of a problem with collections of short stories, possibly because I'm expecting it more. This technique meant Asimov could cover a lot of ground, but I found it jarring over all. I guess I'd say this book was ok, but not one of Asimov's best. [isbn: 0553565079]

Continue ReadingForward the Foundation

Executing a command with paramiko

  • Post author:
  • Post category:Python

I wanted to provide a simple example of how to execute a command with paramiko as well. This is quite similar to the scp example, but is nicer than executing a command in a shell because there isn't any requirement to do parsing to determine when the command has finished executing. #!/usr/bin/python # A simple command example for Paramiko. # Args: # 1: hostname # 2: username # 3: command to run import getpass import os import paramiko import socket import sys # Socket connection to remote host sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((sys.argv[1], 22)) # Build a SSH transport t = paramiko.Transport(sock) t.start_client() t.auth_password(sys.argv[2], getpass.getpass('Password: ')) # Start a cmd channel cmd_channel = t.open_session() cmd_channel.exec_command(sys.argv[3]) data = cmd_channel.recv(1024) while data: sys.stdout.write(data) data = cmd_channel.recv(1024) # Cleanup cmd_channel.close() t.close() sock.close()

Continue ReadingExecuting a command with paramiko

Implementing SCP with paramiko

  • Post author:
  • Post category:Python

Regular readers will note that I've been interested in how scp works and paramiko for the last couple of days. There are previous examples of how to do scp with paramiko out there, but the code isn't all on one page, you have to read through the mail thread and work it out from there. I figured I might save someone some time (possibly me!) and note a complete example of scp with paramiko... #!/usr/bin/python # A simple scp example for Paramiko. # Args: # 1: hostname # 2: username # 3: local filename # 4: remote filename import getpass import os import paramiko import socket import sys # Socket connection to remote host sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((sys.argv[1], 22)) # Build a SSH transport t = paramiko.Transport(sock) t.start_client() t.auth_password(sys.argv[2], getpass.getpass('Password: ')) # Start a scp channel scp_channel = t.open_session() f = file(sys.argv[3], 'rb') scp_channel.exec_command('scp -v -t %s\n' % '/'.join(sys.argv[4].split('/')[:-1])) scp_channel.send('C%s %d %s\n' %(oct(os.stat(sys.argv[3]).st_mode)[-4:], os.stat(sys.argv[3])[6], sys.argv[4].split('/')[-1])) scp_channel.sendall(f.read()) # Cleanup f.close() scp_channel.close() t.close() sock.close()

Continue ReadingImplementing SCP with paramiko

Robot Visions

  • Post author:
  • Post category:Book

This was a pretty short read -- in fact I read it on the bus into work this morning. That's mainly because there are only three short stories in this book which aren't covered in one of Asimov's other robot short story collections. The three stories were good, but I am not sure they were worth owning the entire book for. [isbn: 0451450647]

Continue ReadingRobot Visions

The Belgariad

  • Post author:
  • Post category:Book

The Belgariad is a fantasy series by David Eddings. There are five books in the series, although there is also a follow series called the Mallorean, as well as three tie in books. The series follows a small farm boy as he grows up, discovering along the way that his relatives are famous, he's important to the history of the world, and that he has to defeat an ancient evil. The five books in the main series are: 1982: Pawn of Prophecy 1982: Queen of Sorcery 1983: Magician's Gambit 1984: Castle of Wizardry 1984: Enchanters' End Game

Continue ReadingThe Belgariad

Enchanters End Game

  • Post author:
  • Post category:Book

This is the final book in the Belgariad. Its a good one, although knowing there is another series involving these characters makes it feel a little less final to me. I enjoyed it though. [isbn: 0345338715]

Continue ReadingEnchanters End Game

MythNetTV release 5

  • Post author:
  • Post category:Mythtv

New things in this release: There is now a users mailing list at http://lists.stillhq.com/listinfo.cgi/mythnettv-stillhq.com Moved to a public SVN server at http://www.stillhq.com/mythtv/mythnettv/svn/ Added the 'justone' syntax to the download command Another try at using gflags. This means that all the command lines have changed slightly. Moved the core of MythTV out of the user interface file. Started writing unit tests Changed user output code so that it doesn't insist on writing to stdout. You can now write to other file descriptors, which makes things like unit tests much easier to write. Added video/msvideo to the enclosure whitelist Added HTTP download progress information Added a flag which turns off the prompts for markread (--noprompt) Patches from Thomas Mashos Search ~/.mythtv/mysql.txt, /usr/share/mythtv/mysql.txt and /etc/mythtv/mysql.txt in that order for MySQL connection information A manpage setup.py video.py now has a simple command line interface to let you query it Fix update of inactive programs bug per http://ubuntuforums.org/showpost.php?p=5580005&postcount=4 Better DB error handling Included a COPYING file with the right version of the GPL (it was missing before) Fixed a bug where programs would be downloaded more than once (found with a unit test!) Started raising exceptions instead of just sys.exit(1). This should make life easier…

Continue ReadingMythNetTV release 5

Castle Of Wizardry

  • Post author:
  • Post category:Book

This is book four in the Belgariad, and was as good as the others. This one only took a day to read, but that was helped a lot by the two hours I spent commuting to and from San Francisco today. This book is a little different than the others because it starts just as the quest for the Orb ends. Yet it turns out that the overall prophecy that the Belgariad describes is still incomplete, so the story continues. [isbn: 0345300807]

Continue ReadingCastle Of Wizardry

End of content

No more pages to load