The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 21, 2019, 12:39:19 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: bash functions on the command line  (Read 2368 times)
ratthing
Journeyman
***
Offline Offline

Posts: 75


View Profile
« on: December 26, 2007, 10:10:57 AM »

Learned this new one today, looking for a solution to a completely unrelated problem (why the heck the load on my box goes up to 6+ when copying a file from a usb drive to a firewire drive using the Finder):

Code:
debug_http () { /usr/bin/curl $@ -o /dev/null -w "dns: %{time_namelookup} connect: \
%{time_connect} pretransfer: %{time_pretransfer} starttransfer: %{time_starttransfer} \
total: %{time_total}\n" ; }

This particular bash function uses curl to display times for various parts of an http connection, so you can figure out why a page is loading slowly.

Slap that in your .bashrc or .profile, then call from the command line:
Code:
~ratthing%> debug_http www.cnn.com

Knew this in theory, never thought of using it in practice.

=RT=
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: December 26, 2007, 11:23:35 AM »

Handy RT, thanks!
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!