Showing posts with label OSX. Show all posts
Showing posts with label OSX. Show all posts
Wednesday, March 13, 2013
Breathing new life into a sluggish iBook G4
Well maybe not as much new life. Let's call it an iBook G4 on dialysis, anyway the main objective was to erase and reinstall OSX 10.5 Leopard on my 12" iBook G4 1,33 GHz . Unfortunately my original DVD was "lost" so I had to go and find another solution.
Wednesday, February 27, 2013
What time is it?
For some reason I can't use PTT Twitter anymore so I started to look around for another console based twitter client. I found TTYtter. However I ran in to problems with the time being way off on my Digital Picture Frame. Probably because I haven't bothered to set it at all.
http://www.linuxselfhelp.com/quick/clock.html
http://wiki-old.unix.se/NTP.html
http://wiki-old.unix.se/Cron.html
http://www.linuxselfhelp.com/quick/clock.html
http://wiki-old.unix.se/NTP.html
http://wiki-old.unix.se/Cron.html
Labels:
Command line interface,
Linux,
OSX,
Software Tips,
Toshiba 320CDS
Tuesday, March 23, 2010
Super simple rsync howto
This little howto contains pretty much everything you need to use rsync to back up and or synchronize two folders locally. I decided to do this writeup after after reading this article on lifehacker. I wasn't completely satisfied with the article so I did some digging to get the answers I needed. I know there's alot of rsync tutorials out there but I wrote this for my own personal use and also I tried to keep it as short as possible while explaining what's being done.
Oh, by the way rsync is really powerful and this only scratches the surface of what rsync can do. But you don't need more info to do local back ups.
Syntax:
rsync -options /source /destination
Compare two folders
This command uses the "-v" and "-n" option to do nothing. Instead rsync prints out what would have been copied from a source folder to a destination folder. To delete files from the destination folder see notes on "--delete" below.
rsync -rvn /source /destination
-r, --recursive recurse into directories
-v, --verbose increase verbosity
-n, --dry-run perform a trial run with no changes made
Back up one folder to another
This is all you need to back up a source directory to a destination directory. If unsure try it out with the "-n" dry run option first. To delete files from the destination folder see notes on "--delete" below.
rsync -av /source /destination
-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)
-r, --recursive recurse into directories
-l, --links copy symlinks as symlinks
-p, --perms preserve permissions
-t, --times preserve modification times
-g, --group preserve group
-o, --owner preserve owner (super-user only)
-D same as --devices --specials
--devices preserve device files (super-user only)
--specials preserve special files
Additional tips n tricks
Test with the "dry run" -n option first to see what files would be deleted and copied.
-n, --dry-run perform a trial run with no changes made
Delete files in the destination folder that does not exist in the source folder.
--delete delete extraneous files from dest dirs
Exclude files that you don't need for instance system files.
--exclude=PATTERN exclude files matching PATTERN
example: --exclude '.DS_Store'
Compress files during transfer to save bandwidth
-z, --compress compress file data during the transfer
Credits
Oh, by the way rsync is really powerful and this only scratches the surface of what rsync can do. But you don't need more info to do local back ups.
Syntax:
rsync -options /source /destination
Compare two folders
This command uses the "-v" and "-n" option to do nothing. Instead rsync prints out what would have been copied from a source folder to a destination folder. To delete files from the destination folder see notes on "--delete" below.
rsync -rvn /source /destination
-r, --recursive recurse into directories
-v, --verbose increase verbosity
-n, --dry-run perform a trial run with no changes made
Back up one folder to another
This is all you need to back up a source directory to a destination directory. If unsure try it out with the "-n" dry run option first. To delete files from the destination folder see notes on "--delete" below.
rsync -av /source /destination
-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)
-r, --recursive recurse into directories
-l, --links copy symlinks as symlinks
-p, --perms preserve permissions
-t, --times preserve modification times
-g, --group preserve group
-o, --owner preserve owner (super-user only)
-D same as --devices --specials
--devices preserve device files (super-user only)
--specials preserve special files
Additional tips n tricks
Test with the "dry run" -n option first to see what files would be deleted and copied.
-n, --dry-run perform a trial run with no changes made
Delete files in the destination folder that does not exist in the source folder.
--delete delete extraneous files from dest dirs
Exclude files that you don't need for instance system files.
--exclude=PATTERN exclude files matching PATTERN
example: --exclude '.DS_Store'
Compress files during transfer to save bandwidth
-z, --compress compress file data during the transfer
Credits
rsync - man page
lifehacker.com - Geek to Live: Mirror files across systems with rsync
techgage.com - Backing Up Your Linux
Labels:
Command line interface,
Linux,
Microsoft Windows,
OSX,
Software Tips
Working with files and folders that has spaces in their names
I was in OSX's terminal yesterday trying to cd into a folder with a space in the name. That usually works really well with tab-completion but in the same place in the directory tree there were another folder with the same name but without the space.
Here's a little illustration to clarify what I just wrote.
root--+
|
+--Folder1
+--Folder1 With Space
So I want to cd into "Folder1 With Space" but I can't use tab-completion or type:
cd Folder1 With Space
However I can use \ as the escape character:
cd Folder1\ With\ Space
I can also use quotes, 'normal' or "double" (useful if the folder uses either one in it's name).
cd 'Folder1 With Space'
cd "Folder1 With Space"
Although I haven't tried it I'm pretty sure this works in any *nix terminal.
Wednesday, January 6, 2010
How to start Kazehakase in full screen mode
The long story:
I've been thinking about changing my Digital Picture Frame / Twitter frame to use/be browser instead. Partly to be able to get a useful outlet while practicing PHP-coding but also to be able to use services such as Twitter and Tom Scotts Star Wars weather.
My browser of choice is Kazehakase, a small foot print browser that can use either the Webkit or the Gecko rendering engine. It can handle alot more than Dillo but uses way less resources than Firefox. I found out about Kazehakase while reading the blog of K. Mandla.
However there is a problem. Kazehakase is not a very well documented browser. In it's manual there is a reference to using "Actions" with the browser, but the actions themselves aren't documented. Luckily enough I found out how to start Kazehakase in full screen mode by some trial and error.
The short story:
kazehakase -a "ToggleFullScreen" your_url_here
I've been thinking about changing my Digital Picture Frame / Twitter frame to use/be browser instead. Partly to be able to get a useful outlet while practicing PHP-coding but also to be able to use services such as Twitter and Tom Scotts Star Wars weather.
My browser of choice is Kazehakase, a small foot print browser that can use either the Webkit or the Gecko rendering engine. It can handle alot more than Dillo but uses way less resources than Firefox. I found out about Kazehakase while reading the blog of K. Mandla.
However there is a problem. Kazehakase is not a very well documented browser. In it's manual there is a reference to using "Actions" with the browser, but the actions themselves aren't documented. Luckily enough I found out how to start Kazehakase in full screen mode by some trial and error.
The short story:
kazehakase -a "ToggleFullScreen" your_url_here
Labels:
Digital picture frame,
Linux,
OSX,
Software Tips,
Toshiba 320CDS
Tuesday, December 8, 2009
Wireless issues on Macs
Problem: My coworker had some issues with her wireless network at home. Her Macbook running OS X 10.5 Leopard would connect to their home network without any problems. But her husbands Powerbook and their older stationary Mac would not connect at all. There were no hardware problems with the Powerbook, in fact it worked without a hitch at her husbands job. And ofcourse they had tried retyping the password a million times.
Solution: While helping another friend of mine with his AirPort Express I came across a couple of posts in different forums that suggested using WPA2 Personal encryption (AES) instead of WPA1 Personal encryption (TKIP). We tried that and it temporarily solved the issues he had, but there were other problems in that network. However, when I told my coworker to change her encryption from WPA1 (TKIP) to WPA2 (AES) it worked like a charm and all the computers in the network got connected right away.
Short version: If you have wireless issues (inability to connect, dropping connection) on Macintosh hardware give WPA2 (AES) a try it might work.
Solution: While helping another friend of mine with his AirPort Express I came across a couple of posts in different forums that suggested using WPA2 Personal encryption (AES) instead of WPA1 Personal encryption (TKIP). We tried that and it temporarily solved the issues he had, but there were other problems in that network. However, when I told my coworker to change her encryption from WPA1 (TKIP) to WPA2 (AES) it worked like a charm and all the computers in the network got connected right away.
Short version: If you have wireless issues (inability to connect, dropping connection) on Macintosh hardware give WPA2 (AES) a try it might work.
Tuesday, October 20, 2009
Twitterframe

I surfed around and found that PTT (Python Twitter Tools) seemed to be what I needed. To install PTT in Debian (I guess the same goes for all other debian derivatives like Ubuntu and so on) you first need to install the packages python-twitter and python-setuptools, and their respective dependencies.
To do this simply type the following in a console/terminal:
sudo aptitude install python-twitter python-setuptools
Then install installed PTT with:
sudo easy_install twitter
Now it's just a matter of either using the proper command line options to get PTT to do your bidding. To get an idea of what you can do simply type:
twitter -h
Since I like config-files I created one in my home dir called .twitter (this also happens to be the default config file PTT looks for. This is what my .twitter file contains:
[twitter]
email: myemailadress@someplace.com
password: mytwitterpassword
format: verbose
format: ansi
The email and password options are pretty self explanatory if you have a twitter account. Format however is the way twitter presents itself on your screen.
format: verbose | Prints out the full twitter post rather than just one line as per default.
format: ansi | Uses ansi coloring on the different usernames.
Since .twitter contains your password it can be a good idea to only allow your user to read it:
chmod 400 .twitter
Now that I had PTT working the way I wanted I simply added "twitter -r" to my .bash_profile to have it automatically launch after my system boots up. The "-r" causes PTT to continue running and updating the twitter feeds every five minutes.

Labels:
Digital picture frame,
Linux,
OSX,
Toshiba 320CDS
Wednesday, June 17, 2009
Waking up a sleeping printer
The printer (a Canon CLC 3220) at my office takes quite some time to warm up and calibrate after waking up from sleep mode. Anyone who wants to print out something at the beginning of the work day knows this. And it can be quite stressful if you have to get something out for an early morning meeting.
Currently sleep mode is activated after four hours of inactivity. A quite reasonable time I think. So instead of fiddling with the sleep setting I added the following line to the crontab of our server:
This line prints an empty page every morning at 7 each workday, except in july when the office is closed. Thus the printer is calibrated and ready to go when people start arriving at the office around 8 in the morning.
Our server is an Xserve running OSX and for this to work I had to install the printer drivers on the server. Also setting the printer to default helps I think (though I didn't have to since we only use one).
Currently sleep mode is activated after four hours of inactivity. A quite reasonable time I think. So instead of fiddling with the sleep setting I added the following line to the crontab of our server:
0 7 * 1-6,8-12 1-5 echo | lpr
This line prints an empty page every morning at 7 each workday, except in july when the office is closed. Thus the printer is calibrated and ready to go when people start arriving at the office around 8 in the morning.
Our server is an Xserve running OSX and for this to work I had to install the printer drivers on the server. Also setting the printer to default helps I think (though I didn't have to since we only use one).
Monday, May 18, 2009
Backing up a system on Compact Flash
If you have a system on Compact Flash, for instance a digital picture frame. There's a really neat way to work on the system without having to write to the disk more than once, and still do alot of updates or other changes.
What you do is that you make a disk image of the Compact Flash media and then run that image in a machine emulator like Qemu for Linux and Windows or Q - [kju:] for OSX. Once the image is booted you can, work on the system and do all sorts of changes and when you're done all you have to do is write that image back to the media it came from. Ofcourse, if you're only doing minor changes this might be unecessary but for bigger system updates or just testing out new software before going live it's really nice.
How it's done
What you do is that you make a disk image of the Compact Flash media and then run that image in a machine emulator like Qemu for Linux and Windows or Q - [kju:] for OSX. Once the image is booted you can, work on the system and do all sorts of changes and when you're done all you have to do is write that image back to the media it came from. Ofcourse, if you're only doing minor changes this might be unecessary but for bigger system updates or just testing out new software before going live it's really nice.
How it's done
- Hook up your CF-card to your host system make sure the disk is not mounted, unmount it if necessary. But before doing that find out the path to the disk i.e: /dev/sdb, /dev/hdb or something like that.
- Then run dd to copy the whole disk to an image.
Warning!
The dd command can cause irreversible damage to your system. If you're not sure what you're doing, don't do it.
Syntax: dd if=path_to_disk_to_backup of=outfile
Where if stands for "Input file" and of for "Output file"
For my system I use the following command:
dd if=/dev/sdb of=lappy586.bin conv=noerror,sync
The added option conv=noerror,sync makes sure that the copy will go on even if there are errors.
The copy might take a while depending on the size of the image you try to copy. - After the copy is done you can run the image with qemu like this:
qemu -hda path_to_diskimage
Qemu has alot of options, if things don't work out for you the first time have a look at the manpages and other documentation. I got lucky and had everything working without any need for extra configuration when running Qemu from Debian but not so lucky when trying to run the same image from Windows Vista. - Finally, to write the backup back to disk just reverse the paths in the dd command:
dd if=lappy586.bin of=/dev/sdb conv=noerror,sync
Subscribe to:
Posts (Atom)