All Posts Tagged With: "command"

Ustream IRC Chat How-To

On the PCMech LIVE show I do every week Wednesdays from 8pm-10pm EST I periodically get asked if there is an alternative way to participate in chat. This is because for some the text chat using the browser method is just too small, and/or the chat text scrolls by too fast for some to read, and so on.

Yes, there is an alternative way. You can connect by using a traditional IRC chat client.

Here’s how to do it.

1. Get a Ustream account.

This is free. Go to www.ustream.tv and sign up an account. You do this so you have a name of your own in chat rather than ustream-12345 random number assignment as a chat name.

2. Know the necessary server information and channel name.

Ustream has to the best of my knowledge four chat servers, that being:

  • chat01.ustream.tv
  • chat02.ustream.tv
  • chat03.ustream.tv
  • chat04.ustream.tv

The channel name for the PCMech LIVE show is:

#David-Risley-Show

All IRC channels start with the # symbol, so it must be included.

The reason to know all the servers is just in case one is acting slow. Should that occur, you have other servers you can connect to which may be much faster.

3. Pick an IRC client that you’d like to use.

There are several available, but here are some more popular choices:

mIRC

Not free, but the best there is for Windows.

Pidgin

Known primary as an instant messenger client but has very good IRC support.

Chatzilla

An add-on for the Firefox browser. Easy to use and easy on the eyes.

XChat

Free for Linux, pay-software for Windows. Arguably one of the best IRC clients for Linux.

Colloquy

IRC client for Mac OS X. Arguably the best there is for the Mac.

There are many others, but the point is that you’ve got some good choices.

4. How to connect the manual way

(All IRC clients have ways of automating logins to servers and joining channels, which I’ll get to in a moment.)

First you set your "nick," that being your nickname:

/nick your-ustream-username

Next you connect to a chat server.

/server chat01.ustream.tv

When connected you may be prompted (but not always) to enter your Ustream account password, this is done by issuing in the command:

/PASS your-ustream-password

After that, you join a channel. For the PCMech LIVE show, this is the command:

/join #David-Risley-Show

5. Automating things in IRC

Each client automates the way it does things differently, so you will have to refer to the client documentation to figure out how to get things done automatically.

I can give you a few tips however.

  • Usually when you set your "nick" for the first time, it will keep that name for any time you want to connect in the future. This allows you to skip the /nick command entirely.
  • Nearly all IRC clients have a way of storing server addresses (ex: chat01.ustream.tv.) Using this feature will allow you to skip the /server command entirely.
  • Nearly all IRC clients have a "Favorites" feature where you can specify favorite channels. Using this feature you can setup up #David-Risley-Show as a favorite that you can simply double-click to join once connected and authenticated. This allows you to skip the /join command entirely.

The only thing on Ustream IRC you can’t skip is the /PASS command. This is something unique to Ustream as it does not use what’s called a nickname server (known simply as the command /nickserv on many popular IRC services.)

Features of using a traditional IRC client over the browser way

Customized interface

You can use a white background with black text, black background with white text or whatever other color combination you like. You can also use any font you want using any size.

Much better buffer control

The chat area for Ustream in the browser is too small for many and text whips by too fast. Using the IRC client you have a much larger window and can scroll up and down thru it easily compared to the browser.

/ignore command

Is there a chatter bothering you that you don’t want to see? Use "/ignore username" and ta-da, you don’t see their text anymore for the remainder of the chat session.

Easier direct messaging

Although this is generally frowned upon unless you specifically ask the user first, you can easily double-click any chatters name and it will pop up a secondary window for direct chat, similar to an instant message. This is sometimes known as "PM’ing" a user, with PM meaning personal message or private message. The browser method allows this as well, but it’s a bit tough to manage because the chat window is so small.

See you Wednesdays from 8pm-10pm EST!

Now that you’ve got the know-how, chatting on PCMech LIVE will be a much easier experience if the browser method proved to be inconvenient for you.

Also bear in mind the instructions above will work for any Ustream chat, even for shows other than ours. All you have to know is the channel name (as in the name with the # in front of it.) Any show host should know this information and will readily give it to you so you can connect via IRC client instead of the browser.

Running A Command Prompt As Administrator (Vista or 7)

Certain commands in Windows Vista and 7 require “elevation” in order to execute. For example, if you run NETSTAT -B, a notice will appear that states:

The requested operation requires elevation.

What does this mean exactly? It’s means you need additional permission(s) to execute the operation. This is done by executing a Command Prompt as Administrator. See video below for instructions on how to do it (it’s easy).

Basic Windows FTP Command Line Scripting

Sometimes there is a need to login via FTP from the command line in Windows. Maybe you just need to login to make a quick upload or download.

This tutorial will show you how to make a quick login script that will login you into your FTP server without having to type it in.

To do this, we write two text files (one script, one batch) and place both of them in the C:\WINDOWS folder for "launch from anywhere" access since C:\WINDOWS is by default in the resident path.

Step 1: The FTP Scripting File

Open up Windows Notepad and enter the following 3 lines:

open [your ftp server address here]
[your ftp username]
[your ftp password]

Here’s another way of looking at it:

open ftp.example.com
myusername
mypassword

Save this file as C:\WINDOWS\goftp.txt

Step 2: The Batch File

Open up Windows Notepad again, create a new text file and enter the following two lines:

CD C:\WINDOWS
ftp -s:goftp.txt
exit

Step 3: Run the batch file

The files are already in the system path so you can directly launch this from the Run dialog box.

Click Start then Run, type goftp and click OK.

A command prompt window will appear and log you right in.

When you type exit to log off from the FTP server, the window will automatically close (that’s what the "exit" line is for in the batch file).

Quick question answered: Can’t all this be done in a single batch file?

Answer: No. When the batch file calls the FTP application it cannot execute commands within the FTP session. That’s why you need an additional text file to "carry in" commands with.

If your batch file looked like this:

CD C:\WINDOWS
ftp ftp.example.com
username
password

..this is wrong. The batch file will stop right after the "ftp ftp.example.com" line and will not input the username or password. And when you exit the FTP session you’ll get a command line error because your FTP username and password aren’t Windows executables.

One final note: This is obviously not secure whatsoever. If someone found the scripting file in your C:\WINDOWS directory, they’ve got your FTP username and password.

Only do scripting like this on a computer nobody else uses but you.

Nifty: Command Line Wikipedia

image Never let it be said that computer scripts aren’t useful. Recently a *nix bash shell script was released that allows you to search Wikipedia right from the command prompt – and it works. You can try it out for yourself if you like (scroll down on that page for the script lines) to make your own wikipedia.sh.

Some of you out there may read this and think, "Um.. yeah. Why? What’s the point of scripting anything when we have web browsers?"

Good question. The answer is speed. Bash scripts (or basically any other kind of command line script) run faster than a GUI-based app ever could because there isn’t any screen-draw involved other than the text itself.

[Source: Linux Today]

Using Google Operators/Commands To Find Stuff Faster

image The search engine Google has a ton of different operators you can use to find stuff faster and easier. I will say up front that only the very few have all of them committed to memory (and if you do, you use Google way too much). :-) No, you don’t have to know all of them. However there are a few you can commit to memory that will help you out quite a bit.

site:

This is a query modifier. In plain English this means "search [this] specific site for [this word/phrase]".

For example, if you wanted to search pcmech.com via Google for the word computer, the Google search is:

computer site:pcmech.com

You don’t have to use www. Just the domain (that being pcmech.com).

Here’s another example:

stayin’ alive lyircs site:lyricsfreak.com

This will search the site lyricsfreak.com for the lyrics to the song Stayin’ Alive.

define:, what is, what are

In plain English this is a dictionary search via Google.

Example:

define:computer

or

what is computer

or

what are computers

Google will go out and find a definition for the word computer.

Note, define: is the best one to use.

weather

A quick way to get a weather forecast from Google.

Example:

weather Tampa FL

or

weather 33617

Note that there is no colon sign (:) with the weather command.

If you want to see the huge list of stuff you can do with Google, a comprehensive guide is here.

Fear Not The Command Prompt, File Listings (Windows XP)

imageHere are a few quick tips you can do from the command prompt in Windows XP (this will actually work in all versions of Windows since 3.1):

Getting a listing of every single frickin’ thing on your hard drive in a single text file

Command:

DIR /S C:\*.* > C:\all.txt

This will write a text file of every single file on your system (excluding hidden files) to the file all.txt in the root of C drive. It will take a while and the text file will be humongous. When I did this my end result text file was 9MB in size. For a text file, that’s huge.

If you try to open this file afterwards in Notepad, it will crash because Notepad can’t handle something this big. However, if you get a better text editor like Notepad++, you can open big honkin’ text files.

Reason why would you would want to to this: There is no easier way to get a complete listing of all files in Windows in a portable file. If you’re troubleshooting your computer and want to see where specific stuff is without clicking all over the place, this is the way to do it. And it’s unbelievably faster than listing files using the standard Windows search.

Getting a listing of a specific type of file using the same method

Command:

DIR /S C:\*.DOC > C:\alldocs.txt

This will write a text file called alldocs.txt to the root of C drive containing a listing of every single file on your system ending with DOC (i.e. Word documents).

Since this listing will be much smaller it can be opened in Notepad easily. Launch Notepad and open the file C:\alldocs.txt and you’re off to the races.

You can do this with any file extension. If you want to find all XLS (Excel) files, change *.DOC to *.XLS. If you want to find all JPG files, change *.DOC to *.JPG – you get the idea.

Common file extensions in Windows

  • Plain Text: TXT
  • Word: DOC
  • Excel: XLS
  • Video: AVI, WMV, MPG, MPEG, QT, MOV
  • Audio: WMA, MP3
  • Image: JPG, JPEG, GIF, PNG
  • Archive: ZIP, RAR
  • Executable file/installer: EXE, MSI

Send Emails From The Command Line

Continuing the subject of useful command line tools, I ran across one today which I am really thankful I found: Blat.

Blat is a command line SMTP mailer. It is simple to use, just “install” Blat by specifying the default SMTP server and from address to use and then you can email text files with a single command line instruction. This is ideal for backup or diagnostic warnings.

Again, this is a great tool to have and it sure beats my old method of piping text output from a file to the PHP command line…