Tuesday, May 28, 2013

Installing cygwin - which packages I choose

Every time I install cygwin, I struggle to remember which packages I select.  So here is that start of a list (which will get updated over time):


  • emacs
  • ssh
  • ssl
  • xdmcp
  • wget
  • bash
  • ncurses
  • inetutils
  • rsync
  • curl

Cygwin - setting up sshd as service

The following article goes through the process of setting up cygwin's sshd as a service:


How To Get SSH Command-Line Access to Windows 7 Using Cygwin
http://www.howtogeek.com/howto/41560/how-to-get-ssh-command-line-access-to-windows-7-using-cygwin/
The short version:

  • Install cygwin - include ssh
  • Run terminal (as administrator)
  • run ssh-host-config and go through questions
  • Start service (either reboot or "net start sshd")
To uninstall the service, use the rollowing command:


cygrunsrv -R sshd
-------------------

Some additional notes for setting up on XP:
http://mugurel.sumanariu.ro/linux/steps-to-setting-up-cygwin-and-the-sshd-service-for-windows-xp/ 
Setting up client access to use keys instead of passwords:
http://www.teachmejoomla.net/code/misc/authentication-without-password-with-ssh-and-rsync.html 

iPhone - Google calendar syncing

I keep forgetting the link for configuring which google calendars to sync with the iPhone.  Also, the process has changed in the last yer or two.  

Here is a description:

    http://www.digitaltrends.com/mobile/sync-multiple-google-calendars-on-iphone-or-ipad/

Some of the content from the link above:
Here’s how to get all of your Google calendars working on your iPhone  or iPad:

  1. First, lets make sure your Calendar is properly synced, and the process is the same on both devices.
  2. Go to Settings, then open Mail/Contacts/Calendars.
  3. Next, select Add Account and Gmail.
  4. If however, you have already added your Gmail account, then instead of Add Account, choose Gmail from the account list. From here, toggle the Calendar switch to On.
  5. Otherwise, add your Google account information and a description of the calendar, and ensure that the Calendar option is switched on. Syncing will begin when you next open the Calendar app on your iPhone or iPad.

Next you must choose which calendars to sync:

  1. To do this, you need to visit the following Google website: www.google.com/calendar/iphoneselect
  2. Provided you’re signed into your Google account, on this page you’ll see a list of all your calendars, with a check box against them.
  3. Tick the boxes of the calendars you want to sync with the iPhone and iPad, then click save.

Once again, open the Calendars app and wait for it to sync. That’s it, all your calendars should be ready and waiting for you.

Sunday, May 26, 2013

Underwater photoshop macro

Tired of your underwater pictures looking terrible... all blue and washed out.  Well, even those cruddy pictures taken with that simple point and shoot camera (in an underwater housing) can be made to look pretty good!

Photoshot can adjust the colors automatically for underwater and make the colors look better.  I find the results to be simply amazing!  That is not to say that it makes bad pictures into good pictures.  It means that decent pictures with horrible coloring can be turned into decent pictures with decent coloring.

File name: Underwater_flat.atn (File available here)

Installing a Photoshop macro:

  • open photoshop
  • ensure actions palet is visible
    • Windows > Actions (will make action open up)
    •  there will be a little PLAY button (right arrow) in the palet dock
  • open the actions palet
  •  top right corner is a pulldown menu... Load actions
    •  browse to .atn file
    •  load .atn in (underwater)


Run the Maro:

  • File > Automate > batch
    • set : underwater
    • actions colorcorrect_red
    • Source: folder... CHOOSE FOLDER
      • select suppress File open options dialog 
      • select suppress Color Profile warnings
    • Desintation: folder... CHOOSE FOLDER
      • File Naming: Document Name + _corrected + extention
    •  OK


Gmail - creating your own specific address

Want to send something to your gmail account and make it specific to a vendor?  Do the following... give them the address:

    <your-address>+<specific-marker>@gmail.com

For example:

    pete+starbucks@gmail.com

The email will be delivered to your regular gmail account and the to address will display the whole address (including the marker).

Wednesday, May 22, 2013

Windows 7 Activation Error (0x8007232B)


If you get the error 0x8007232B when you try to activate Windows 7, then you need to run these commands: 
slmgr.vbs -ipk [your product key]

slmgr.vbs -ato

Friday, May 17, 2013

Setting up a windows service... run anything as a service

There is a freeware solution to setting things up as a service that seems to work better (in more cases) than traditional approaches.

    http://www.serviceex.com/


ServiceEx is a freeware Windows application that allows a normal program to run as a Windows service. Currently it is command line only. A version with a GUI is forthcoming. In the meantime, configuration options are specified via an .ini file that must be created prior to running ServiceEx.

ServiceEx differs from Microsoft's srvany in that it monitors the program and relaunches it whenever it shuts down for any reason. If you do not wish to have this behavior, you can turn it off. A link to download it is provided below.

Sample .ini file:

[ServiceEx] 
ServiceExeFullPath = "C:\Program Files\calibre2\calibre-server.exe"  

; program arguments to be sent to executable 
options =-p 8081 --with-library "c:\calibre library" 

; can program interact with desktop [true | false] (default: true) 
desktop = false

; start type (valid values: Auto Manual Disabled) (default: auto) 
Start=Auto 

; start the service upon installation [true | false] (default: no)  
StartNow=false 

Thursday, May 16, 2013

Symlinks on Windows

Looks like Windows (7 at least) supports symlinks... finally!!  Yay.


    C:\>mklink
    Creates a symbolic link.

    MKLINK [[/D] | [/H] | [/J]] Link Target

            /D      Creates a directory symbolic link.  Default is a file
                    symbolic link.
            /H      Creates a hard link instead of a symbolic link.
            /J      Creates a Directory Junction.
            Link    specifies the new symbolic link name.
            Target  specifies the path (relative or absolute) that the new link
                    refers to.

Example


    C:\>mklink /D my-link h:\usr\htdocs
    symbolic link created for my-link <<===>> h:\usr\htdocs

    C:\>






Tuesday, May 14, 2013

Find with grep


Need to search a directory tree for files containing a string?  Easy enough with a single file... just use "grep".  Easy enough with all the files in a directory... again, just use grep.


But, if you need to search a whole tree structure... use find, with xargs and grep:

    find . -name *.sh | xargs grep while

This search all files with a .sh extension starting in the current directory for the keyword while

To delete everything in all .svn directories:

    find . -name .svn -print0 | xargs -0 rm -rf

Reinitializing partition tables

Reinitializing partition tables

Had an interesting problem... trying to install Windows 7 on an old XP machine that had RAID turned on.  Tried to disable the BIOS level RAID, and do a new install.

The Windows 7 installation failed because a couple of reasons.  At first it could not see the disks.  After fiddling with the BIOS settings, the installer saw 2 out of 3 disks, but could not install to them.  It complained that the version of NTFS was unsupported.  I suspected that the drives had left over stuff from the RAID configuration.

Recommendation from a friend was to nuke the partition table and start from scratch.  Did this by booting off of a Fedora Live DVD, bringing up a terminal window and using dd to overwrite the start of the disks:

    dd if=/dev/zero of=/dev/sda bs=63k count=100
    dd if=/dev/zero of=/dev/sdb bs=63k count=100
    dd if=/dev/zero of=/dev/sdc bs=63k count=100

Success!