ssh-copy-id

Posted by Christopher Pitzer on February 9th, 2010

ssh-copy-id is a great little bash script.  Basically, you run:

ssh-copy-id myuser@someserver.com

And ssh-copy-id will copy your public key into the authorized_keys file of your user on that remote system.  From now on when you ssh to that system, you won’t need to enter a password.

The only problem is, the site that used to host the ssh-copy-id script has gone down.  I can’t find it anywhere any more.  So… I’m going to put it up here!  Enjoy!

To install ssh-copy-id on Linux or Mac:

sudo wget http://blog.christopherpitzer.com/wp-content/uploads/ssh-copy-id -O /usr/bin/ssh-copy-id
sudo chmod +x /usr/bin/ssh-copy-id

That’s it.  Have fun.  Here are the docs if you’d like some more reading.

how-to, linux No Comments »

sync folders across multiple machines

Posted by Christopher Pitzer on October 15th, 2007

spacer

I work from all over, on many machines. In the past I’ve just had to be absurd about carrying my files with me and always killing the old versions that stack up on whatever machine I didn’t use that day… in other words, a huge pain.

You’d think there would be an easy way to just automatically have your computers make sure that the most recent version of all your necessary files are on every computer – and that the files you’ve deleted are removed from every computer.

Well, you’ve guessed it, there is!

Today I found FolderShare, a free little app by our friends over at Microsoft (hey – they can’t be all bad).  You install a tiny app on your computers, go to foldershare.com and create a free account, and then you can just log in through foldershare.com to tell your account (which then tells the apps on your computers) what folders you want synced!

It’s super easy, and once it’s set up FolderShare works in the background to sync your folders any time the content in one of them changes.

business, how-to, technology 2 Comments »

adding a Slideshow feature to a SimpleViewer gallery

Posted by Christopher Pitzer on October 3rd, 2007

SimpleViewer is a great, easy to impliment, polished little gallery written in flash that lets you tie your photos and thumbnails in with XML. It’s got a decent feature set as far as changing the aesthetic of the viewer, but no option for an automated slideshow.

One of my clients wanted this option, and it took me a while to figure it out – so for those of you who are wondering how to incorporate a slideshow into simpleviewer, here’s how!

My finished project can be seen at SixEightyThreePhoto.com

(note – if you’re going for the free version of SimpleViewer this won’t help you – you need access to the source code, so you will need SimpleViewer Pro for this)

Step one – simpleviewer.fla

  1. Open simpleviewer.fla
  2. Create a new layer in the timeline.
  3. Create a keyframe by selecting frame 30 on your new timeline and hitting F6.
  4. Create your start/stop button and put it here, on this keyframe, on this layer. I’m calling mine ssButton. (for those in the know, I’m not really using a “button” element… I find them awkward to work with… I’m using a MovieClip as a button… but really, either way should work)
  5. Now we’re going to need a bit of code. This is all pretty simple stuff. A setInterval to iterate the slideshow, and instead of having a boolean to look at to determine whether or not the slideshow is playing, I’m just looking at whether the “play” layer of the button is visible. Open up the actions panel (F9) and copy this…

var nInterval:Number;

ssButton.onRelease = function():Void {
    ssButton.mcPlay._visible = !ssButton.mcPlay._visible;

    clearInterval(nInterval);

    if(!ssButton.mcPlay._visible) {
        nInterval = setInterval(slideshow, 3000);
        sm.ssNext();
    }
}

function slideshow():Void {
    sm.ssNext();
}

Step two – StageManager.as
I wish I knew a better way to do this, but I guess it’s not too painful… What we’re going to do here is pass our function call right on to another class instance. So at the bottom of StageManager, right before the last close brace, add this function…

public function ssNext() {
    mImageArea.ssNext();
}

Step three – ImageArea.as
Here’s where we actually, finally, DO something. Place this function right before the last close brace at the end of the file…

public function ssNext():Void {
    var nStart:Number = mCurrentImageIndex;
    mThumbArea.selectedThumbIndex++;

    if(nStart == mCurrentImageIndex)
        mThumbArea.selectedThumbIndex = 0;
}

Ta-Da!! If you built your button right, you now have working slideshow button in SimpleViewer! You’ll have to publish the simpleviewer.fla file again to get the updated version of your viewer.swf, and then you’ll probably have to tinker a bit to get the button in the right place – but that’s kid stuff.

flash, how-to 8 Comments »

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.