Archive for the ‘ Tips ’ Category

Using Vi Mode Everywhere

Tuesday, March 15th, 2011

Not literally everywhere, but more places than usual. I have been looking for this solution for a long time and finally found it. Anyone who has ever worked around me knows that I do basically everything in Vi.
(more…)

Counting Frequencies of Frequencies

Monday, August 16th, 2010

Lots of people forget about the usefulness of the core utilities (the tools available in Bash). I am even pretty guilty of it at times with such quick and easy things like Perl, Ruby, or Python that allow you to process items from the command line. However, they load up an entire interpreter. It is usually better to use the coreutils.
(more…)

Sharing a Screen Session

Friday, July 23rd, 2010

Anyone who has spent any time in a shell and has been cut off while working should know about screen. If not, then I recommend reading up on it (here or here). But I’m not here to tell you about screen as a general tool, I want to show you how to use it for screen sharing. I found a couple of forum posts and other scattered information, so here’s a little centralizing of information.
(more…)

Random Tech Notes And Buzz Updates

Monday, June 28th, 2010

Since Google Buzz is Twitterish in the sense that you can post a quick note, but different in the sense that (amongst other things), it can be longer than 140 characters. So in that vein, I’m starting to try to make a habit of a quick post (a couple per week) of things I do to make my life easier. This goes both for SysAdmins and for Programmers.
(more…)

Cluster SSH with cSSHx

Monday, March 29th, 2010

I am in the middle of building out a group of about 25 machines in a data center for my company. I hadn’t really dove into it on a micro level until a few days ago. I was moving around on individual machines that others were working on. When I had gotten to one of the “untouched” machines, I found that vim wasn’t installed. There was about 15 machines that were “untouched” and therefore were missing vim (along with other stuff). And seriously who wants to install a bunch of the same software on every machine after they’ve already been kickstarted?
(more…)

Peertester Community Testing

Tuesday, March 16th, 2010

I am all about community and people participating in a community. Its the way social media succeeds. But there are non-social media communities out there too (yes I know that’s shocking). I was recently asked to participate in a beta testing for Peer Tester. I think this is an absolutely fantastic idea. Developers helping other developers test their apps. Hats off to the guys and gals over at Engine Yard for designing and putting this application together. Other than the fact that I got tired of looking at that olive green color after years in the military, this site is an great tool for developers.
(more…)

Git Command Aliases

Monday, December 28th, 2009

This is kind of a tip of the day, but I just think its cool so I am sharing it with everyone. And being a recent convert to Git and the fact that I have to use Subversion at my place of work, I find myself constantly doing things like this out of habit.

1
$ git st  && git ci

Well now I can do that (although it may not be a good idea) with git alias:

1
2
3
4
5
elubow@beacon (master) supportskydivers$ git config --global alias.st status
elubow@beacon (master) supportskydivers$ git config --global alias.ci commit
elubow@beacon (master) supportskydivers$ git st && git ci
# On branch master
nothing to commit (working directory clean)

Now st and ci are git aliases for status and commit respectively.

Git Branch Name in Your Bash Prompt

Friday, December 11th, 2009

I work with a few repositories at any given time. And during that time, I typically have multiple branches created for each repository. I figured that it would make my life easier if I knew which branch and/or repository I was working in. Luckily, very little hackery is required here since the git distribution already comes with such a tool. (Note: If you didn’t build Git from source, then you may not have this file.)
(more…)

SSH Over The Web With Web Shell

Friday, November 27th, 2009

After reading a Tweet from Matt Cutts about being able to SSH from the iPhone (and the web in general), I had to give it a try. I am always looking for better ways to be able to check on systems when necessary. I have iPhone apps for SSHing around if I need as well, but like with any “new” tool, I have to try it out to see if it serves a purpose or makes my admin life easier in any way.

First go check out the Google Code repository for Web Shell. Webshell is written in Python and is based on Ajaxterm. All that’s required is SSL And Python 2.3 or greater. It works on any browser that has Javascript and can make use of AJAX.

The way Web Shell works is you start it up on a server and then can use a web browser to access only that machine over SSH. The works best if you have a gateway server to a network and use a single point of entry to access the rest of the servers. Web Shell runs on HTTPS on port 8022. Reading the README will lead you through the same set of instructions I used below. Once installed, we connect by using a web browser: https://server.com:8022/
(more…)

Getting Rid of The Google Analytics Overlay

Saturday, September 5th, 2009

It took a little hunting to figure this one out, so I decided to write a quickie blog post about it. If you use Google Analytics and have put the overlay on your website to gain information, you may have noticed that it is quite challenging to get rid of.

Well the solution, as is turns out, is pretty simple. Just go into your browser’s cookie repository, find and delete the cookie that calls itself GASO. And poof, the overlay is gone.

More Wolframalpha Easter Eggs

Monday, May 18th, 2009

While finally getting to play around with the new Wolframalpha search (computational knowledge) engine. I found a few more Easter Eggs in addition to the ones posted on Mashable here and here. It appears that the creators of WolframAlpha believe that proverbs (more commonly referred to as aphorisms) are a handy trait for a computational knowledge engine to have. Regardless, they are fun to play with.

  1. I should probably listen to this one myself. Starting out with this cause it is just amusing.
    All Work and No Play Makes Jack a Dull Boy

    All Work and No Play Makes Jack a Dull Boy

  2. Another instance of WolframAlpha being health conscious.
    An apple a day Keeps the doctor away

    An apple a day Keeps the doctor away

  3. It wants to be smarter so it tries to learn from its mistakes (not really, but we are being proverbial here anyway).
    Fool Me Once, Shame On You

    Fool Me Once, Shame On You

  4. In the spirit of the Back To The Future (and other cult film references):
    1.21 Gigawatts

    1.21 Gigawatts

  5. Another great proverb reference ignorance.
    Out Of Sight, Out Of Mind

    Out Of Sight, Out Of Mind

  6. This isn’t really an Easter Egg. I was just expecting a response more like, “There is a season” or something a little more 60s ish. So I am including this one purely for amusement’s sake.
    Turn Turn Turn

    Turn Turn Turn

Text Messages to Cell Phones via Email

Monday, December 3rd, 2007

I have been compiling a list of the domains that one needs in order to send text messages to cell phones via email. As a huge user of Nagios, this is how I keep myself aware of the status changes. Below I have listed the carriers that I use most frequently. If you have any others to list here to make this more complete, please add a comment and I will add it to the list.

I have seen other instances of this before, but some are outdated. These are the newest ones that I have come across.

The assumption here is that the telephone number of the person that you are trying to text message is 2225551212. Just make sure that there is nothing in between the numbers (like a ‘.’ or a ‘-‘), Also make sure that you don’t put the ‘1’ before the phone number.

  • ATT: 2225551212@txt.att.net
  • Verizon: 2225551212@vtext.com
  • T-Mobile: 2225551212@tmomail.net
  • Alltell: 2225551212@message.alltel.com
  • Virgin Mobile:2225551212@vmobl.com
  • Sprint: 2225551212@messaging.sprintpcs.com
  • Nextel: 2225551212@messaging.nextel.com
  • All Other: 2225551212@teleflip.com

It should be noted that the last item (Teleflip), can be used either in place of any of these or as a fall through. It seems to act as a universal text message system.

UPDATES:
Here are the contributed addresses. The thanks are in parentheses following the numbers:

  • Claro (Brazil): 2225551212@clarotorpedo.com.br (Rodrigo)

SSH Organization Tips

Friday, February 9th, 2007

Over the years, I have worked with many SSH boxen and had the pleasure to manage even more SSH keys. The problem with all that is the keys start to build up and then you wonder which boxes have which keys in the authorized keys file and so on and so on. Well, I can’t say I have the ultimate solution, but I do have a few tips that I have come across along the way. Hopefully they will be of use to someone else besides myself.

  1. Although this should hopefully already be done (my fingers are crossed for you), check the permissions on your ~/.ssh directory and the file contained in it.
    1
    2
    3
    $ chmod 700 ~/.ssh
    $ chmod 600 ~/.ssh/id_dsa
    $ chmod 640 ~/.ssh/id_dsa.pub
  2. Now that SSHv2 is pretty widely accepted, try using that for all your servers. If that isn’t possible, then try to use SSHv2 whenever possible. This means a few things.
    1. Change your /etc/ssh/sshd_config file to say:
      1
      Protocol 2

      instead of

      1
      Protocol 1
    2. Don’t generate anymore RSA keys for yourself. Stick to the DSA keys:
      1
      2
      $ cd ~/.ssh
      $ ssh-keygen -t dsa
    3. Use public key based authentication and not password authentication. To do this change your /etc/ssh/sshd_config file to read:
      1
      PubkeyAuthentication yes

      instead of

      1
      PubkeyAuthentication no
  3. Keeping track of which keys are on the machine is a fairly simple yet often incomplete task. To allow for a user to login using their SSH(v2) key, we just add their public key to the ~/.ssh/authorized_keys file on the remote machine:
    1. Copy the file to the remote machine:
      1
      $ scp id_dsa.pub user@host:.ssh/
    2. Append the key onto the authorized_keys file:
      1
      $ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

    Before moving on here and just deleting the public key, let’s try some organizational techniques.

    1. Create a directory in ~/.ssh to store the public keys in:
      1
      $ mkdir ~/.ssh/pub
    2. Move the public key file into that directory and change the name to something useful:
      1
      $ mv ~/.ssh/id_dsa.pub ~/.ssh/pub/root@main.mydomain.com
    3. NOTE: Don’t do this unless you are sure that you can log in with your public key otherwise you WILL lock yourself out of your own machine.

  4. Now a little of the reverse side of this. If a public key is no longer is use, then you should remove it from your ~/.ssh/authorized_keys file. If you have been keeping a file list in the directory, then the file should be removed from the directory tree as well. A little housekeeping is not only good for security, but also some piece of mind in efficiency and general cleanliness.
  5. Although this last item isn’t really organizational, it is just really handy and I will categorize it under the title of efficiency. Using ssh-agent to ssh around. If you are a sysadmin and you want to only type your passphrase once when you login to your computer, then do the following:
    1. Check to see if the agent is running:
      1
      $ ssh-add -L

      NOTE: If ssh-agent is not running, it will say The agent has no identities.

    2. If its running, continue to the next step, otherwise type:
      1
      $ ssh-agent
    3. Now to add your key to the agent’s keyring, type:
      1
      $ ssh-add

    SSH to a machine that you know has that key and you will notice that you will no longer have to type in your passphrase while your current session is active.

These are just some tricks that I use to keep things sane. They may not work for you, but some of them are good habits to get into. Good luck.