Search This Blog

Sunday, 10 January 2010

Mac: Bash history

I find it useful to refer back to commands I have used. Here's my current history:

ls -al /var/log/*.out
/Developer/Library/uninstall-devtools ; exit;
mppdec 16.mpc 16.wav

cd .gnupg

openssl md5 gpg.conf

openssl md5 pubring.gpg

openssl md5 secring.gpg

openssl md5 gnupf1.4.8.dmg

openssl md5 gnupg1.4.8.dmg

cd my\ disc

ls -R > ~/desktop/ds games 1.txt
Recursively list directory contents
chmod +x Mon1830.sh
Change file permissions
chmod +x ~/desktop/Mon1830.sh

mkdir ~/bin Make directory

whereis Mon1830

export PATH=$PATH:/users/<>/bin

echo $PATH

man crontab

echo $
?
cd /var/log

edit daily.out

/Applications/Firefox.app/Contents/MacOS/firefox -safe-mode

defaults write com.apple.Dock showhidden -bool YES Show hidden files

killall Dock

defaults write com.apple.iTunes invertStoreLinks -bool YES
Remove iTunes Store links
AppleSystemProfiler | grep Applications >> ~/installedApps.txt
List all installed apps
/Users/<>/bin/Fry ; exit;

defaults write com.apple.screencapture type jpg
Save screen captures as JPGs
defaults write com.apple.iTunes show-store-arrow-links -bool FALSE

cd /etc/hostconfig

open hostconfig

ls -1 | perl -e 'while(<>){ chomp($_); if(/(.*) - (.*).jpg/){ `mv "$_" "$2 - $1.txt"` } }'cd /

cd etc

edit hostconfig

type hostconfig

pico fstab
Text edit
cd /etc

pico fstab.hd

diskutil umount -v "<>s iPod"

diskutil umount -vf "<>s iPod"

diskutil umount -vf "/volumes/<>'s iPod"

diskutil unmount /volumes/ \ \'s\ iPod/

diskutil list

diskutil info /volumes/\ \'s\ iPod/open ~/ .bash_history

defaults write com.apple.finder AppleShowAllFiles TRUE
Show all files
defaults write com.apple.finder AppleShowAllFiles FALSE

ifconfig
Network settings
mail

console

sudo nvram boot-args="-v"

ls -R / > ~/Desktop/dirlist

cd 'music backup'

cd /volumes/'music backup'

ls / > ~/Desktop/dirlist

ls > ~/Desktop/dirlist

lame --tg comedy --preset 56 /users/<>/Desktop/Truth.wav /users/<>
/Desktop/Truth.mp3
Convert wav to MP3
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES; killall Finder

traceroute news.bbc.co.uk

traceroute -I newsimg.bbc.co.uk

traceroute news.bbc.co.uk

chmod +x RM2MP3

./configure

./configure --enable-gui

./configure --enable-gui --datadir=/users/<>/.mplayer/skins

mplayer 1.rm -ao pcm:file=1.wav -vc null -vo null
Using mplayer to convert Real Media file
md5 ubuntu-8.10-desktop-i386.iso
MD5 check
xterm

env

sudo port install mplayer
Install using ports
gmplayer

mplayer

port installed

port help

sudo port -v selfupdate

/System/Library/Frameworks/CoreServices.framework/Frameworks
/LaunchServices.framework/Support/lsregister \-kill -r -domain local -domain system -domain
user

diff -rq "on u sound albums" on_u_sound_albums_old
List all file differences
diff -rq "on u sound albums" on_u_sound_albums_old > diff.txt

ls -R > ~/Desktop/dirlist

cp ~/.bash_history /users/<>/desktop/bash.txtcp ~/ .bash_history /users
/<>/desktop/bash.txt

cp ~/.bash_history /users/<>/desktop/bash.txt

cp ~/.bash_history /users/<>/documents/tech/mac/bash.txt
Copy bash history
sudo port -d selfupdate

sudo port -v selfupdate

sudo passwd root

cd /volumes

rm -R "<>'s iPod 1"

sudo chflags -R nouchg/Volumes/<>\ iPod\ 1

sudo chflags -R nouchg/Volumes/<>\ iPod\ 1/.Trashes

defaults write com.apple.finder AppleShowAllFiles TRUE

defaults write com.apple.finder AppleShowAllFiles FALSE

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

sudo port -d selfupdate

sudo port remove mplayer

sudo port uninstall mplayer

port list installed

sudo port install xterm

xterm

rsync -ave /usr/bin/ssh ~/Documents/<> /Volumes/<>/Documents/
Initial rsync scripts
rsync -ave /usr/bin/ssh ~/Music/iTunes/"iTunes Music" /Volumes/sda1

rsync -ave /usr/bin/ssh ~/Pictures/"06. Photos to Print/To print" /Volumes/<>
/Pictures/"06. Photos to Print"

rsync -ave /usr/bin/ssh ~/Downloads /Volumes/sda1

/Applications/iPodBackup.app/Contents/Resources/rsync ; exit;

whereis backup_exclude.txt

pico ~/bin/backup.sh

chmod +x ~/bin/backup_pictures.sh

cp /users/<>/documents/tech/mac/bash.txt ~/.bash_history

exit

whereis *grease*

help

ps -ax

diff -rq "/users/<>/music/itunes/itunes music" "/Volumes/sda1/iTunes Music"

mplayer

drutil eject

/Applications/Firefox.app/Contents/MacOS/firefox-bin -safe-mode

qlmanage -m

launchctl unload /System/Library/LaunchAgents/com.apple.quicklook.plist

umount sda1-1

curl -O 'http://www.studiosells.net/msells/netinv'

chmod a+rx ./netinv

perl -MCPAN -e 'install Net::MAC::Vendor'

netinv

netinv > i.txt

ls /Applications/ >> appsiuse.txt

AppleSystemProfiler | grep Applications >> ~/installedApps.txt

cd delicious_checker-0.2/bin

defaults write com.apple.Safari TargetedClicksCreateTabs -bool true
Safari load tabs, not windows
ln -s "/Users/<>/Pictures/10. TBA" /Users/<>/Dropbox/

tail -f /var/log/system.log

cp -r * /home

defaults write com.apple.finder AppleShowAllFiles TRUE

defaults write com.apple.finder AppleShowAllFiles FALSE

/usr/sbin/tcpdump

ping 255.255.255.0

top -u -s3
Show most resource hungry apps
rm -rf ~/.Trash/
Empty trash from terminal
crontab -e

mail

killall Finder

Finder

cd /volumes/'music backup'

killall Dock

killall -KILL Finder

cd Documents/logs

chmod a+rx

chmod -R 777 *

open ~/.bash_history

diskutil list

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

chflags hidden "<>"

chflags nohidden "<>"

cp ~/.bash_history /users/<>/documents/tech/mac/bash.txt

backup_pictures2.sh

backup_music.sh

backup_docs.sh

exit

Mac: Keyboard

Delete on a MacBook Pro is backspace + Fn. Stupid, should just have a delete key

What else do I constantly forget? Yes, the # key, the one you use a hell of a lot. It's alt + 3.

Screenprints - Command - Shift - 3 (Command = the key with the little Apple on it)

Command - Shift - 4 - select an area to print

Mac: Insufficient space

Is it that easy to fill up 120GB?

Yes, extremely easy. I'd already mentioned that Parallels was removed to try and free up some space, but with around 60GB of music, nearly 15GB of photos, then documents, videos, etc; plus programs and other miscellaneous settings, I soon found that I was down to only around 7GB free.

Posts on various Mac forums resulted in this extremely detailed and easy to follow guide to replacing a HDD.

Searches on various forums, including Apple's own, suggested that I could replace with a drive up to 500GB, but to get the speed I would need, a 320GB would be more suitable. I therefore plumped for the Western Digital Scorpio Black 320GB SATAII 16MB Cache 2.5 inch Internal Hard Drive from Amazon for £72.99.

I followed the suggestions and initially backed up using the freeware Super Duper. Confident this had all worked OK, I was ready to begin.

Taking apart the MBP was not too difficult, and I was surprised at just how seemingly flimsy the insides were. Then I encountered a problem - Step 13 refers to removing the "... two silver Phillips screws securing the hard drive retaining bracket to the lower case". Well, I had no such screws. Nope, I had Torx screws. Better than that, they were Torx screws for which I did not have the appropriate bit.

So, a mad dash down to Maplins (where I also bought a sale price high gain aerial) produced the correct bit so I could continue.

Fortunately from there, all was plain sailing. The insertion of new drive was straightforward, restore from Super Duper too, and now, over a year later, I still have a reasonable proportion of free space (although, of course, it always expands to the space available)

Mac specific apps

The posting may actually speed up a little after this. *May...*

The first Mac app to get familiar with, which I'd previously seen on Windows anyway, is of course iTunes. The main difference between previous media players was the whole way in which the library was arranged, with the slight annoyance of "Unknown Album" - not every song is or has been on an album!

The impact of this is that compilations I'd previously set up for 60's, 70's, etc, no longer worked in the same way as when I used Music Match Jukebox on my Archos Gmini. Now I have got used to it, I don't actually mind that much.

The Macbook came pre-installed with iWork, but I wasn't tempted to pay for an application when the excellent Neo Office is available for free. Ditto Aperture, when I could use free applications such as the GIMP and Seashore. Fortunately, that was pretty much it for pre-installed apps I did not want to use.

Safari was the next one to look at. Even though I have now installed Xmarks to keep in sync with work PC, and a version of del.icio.us to allow me to access my preferred bookmarks, the lack of extensions that I have on Firefox means I use it sporadically.

iChat is OK, but I swiftly decided to use Adium instead due to its ability to work seamlessly across various different IM clients.

One application I was keen to install was Delicious Library, having read about it in John Naughton's Observer columns. This great little app allows you to load various media items into a glossy interface - books, CDs, DVDs, gadgets, games, etc. It uses the Mac's inbuilt iSight as a barcode scanner and carries out lookups via various different Amazon sites. This isn't always foolproof, so text based searches are also possible. It is true to say that it can be a little flaky at times, and at one point I lost my entire DB and had to restore from a backup, but nonetheless this is a much more attractive option than a dull old spreadsheet cataloguing system.

Best intentions are a wonderful thing - I have still done no more than briefly tinker with Garageband, but I promise to myself that its time will come. The same goes for iWeb - it's there, but I have not played with it.

Removing installed apps on Mac is so simple, but is helped by App Cleaner which also nicely removes all associated files, settings, etc. I work this alongside Monolingual, that deletes all the language files that come with applications that are not required (this saves 100s of MB of space) as well as Cache Out that does a useful clean on start up (not that starting up is required too often on a Mac)

Now that I have a Flickr Pro account (and had painstakingly and timewastingly scanned in all my old photographs before I finally plumped for a digital SLR a couple of years back), the Flick Uploadr is very useful too.

xACT allows me to convert FLAC files to MP3 (via WAV) format for use on iPod

Stuffit Expander looks after most compressed file formats

SWF & FLV Player, MPEG Streamclip, iSquint, MacTheRipper and Handbrake take care of various video needs. I have to say I have been unimpressed with iMovie's abilities, preferring instead Toast Titanium for burning, but the Mac SuperDrive is extremely fussy when it comes to accepting DVDs and even CDs, half the time spitting them out contemptuously.

At the very outset, I tried a trail version of Parallels and experimented with triple OS setup using Win XP and Ubuntu. Nice, but ultimately I realised that I didn't really need to use either, and all they were doing was taking up valuable disk space - so that all came off!

But the disk space continued to be an issue....

Saturday, 25 July 2009

Mac customisation

The Leopard disk arrived and I duly upgraded. Immediately got the offer to set up Time Machine, but that hasn't happened yet - will do soon(ish).

Installed some of my favourite apps from experience on Win and Ubuntu:
Firefox
Thunderbird
Audacity
Clam XAV
Google Earth
VLC
Transmission

I'd previously used Open Office, but found Neo Office to be even more impressive on Mac. But what Mac specific apps to try?

Mac: Move to Mac

OK, so I have been extremely lax and this is something I should have posted about eighteen months ago. Ho hum.

I'd blogged before that I had been using Ubuntu on my Gateway PC. Over time that PC had been much modified - additional hard drive, additional memory, video cards, etc.

But it became time to face facts. A seven year old PC was feeling its age. I'd pretty much done all I could do to wring every last drop of performance from it.

So, what to do? Well, what do I use my machine for? Predominantly, music, video, photos and web. Not gaming. So should I go for a new PC running Ubuntu, or consider something else?

The header to this post makes the answer pretty obvious. I first decided on a Mac in about April 07. But then there was the small matter of a new OS on its way - Leopard. And where to buy from? A bit of hunting revealed that buying at an airport meant no VAT and a significant saving. So, courtesy of Apple and Dixons Duty Free at Gatwick Airport, in November 2007 we had a weekend in Florence paid for - in effect - by HMRC.

The process was very easy too - order the machine in advance on the phone. Pay on the day at the airport, collect on the way back so no need to lug it all the way out to Italy and back. A process we've also used to buy a PSP, a DS and a Camcorder!

The model I went for was the MacBook Pro, 2.2 GHz, 2GB 667 MHz DDR2. Silver. Very nice.

After a very pleasant weekend in Florence, and picking up the Mac on the way back, I was able to look at it for the first time when I got in.

Initial impressions / observations:

1. Where's the mouse? I naively assumed that "Apple Remote" was Apple-talk for a mouse. Nope!
2. Didn't come with Leopard installed, instead I was given a discount off the sale price to allow me to order an upgrade disk from Tiger direct from Apple. At the same time I ordered a Mighty Mouse. I should have ordered the wireless version because...
3. Why only two USB ports? Very limited! (Have subsequently bought an inexpensive Belkin 4 port hub)
4. Where's the delete key? And...
5. Where's the hash key? And...
6. I'm in the UK, I bought the MBP in the UK, so why is " symbol not reached by shift-2?

But also...

7. Unlike a new Microsoft PC, made a very pleasant change to not find a machine bloated with lots of trial versions of programs. iWork, Office for Mac and Aperture (as I recall - it was a long time ago) were pretty much it.
8. Where's the title bar of the apps? Oh, there it is! How obvious!
9. It's intuitive, but you have to "unlearn" bad or bizarre behaviour learnt from using PCs. It takes time!

Tuesday, 27 March 2007

Ubuntu on new Dell C521

Brand new PC - shipped early December with Win XP Pro installed.

Oodles of hard drive space. Nice fast processor.

So, easy to install Ubuntu?

Well, not quite.....

First issue - yeuch - horrible screen scrolling when putting in live CD! Then came the partitioning part. I obviously didn't want to over-write the Win partition, but does the sliding scale indicate the size of the Linux partition or the Win one?! Doesn't say at all in the graphical installer. But from a check on Google it seems it's the Nux partition. Which could have been a costly mistake.

And if I tried to partition myself, the options that came up were completely non-understandable!

The install kept freezing too. Another quick search revealed that one should defrag the PC before trying install. So, did that, and....

Install thereafter went OK! But why did the USB mouse keep freezing? Simple unplugging and plugging in again rectified this, but hardly a long term solution. Googling revealed this site, and one firmware download later, USB mouse behaving AND horrible scrolling effect gone!

Then tried the Beryl install. Worked very well in comparison to my machine. And very nice it looks too!

Aim now is to install the latest release 7.04 when it's out of Beta!!!