Do you need to find out which processes are listening to the network on your Mac? Here’s how:
lsof -i | grep LISTEN
Tonight I tried to set up my mobile phone number into Yahoo!mail’s account recovery process. In general, this is a good idea, but Yahoo! didn’t repair the obvious problems completing this process on iPhone. I wonder if they tested it at all?
I sent them the following as feedback on their website:
(hmmm…. Tumblr’s “block quote” tool seems to be broken…)
Here’s feedback about your account recovery set up process
Tonight I tried to add a mobile number to my email account, which I think is a great way to increase the security of my email account (Thanks!)
Then I got an email, saying “If the changes described above are accurate, no further action is needed….”
But then I ALSO got an SMS message to my mobile, with a confirmation code. Huh? Am I finished or not??
To save you the bother of looking it up, here’s the text of that:
“Enter confirmation code: XXXXXXXX to verify and add this mobile phone to your Yahoo account.
More info at ca.r.yahoo.com”
So I click on the “ca.r.yahoo.com” link, and go to a page with a radio box. I choose “I got a confirmation code from adding a mobile phone to my account recovery” (or something like that), but I couldn’t click the “Next” button, as it overlayed the “Terms of Services” link (when my iPhone is held landscape. iOS 5.01, Safari). Turning to portrait, and fiddling with the size helped me get enough of the “Next” button to press it.
But wait — that’s not even why I’m complaining.
The resulting webpage asks me to enter the confirmation code. It’s 8 characters, so I can’t remember it. I’ll copy it. But iOS doesn’t allow me to copy just a part of an SMS message - it gets the whole thing. So, I paste it into ANOTHER app that has a text field (an email message, in this case), then select only the 8 character codes.
Then I return to the Yahoo! page, only to discover that I cannot paste in the field! As soon as I put a CURSOR into the text field, the pop-up jumps away! So, I think, geez, I HAVE to type it in. When I try, I can’t!!!!!!!!! It continues to jump away. It’s pretty clear no-one tested this with an iPhone.
Could you please put this on your bug list?
Thanks!
——
I’ll check back in a month or two, to see if they’ve made it better.
When troubleshooting a fussy Windows XP (or Linux) installation, try SystemRescueCd
While driving or doing the dishes, I listen to podcasts on my iPhone. If I’m adequately cafeinated, I’ll listen at double-speed, which is an option in the iPhone’s iPod app. This doesn’t change the pitch of the speaker, but just speeds up playback. I like it for Twit.tv podcasts, and for Dan Benjamin + John Siracusa’s “Hypercritical”, but works less well when speakers have accents, or when the content is technical, or funny.
iTunes on the Mac and PC don’t have this option, but on a Mac, you can use an AppleScript script to quickly flip to the QuickTime Player, and achieve the same effect. I found this script here:
http://www.talentzoo.com/news.php/Questions-You-Absolutely-Must-Ask-Your-Interviewer/?articleID=9159
- How many clients has your company added this year?
- How many has it lost?
- What is your strategy for generating new clients?
- What kind of tools does the company provide to help me do my job?
- How often are these refreshed?
- What is my top priority in the first 60 to 90 days?
- What is the one thing I cannot fail at in the first year?”
Here are some time-saving UNIX tips that every UNIX user should know, including some from Joshua Levy via Quora:
Everyday use
- In bash, use Ctrl-R to search through command history.
- In bash, use Ctrl-W to kill the last word, and Ctrl-U to kill the line.
- To go back to the previous working directory: cd -
- Use xargs. It’s very powerful. Note you can control how many items execute per line (-L) as well as parallelism (-P). If you’re not sure if it’ll do the right thing, use xargs echo first. Also, -I{} is handy. Examples:
find . -name \*.py | xargs grep some_function
cat hosts | xargs -I{} ssh root@{} hostname
- pstree -p is a helpful display of the process tree.
- Use pgrep and pkill to find or signal processes by name (-f is helpful).
- Know the various signals you can send processes. For example, to suspend a process, use kill -STOP [pid]. For the full list, see man 7 signal
- Use nohup or disown if you want a background process to keep running forever.
- Check what processes are listening via netstat -lntp. See also lsof.
- Use man ascii for a good ASCII table, with hex and decimal values.
- For web debugging, curl and curl -I are handy, and/or their wget equivalents.
- To convert HTML to text: lynx -dump -stdin
- In ssh, knowing how to port tunnel with -L or -D (and occasionally -R) is useful, e.g. to access web sites from a remote server.
- If you are halfway through typing a command but change your mind, hit Alt-# to add a # at the beginning and enter it as a comment (or use Ctrl-A, #, enter). You can then return to it later via command history.
- To know disk/cpu/network status, use iostat, netstat, top (or the better htop), and (especially) dstat. Good for getting a quick idea of what’s happening on a system.
- To know memory status, run and understand the output of free. In particular, be aware the “cached” value is memory held by the Linux kernel as file cache, so effectively counts toward the “free” value.
- Use mtr as a better traceroute, to identify network issues. (not by default installed on Mac OS X)
- To find which socket or process is using bandwidth, try iftop or nethogs.
- Use /proc. It’s amazingly helpful sometimes when debugging live problems. Examples: /proc/cpuinfo, /proc/xxx/cwd, /proc/xxx/exe, /proc/xxx/fd/, /proc/xxx/smaps.
- When debugging why something went wrong in the past, sar can be very helpful. It shows historic statistics on CPU, memory, network, etc.
- Use dmesg whenever something’s acting really funny (it could be hardware or driver issues).
There are lots more here.
A challenge? Understand everything that’s mentioned above. Not learn it, or memorize, but grok the context.
File List is an old file renamer for Mac OS X, now replaced by Name Mangler ($9.99 in the Mac App store) from Many Tricks. File List seems to work even on later systems, such as my 10.6.7 system. Warning, Rosetta must be installed - if it isn’t, File List will offer to install it.
Rosetta is from Apple, and allows software designed for PowerPC CPUs to operate on Intel machines. Having Rosetta installed does not seem to consume more system resources. YMMV.
All Macs with ethernet later than 2005ish have gigabit ethernet cards, so you get good throughput when transferring big files between computers if you directly connect them together with one standard ethernet cable (RJ45 on both ends). Note the cable doesn’t have to be a special “pass-thru” cable, as the Mac’s ethernet cards are “auto-sensing”.
Shortly after connecting the cables to both the PrimaryMac and the Secondary Mac, each Mac will automatically assign an IP address to that adapter, and it will be in the 169.254.y.z range. If this does not happen as quickly as you need, then, on your secondary mac, under the Apple icon, open System Preferences… —> Network —> now click on the “Ethernet” section to see your Mac’s IP address. (on Leopard and Snow Leopard machines, you can also click on the Airport menu bar icon, and choose the bottom entry “Open Network Preferences”). You may have to authenticate to allow this change to occur.
On your PrimaryMac, in the Finder, Press “Cmd-K” to “Connect to Server”, and type the IP address of the SecondaryMac:
afp://169.254.x.y
where afp stands for “Apple File Protocol”, and 169.254.x.y is SecondaryMac’s IP address. Press “enter” and you’ll be prompted to enter a valid username and password on SecondaryMac.
When you succeed, you’ll be able to use the Finder to move large files around very quickly. From a 1.25GHz G4 PowerMac running Tiger 10.4.11, connected to a 2.8GHz iMac running SnowLeopard 10.6.7, a 71MB file (74695308 bytes) it took about 4.5seconds to copy by the Finder, and about 7 seconds to copy by command line ($ rcp test.mpg user@SecondaryMac).
SecondaryMac:~ ~$
SecondaryMac:~ ~$ ifconfig en0
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 00:23:df:fe:16:4c
inet6 fe80::223:dfff:fefe:164c%en0 prefixlen 64 scopeid 0x4
inet 169.254.233.90 netmask 0xffff0000 broadcast 169.254.255.255
media: autoselect (1000baseT <full-duplex,flow-control>)
status: active
SecondaryMac:~ ~$
PrimaryMac:~ ~$ ifconfig en0
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 169.254.23.27 netmask 0xffff0000 broadcast 169.254.255.255
ether 00:0a:95:d0:01:9c
media: autoselect (1000baseT <full-duplex>) status: active
supported media: none autoselect 10baseT/UTP <half-duplex> 10baseT/UTP <full-duplex> 10baseT/UTP <full-duplex,hw-loopback> 100baseTX <half-duplex> 100baseTX <full-duplex> 100baseTX <full-duplex,hw-loopback> 1000baseT <full-duplex> 1000baseT <full-duplex,hw-loopback> 1000baseT <full-duplex,flow-control> 1000baseT <full-duplex,flow-control,hw-loopback>
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
PrimaryMac:~ ~$
You can always use Google’s “Advanced Search” to constrain Google searches by date, but this takes multiple clicks. If you remember it, you can simply append this to the end of your search URL:
,qdr:d72
This limits the search to results in the last 72 days. Similarly
,qdr:m2
constrains the search to the previous 2 months. You can constrain the search to a date range, e.g. to limit your results to the 4th quarter of 2006, you’d append this:
” daterange:2454009-2454010”
to the end of your search URL, without the double-quotes.
(Source: google.ca)