having fun on the network

Itunes has a shared library feature but does not show you who and what is it sharing to.So lets start terminal and type :

lsof |grep iTunes |grep TCP

You can also find out what they are listening to by doing

lsof | grep mp3

Now how about for a little fun , say your colleague is listening from a windows machine

nmblookup -A 192.168.0.23

gives you their netbios name , next on use that name with :

echo “Ejoying songname John ?” | smbclient -M THENAMEHERE

shows a dialog like this smack middle in their windows screen
alert
Note that you can send messages like this to any computer you see in finder’s SHARED sidebar , just don’t abuse it , it will stop being funny.
Advertisements

deleting junk and cache

For every folder you open in Finder it saves a .DS_Store file in that folder with the window settings , here is a easy way to get rid of them (texts in bold are shell commands to be put into Terminal ) the command recursively traverses all the directories , you can replace all the path with / for a system wide cleanup

find /Volumes/myvolume/mydir -name “.DS_Store” -print0 | xargs -0 rm -v

Like all operating systems there are some caches on osx that you might sometimes want to get rid off , to do so :
rm -rfv ~/Library/Caches/
removes all caches for the logged in user
sudo rm -rfv /System/Library/Caches/ /Library/Caches/
removes some system wide caches
sudo rm -rfv /private/var/folders/
removes Leopard specific cache folders
The osx kernel is a modular one meaning extensions are loaded into it as needed , to speed things up especially at boot caches are made that from time to time you might want to clear
sudo rm /System/Library/Extensions.kextcache /System/Library/Extensions.mkext /System/Library/Extensions/Caches/com.apple.kext.info

dual boot , one itunes library

Since i started dual booting either Tiger or Leopard one thing that really annoyed me was that i had to deal with 2 itunes libraries , not being able to have the same thing in itunes no matter what i boot into.

Well there is a very elegant and easy fix for that that i am going to detail in this post and it only requires you to have a extra partition besides the ones that you are booting from.
So let’s get to it (texts in bold are shell commands and should be entered via Terminal):

1 – move your itunes library to a partition you do not boot from (i put mine on the Storage partition)

mv ~/music/iTunes /Volumes/IStorage/

2 – boot into each of the os’es and delete ~/music/iTunes if existing and make a symbolic link to the new location in its place

ln -s /Volumes/IStorage/Itunes/ ~/music/iTunes

This works beautifully and it works at some extent for things like Photo Booth too , also tho it might work i do not advise to make the links with Finder , just stick to console.

avi movies in front row and itunes

Everyone has those divx movies , you can play them in quicktime given you have the proper codecs like Perian , but the pesky itunes will not add the files to its library.

What we need to do is basically change metadata of files by adding type “MooV” to them , the simplest way to do it is download this applescript droplet i wrote and just drag the files you want fixed on its icon.

A more involved way to do it that needs devtools (found on the install dvd) installed is by entering the bold text below in Terminal , after you modified the path and extension to suit your needs.

find /path/toyour/movies/directory -name “*.avi” -print0 | xargs -0 /developer/tools/SetFile -t “MooV”

Now that you can play those files with itunes how about having them show and play in Front Row from the confort of your remote ??!! , without even adding them to the itunes library , it is just a matter of making symbolic links in your ~/Movies folder to the directories containing your movies , you can use the shell or just alt+cmd drag them to ~/Movies to make the links.

osx and movies

OSX is nice , and not because it has no shortcomings , but because you can fix them as opposed to windows.This has a lot to do with the power of osx that stems from it having applescript and a posix compliant shell.

Here is how to change metadata of files so you can play divx movies with itunes for example , with terminal and devtools

find /path/toyour/movies/directory -name “*.avi” -print0 | xargs -0 /developer/tools/SetFile -t “MooV”

, with applescript http://forums.ilounge.com/showthread.php?t=214705

Now that you can play those files with itunes how about having them show and play in Front Row from the confort of your remote , without even adding them to the itunes library , it is just a matter of making symbolic links in your ~/Movies folder to the directories containing your movies , you can use the shell or just alt+cmd drag them to ~/Movies to make the links.

If yo do not know by now you can download movies from youtube just by selecting the file in Safari > Activity > Copy > Paste into downloads window.

How about playing every movie format there is including the flash movies you just downloaded from youtube in anything you like , quicktime , itunes , frontrow etc , well then just download http://perian.org/ and never care about formats of movies ever again.

To top it off i have a script for those times when you do want to know what are your movie files encoded with , this is a extremely fast shell script , with basic info , you can get it packaged as a osx app to drag folders to or directly as a cross-platform script.

vlad_videntify

Google tricks of the trade

Google without advertisments or adwords
http://www.google.com/ie

the bad part with the adfree search is that you do not have a advanced search option

however you can put manually the options in the url like this
http://www.google.com/ie?num=100

the url above for example shows 100 finds per page and to not have to write all the options every time you can make it your homepage like i do

Google in english indiferent of the country you are in
http://www.google.com/ncr

External tools:

Poodle from gritechnologies can help in search engine optimization
http://www.gritechnologies.com/tools/spider.go

This interesting script at http://www.scroogle.org/scraper.html claims to show you how google is broken and what results it fails to show/rate like it should

http://www.mypagerank.net/ can show you the google pagerank for a specific site

http://www.soople.com is also a extension of google , better put , some kind of a gui for some of the google functions i detail below

Special searches :

you enter for example “phonebook:mancini ca” in a google search box and you can access it’s phonebook listing

phonebook:nameaddress shows phonebook entry of person
define:word gives definition of any word
related:url same as “what’s related” on serps.
link:url Shows other pages with links to that url.
site:domain restricts search results to the given domain.
allinurl:url shows only pages with all terms in the url.
inurl: like allinurl, but only for the next query word.
allintitle: shows only results with terms in title.
intitle: similar to allintitle, but only for the next word. “intitle:webmaster google” finds only pages with webmaster in the title, and google anywhere on the page.
cache:url will show the Google version of the passed url.
info:url will show a page containing links to related searches, backlinks, and pages containing the url. This is the same as typing the url into the search box.
spell: will spell check your query and search for it.
stocks: will lookup the search query in a stock index.
filetype: will restrict searches to that filetype. “-filetype:doc” to remove Microsoft word files.
daterange: is supported in Julian date format only. 2452384 is an example of a Julian date.
maps: If you enter a street address, a link to Yahoo Maps and to MapBlast will be presented.
phone: enter anything that looks like a phone number to have a name and address displayed. Same is true for something that looks like an address (include a name and zip code)
site:www.somesite.net “+www.somesite.+net” (tells you how many pages of your site are indexed by google)
allintext: searches only within text of pages, but not in the links or page title
allinanchor: searches only within links, not text or title