Become a power “pinger” in the Terminal

ping

It is always fun to read the “man” pages in terminal and learn more about each command that I already use. I recently read the man page for ping and learned some cool stuff worthy of sharing.

Ping in specific time intervals

  • To ping at a time interval other than the default 1 second us the option flag of ‘-i [seconds to wait]‘
  • Example: ping -i5 www.google.com
    • This command will send a ping to google every 5 seconds
    • Note: It appears that any interval below 1 second requires root privileges

Super Ping! aka “Flood ping”
Personally, I think super ping sounds way cooler than flood ping but the later provides a better description of what it does.

  • According to the “man” pages, a flood will send out pings as fast as they come back or 100 pings/sec. Which ever one is happening faster will be the rule that is followed.
  • Example: sudo ping -f www.google.com
    • This command will print a period to the console for every packet sent and will delete a period for every packet received. The cumulative effect of this is as more packets are dropped you will see more and more periods accumulate on the screen giving you instant feed back on how fast packets are being dropped.
    • Note: Use this command very wisely and with caution as it taxes your network.
    • With my internet connection, pinging google, I was able to send off 6,000 pings in 10 seconds.

The terminal is a very powerful tool!

archive_and_cite

Licensing
—————–

You may remix, tweak, and build upon this work even for commercial reasons, as long as you credit me and license your new creations under these identical terms. All new works based on this work will carry the same license, so any derivatives will also allow commercial use. To credit this work please use the web citation and archive service found at http://www.webcitation.org/archive or click on the “Archive & Cite this page!” image above.
Creative Commons License
Become a power “pinger” in the Terminal by Mike Grace is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

Sources
—————-
The “man” pages were used for the information found in this post. You can find the ping man page by typing into a unix or linux terminal the command “man ping” or a copy of several operating system man pages can be found at http://manpages.unixforum.co.uk/

open files or directory from OS X terminal

Terminal loves Finder

Terminal loves Finder

In Mac OS X Terminal open the current folder in Finder by using the command ‘open .’ You can also open a file with its default application by using ‘open fileName.fileExtension’

Examples:

If the current working directory in terminal is “/System/Library” then ‘open .’ would open “/System/Library” in finder.

‘open test.txt’ would open the text file “test.txt” in TextEdit.

‘open *’ would open all the files in the current directory with their default applications.

‘open *.jpg’ opens all jpg images in folder.

‘open [ABC]*.pdf’ opens all pdfs that start with an uppercase A, B, or C.

The possibilities and the power of the ‘open’ command in terminal are astounding. Learn even more about the command by using the command ‘man open’ or just ‘open’ and the terminal will display more information on that command and how it is used. If you use the ‘man open’ command spacebar will show the next page and ‘q’ will exit the manual.

Sources
————-
The heart in the image was acquired from http://www.eyehook.com/free/love.html under the Creative Commons Attribution 2.5 Generic License

URL: http://www.eyehook.com/free/love.html Accessed: 2009-4-24. (Archived by WebCite® at http://www.webcitation.org/5h1DQldAm)

License
————-
Creative Commons License
Open files or directory in Finder from OS X Terminal by Mike Grace is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

How to make your comments stand out

One fun way that I have found to make my comments stand out is to create an account at http://gravatar.com/
Creating a free account and uploading an avatar allows your avatar to show up on comments made on Gravitar supported sites and blogs.
It only takes a minute and it will take your comments from looking like this ->

picture-1

to this ->

picture-2

Sources:
——————–
Gravatar. URL: http://en.gravatar.com/ Accessed: 2009-4-9. (Archived by WebCite® at http://www.webcitation.org/5gea5ktiY)

WordPress upload fail – unable to create directory…

wordpress_bigger

Error Message: Unable to create directory … {long directory path} … Is its parent directory writable by the server?

Cause: I recently changed hosting services so when I migrated my blog over to the new server everything worked great except for my WordPress uploads. Most things in WordPress are kept relative and ask the server where things are but the path to the upload files are kept in the database so if you change servers without changing the database string pointing to the correct directory you will get an error and probably frustrated also.

UPDATE 05/25/09

Thanks to a comment from Matt Lindsay I now realize that there is a much easier way to update the wordpress upload string in the database than digging into the actual database. A big thanks goes out to matt for making my blog better. ; )

Quicker and easier fix

  1. Login to your WordPress Admin
  2. Go to “Settings”
  3. Select “Miscellaneous”
  4. Put the correct path in the input field labeled “Full URL path to files”
  5. Save the changes and you should be done

picture-11

The advantage I had in digging into the database is that when I switched hosting services only one of the folders in the path changed so I went in and just modified the one folder. This is nice if you don’t know the exact file path from the server root like me. ; )

Older more complicated fix:

  1. Login to your database for the WordPress blog.
  2. Browse/ view tables in the database created when setting up the blog
  3. Browse/ view table named “wp_options”
  4. In the “option_name” column look for “upload_path” (was #60 for me)
  5. Edit the row values and change to the correct path
  6. Save changes

picture-4

After making that change the problem should be fixed and uploading will now work. If this helped be sure to give me a shout and leave a comment. Best of luck to you. ; )

Sources:
—————–
I figured this out all on my own. ; ) #HappyGeek