Archive for the ‘unix’ Category

apt-get on Windows: win-get & Cygwin

Tuesday, January 29th, 2013

I want to run some python scripts, whose instructions state the need to run apt-get first.  The apt-get command is from unix-land, whereas I use mainly Windows.  How can this apparent obstacle be overcome?

I guess first I should try the “easy way”, i.e. get the script running on a unix machine e.g. a Mac}

Google:[apt-get windows 7]:

  • http://windows-get.sourceforge.net/ {No use to me}
    • {Naively, I thought it sounded like a Windows version of apt-get, but it is actually only inspired by apt-get, and is only for getting Windows applications such as FireFox.}
      • http://win-get.sourceforge.net/
        • Win-get is a automatic software installer and package manager for Windows, inspired by Debian’s apt-get tool. With win-get, downloading and installing an application to your computer is as simple as: win-get install firefox
    • win-get is an automated install system and software repository for Microsoft Windows written in pascal (for the command line client) and php for the online repository. The ideas for its creation come from apt-get and other related tools for the *nix platforms.
    • The system works by connecting to a link repository. Finding an application and downloading it from the stored link using wget.exe . Then performing the installation routine (silent or standard). And finnally deleting the install file.
  • http://wiki.debian.org/AptZip {Possible solution? e.g. run on a Mac then use the download on Windows?}
    • {Could this be an alternative?  Download on a separate computer and transfer to destination by memory stick etc.}
    • APT-ZIP is a package to update a non-networked computer using apt and a (removable) media (harddisk, USB key, ZIP drive…)
    • The apt-zip-list and apt-zip-inst commands simplify the upgrade process of a non-networked Debian host using apt , by using (preferably high-capacity) removable media, like a ZIP or USB drive.
    • You can use wget in Cygwin in the computer where you haven’t got installed Debian, to execute Apt-zip. Also you can run the script from a LiveCD.
  • http://www.cygwin.com/ {Better solution?  Needed in any case?}
    •  Cygwin is:
      • A collection of tools which provide a Linux look and feel environment for Windows.
      • A DLL (cygwin1.dll) which acts as a Linux API layer providing substantial Linux API functionality.
    • Cygwin is not:
      • A way to run native Linux apps on Windows. You must rebuild your application from source if you want it to run on Windows.
    • Latest Version & Windows Compatibility:
      • The Cygwin DLL currently works with all recent, commercially released x86 32 bit and 64 bit versions of Windows, with the exception of Windows CE and Windows NT4.
      • The most recent version of the Cygwin DLL is 1.7.17-1.
    • http://lifehacker.com/5433452/cygwin-17-adds-windows-7-support-and-many-improvements
      • Version 1.7 added Windows 7 compatibility.

Mac OS: File Stocktaking: Equivalent of TREE (as in DOS)

Saturday, August 11th, 2012

How, on a Mac OS system, to do the equivalent of TREE in DOS:

http://murphymac.com/tree-command-for-mac/

  • find . -print | sed -e ‘s;[^/]*/;|____;g;s;____|; |;g’
    • And there is much more on ths in the article, including how to add this “command” to user profile.

My crude adaption of it, to list only the main directories in my [Media] area:

  • find . -type d \! -name “BPAV” \! -name “CLPR” \! -name “TAKR” \! -name “929*” -print | sed -e ‘s;[^/]*/;|____;g;s;____|; |;g’
    • Crude but delivered what I wanted.

Rescuing a damaged file from a writeable DVD

Tuesday, March 1st, 2011

A physical DVD could be played but not copied, despite attempts on multiple computers (each with own drive).  The main VOB file was corrupted.  The disk appeared to the eye to be in good condition.  Wanted to copy a repaired version of that file, maybe with gaps or truncations, whatever could be salvaged.  Workaround was to do a ‘dd’.  That’s a unix command to “convert and copy a file”.  Mac OS X is based on a variant of unix, so chose to execute it from there.  The successful command was as follows:

  • dd if=/Volumes/’DVD VR’/VIDEO_TS/VTS_01_1.VOB of=tmp/vts_01_1.vob conv=noerror

Prior to this, naively-and-unsuccessfully tried Windows 7 PowerShell (PS) ‘cp’ command with ‘-Force’ option, but that was “barking up the wrong tree”.  An alternative suggestion, not attempted, was to use a streaming video processor such as VirtualDub. (more…)