4 posts tagged “howto”
Frequently, I check out code from CVS and I want to know who worked on it before. For example currently I am porting a PEAR package to PHP5 and would like to change the license in the process.
In order to do this, I need the consent of all people who have been involved.
The command to the rescue is "cvs rlog <module>", season it with a little bit of grep, sed, sort and uniq (Thanks, helly!) and it works easily:
cvs rlog pear/Net_DNS | grep -e 'date:.*author:.*' | sed 's,.*author:\([^;]*\).*,\1,' | sort | uniq
So I finally switched, or let's say - along with my IBM laptop, I now own a full flexed Mac Mini (2 Ghz core duo, 2 GB ram, huge harddrive and so on). The display I am using is my (old) DELL display, a 1704FPV - which I will replace sooner or later (with a larger DELL).
The initial setup (aka "getting up and running") took not even ten (10) minutes. Ten minutes from unpacking, hooking up all gear, starting, completing setup and being online. Here is the rest of what I installed and a couple issues I ran into on the way.
Here is the list of apps I got to "replace" my Windows:
- Mac OS X 10.4 (Before: Windows XP Professional, SP2)
Since I had used that at the old job, the switch didn't mean so much to me. - fink and Apple developer tools (Before: nothing like it)
- Thunderbird (Before: Thunderbird)
- Adium (Before: Meebo and Google Talk)
- Transmission (Before: Azureus)
- Aptana (Before: Nuphere PHPEd, but also Aptana)
- svn-client through fink (Before: Tortoise)
- VLC (Before: Media Player Classic)
- Perian (Before: K-Lite Codec Pack)
- Stuffit (Before: no need for sit's on Windows)
- unrar through fink (Before: Winrar)
- Plazer 3.0 (Before: Plazer 2.x)
- NeoOffice (Before: OpenOffice 1.x/2.x)
- Cyberduck (Before: Filezilla)
There's other thinks like that I replaced Safari with Firefox in order to get all my extensions back and so on, but apart from that the switch hasn't been too bad for me. I am evening using iTunes now. And I can say that I really recommend it to anyone out there struggeling on Windows.
Some things I (still) struggle with:
- My Photoshop license does not "translate" to the Mac. So I am in need of buying a new one, but used Photoshop on ebay for the Mac is so expensive. For example, I have no idea why anyone (sane) would pay 200+ EUR for Photoshop 5.5. But people do it.
Photoshop Elements is also not available for Mac, which means I have to buy Photoshop CS2/3 soon. - Quicktime works a lot better on the Mac, but some of it is just stupid. For example, they want you to buy PRO, so you can toggle subtitles. Like that is a PRO feature.
My printer (Samsung ML 1610) does not work - so far I tried using the 1710 driver, but that failed. On a sidenote, I think I have not dealt with drivers on Windows in four or five years. I guess you need them if you buy no-name stuff, but Samsung? At least, I expected them to have a native Mac driver.- StuffIt - with native ZIP-support, why is anyone still using this piece of junk?
Printer setup
I own a laser printer by Samsung (ML-1610), which does not have a native Mac driver. So the current work around is to get the ML-1740 driver and install it. It works. Just make sure you reboot after the install because apparently Mac OS X lost some Unix on way and requires a clean start every now and then.
Another shot worth while is Gutenprint - which I did not need, but it holds (alternative) drivers for over 800 models. In case of a Samsung printer, some people claim that samsung-gdi also worked well.
So last Thursday night among other things, I also did something incredibly stupid. I worked on the webmail and emptied my email's Inbox in the process. Totally my fault since it even request confirmation and I still clicked "yes". Along with the webmail, I also had Thunderbird open and I couldn't close it fast enough, when all of the sudden I realized what I had done. I tried to close it, but Thunderbird had locked up and when it came back to life I looked into my empty Inbox.
Because my mail backup is actually three weeks old, I went on to recover it all. And to cut to the chase, I managed to get it all back - even email (from 2005, when I setup the account) which I had deleted a long time ago - all thanks to Thunderbird.
Here is how!
At first I googled the obvious and found a couple posts:
- http://kb.mozillazine.org/Undelete_a_message#IMAP_account
- http://geek-o-pedia.blogspot.com/2007/06/recover-corrupteddeleted-local-emails.html
- http://forums.mozillazine.org/viewtopic.php?p=442063
- http://www.eyrich-net.org/mozilla/X-Mozilla-Status.html?en
Especially the last link gives you great insight on how Thunderbird stores email and its flags/status. Thunderbird adds its own blend of headers which are X-Mozilla-Status and X-Mozilla-Status2. Those headers reflect the status of an email - unread, read, replied, forwarded, or both, and the various states of deleted.
Just as various blog posts propose, I had shut down Thunderbird and went into APPDATA/till/Thunderbird/profiles/default/IMAPMail (or something like that) to look for the mailbox. On Linux/Unix/Mac the path might differ because it should be all inside your home directory (please correct me if I am wrong).
The IMAPmail part is important to my setup, because the account's Inbox which I purged sits on an IMAP server so I needed to check there. Inside the IMAPmail folder I went into the one with my account's name and copied the "INBOX" file (not "INBOX.msf", which is *just* the index) off to the external harddrive.
Inspecting the INBOX file in a text editor (It seemed that opening took forever.), I was looking for the obvious X-Mozilla-Status and X-Mozilla-Status2. To my surprise none of them said "deleted". But most of them were on X-Mozilla-Status "0001" - which means something like read, if I am not mistaken.
I think the reasons are that a) I did not delete them in Thunderbird, which is why Thunderbird did not add the "appropriate" X-Mozilla-Status flags and b) I remember that in my preferences I told Thunderbird to mark messages as read when they are moved to the Trash.
Because I found so much old email (from a mailinglist which I had deleted on purpose just two weeks ago but also email from 2005), I continued and I renamed the "INBOX" file to "INBOXrestore" and copied into another mailaccount - none IMAP this time.
The path to regular (aka POP3) email accounts should look like APPDATA/till/Thunderbird/profiles/default/mail/. The reason why I moved the email to another account, is because I did not know what happens on the IMAP server when I poke around in Thunderbird - so I decided a regular POP3 account was much more suitable for this. Because then I can recover and delete all messages there and then move them into the IMAP via drag and drop - all inside Thunderbird.
So after the file was copied, I started Thunderbird, went into the designated account and there it is - all email in a folder called "INBOXrestore" - from 2005 until last night. I have not yet managed to go through all of it yet, because it takes so long to delete email that really should be deleted.
But as far as I can tell, the messages did recover completely, including all attachments. So far the only thing gone for forever seem to be the flags (replied, forwarded, etc.), but I can live with that.
I know, I know, who am I say?
Well, anyway, I came across the following link tonight:
http://pastebin.ca/592702
Here is a quick list of what is wrong:
- There is absolutely no control-flow, an attacker can do anything he wants and controls your page with simple GET.
- Values from GPC are not quoted properly in SQL queries.
- Instead of clearly seperating PHP code (backend) and HTML (frontend) all is
messedmixed up. - Use of the dreaded shorttag - I wish PHP would get rid off that soon!