npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

github-add-key

v1.0.0

Published

Tiny funny automation for GitHub multiple deploy keys management

Downloads

5

Readme

github-add-key

Tiny funny automation for GitHub multiple deploy keys management.

Inspired by this great StackOverflow answer by aculich.

Usage

Install this globally:

npm install -g github-add-key

Clone your repo , cd into it, then

github-add-key <your GitHub repo url tail> <script name>

your GitHub repo url tail for this repo would be vassiliy/github-add-key.

Default script name is run, but you can choose whatever valid name if you care. Last line of this script deletes its file anyway.

Then tiny funny automation magic starts:

$ github-add-key yourcoolorg/yourcoolorg-your-amazing-repo
touch run
cat > run <<EOR
git remote rm origin
git remote add origin [email protected]:yourcoolorg/yourcoolorg-your-amazing-repo.git
ssh-keygen -t rsa -f ~/.ssh/id_rsa-yourcoolorg-your-amazing-repo -C https://github.com/yourcoolorg/yourcoolorg-your-amazing-repo
ssh-add ~/.ssh/id_rsa-yourcoolorg-your-amazing-repo
pbcopy < ~/.ssh/id_rsa-yourcoolorg-your-amazing-repo.pub
touch ~/.ssh/config
cat >> ~/.ssh/config <<EOS
Host yourcoolorg-your-amazing-repo.github.com
  Hostname github.com
  IdentityFile ~/.ssh/id_rsa-yourcoolorg-your-amazing-repo

EOS
rm run
EOR
$

Then you check with your own eyes that this script is exactly what you wish to run, copy this right from touch run right to EOR to command prompt and hit Enter!

Then you get the script file run which will:

  • redefine your local repo's origin for deploy key usage,
  • guide you through all the custom ssh deploy key creation process,
  • place into clipboard the public key ready for adding to GitHub,
  • add stanza for this key into your ~/.ssh/config,
  • finally delete itself.

Check it by cat run or even edit some more coolness into it if you wish.

Then you

sh run

it, enter the same passphrase for the new key thrice and go your GitHub repo's settings to add this brand new key manually with whatever rights you want. You remember, public key is already in your clipboard.

Your local setup is ready for deploy, no intermediate files left.