Colorize and ignore whitespaces when using SVN diff
To diff and ignore whitespace, create a script called ’sd’ with the following content:
1 2 3 | #!bin/sh svn diff --diff-cmd diff -x -uw $1 | view - |
Run it like so:
sd -r13788:head
To diff and ignore whitespace, create a script called ’sd’ with the following content:
1 2 3 | #!bin/sh svn diff --diff-cmd diff -x -uw $1 | view - |
Run it like so:
sd -r13788:head
Having upgraded to Snow Leopard, I wanted to wipe out my MacPorts installation and start clean. I’ve had tons of stuff installed and updated from the past (three versions of each port, in fact). Here’s how to uninstall MacPorts.
The first step is to uninstall all the installed ports:
1 | sudo port -f uninstall installed |
Then remove any trace files lingering about:
1 2 3 4 5 6 7 8 9 10 | sudo rm -rf /opt/local \ /Applications/MacPorts \ /Applications/DarwinPorts \ /Library/Tcl/macports1.0 \ /Library/Tcl/darwinports1.0 \ /Library/LaunchDaemons/org.macports.* \ /Library/StartupItems/DarwinPortsStartup \ /Library/Receipts/MacPorts*.pkg \ /Library/Receipts/DarwinPorts*.pkg \ ~/.macports |
Here are three simple steps to uninstall the MySQL installation provided by MySQL.com. You should take care with these commands since a typo can obliterate portions of your OS, requiring a reinstall. If you’re comfortable with shell commands and understand what’s being done, here are the commands:
1 2 3 | sudo rm -rf "/usr/local/mysql*" sudo rm -rf "/Library/StartupItems/MySQLCOM/" Go to System Preferences... > ctrl-click the MySQL icon and remove it. |
DOS sums up the sizes of all the files it lists when using the dir command, but Linux ls does not. Here’s an awk script that will calculate that information.
1 | ls -la [filenames] | awk '{ sum += $4 } END { print sum }' |
An easier command (thanks Sunny):
1 | du -hs * --total |
I installed a fresh copy of Magento v1.3.2.2 on my development box using the installer and Google Chrome. After completing the install, I was unable to login to the Admin Panel through Chrome. It seemed to work fine in Firefox though. Each time I entered the admin username and password, I got sent back to the login page. Upon further investigation, I was unable to create an account or login via the frontend user interfaces either. The frontend would send me to a page indicating that I should turn Cookies on. I took a look at Chrome’s cookie bin and surely enough, there were no cookies being stored for my domain (magento-1.myhost.com). Other sites seemed to work fine.
At this point, I was really unsure what was going on. I found some references online to Magento and Cookies, but nothing to do with Google Chrome. Perhaps my issue was a particular one, but it was repeatable and my problem criteria only partially matched the other problems found online (i.e. the localhost problem). I also found that Google’s diagnostic tools are severely lacking. Unlike Firefox, which has tools like Tamper Data to let users diagnose HTTP Header problems, Chrome had nothing like it.
After a bit of sleuthing, I was able to see that Magento sets the following default cookie parameters if nothing is configured in the Magento Admin Panel:
Cookie Domain: magento-1.myhost.com (it looks up HTTP_HOST)Cookie Path: /Cookie Lifetime: 3600
I thought these parameters looked fine, but they were not working for Chrome. On a hunch, I decided to change the Cookie Lifetime from 3600 to 0 to force the browser to only keep the cookie data until the browser is closed.
Surprisingly, it worked! I have not had time to figure out why this is the case yet, but I don’t have any concerns setting Cookie Lifetime to 0, so it will stay that way for now.
Update 7/19/2009: It looks like Buddystats is gaining traction. A search on Twitter reveals that users are falling for the phishing scam. A couple of my friends have also received the mysterious URL from their friends. At this point, it looks like they are trying to gather as many passwords as they can. Quite probably for use later on to distribute malware or spam. These guys are slow and deliberate. It would not be a bad idea to change your AOL AIM password if you’ve typed it into a website recently.
Good thing is Google Chrome now marks the domain as malware. However, I’ve seen mention of links now containing direct IP addresses in the URL. Be wary of the scam and let your friends know that Buddystats is a dangerous website!
Just for your edification, here’s what the site looks like:

A moment ago, I got an IM from someone I hardly talk to on AOL Instant Messenger. The message said simply had a link in it:
I clicked the link since it was an acquaintance and it presented a tidy looking site–somewhat official looking. There’s a big compare button in the middle that you can press and it will ask for a password. I thought it suspicious so I typed in an incorrect password. No go, I typed in the same bad password a couple more times and it presented a result.
Pretty sly phishers out there. Whatever you do, do not type in your real password. If you already have, go change it _immediately_ or it will use your AIM account to spread itself.
I think Paul Graham’s essay on The Founder Visa is a great one in principal. I think there are tremendous benefits in having foreigners come to the US to start businesses. It never hurt innovation to have many startups vying for market space. On the other hand, there is another source of people that are hugely capable of starting businesses… the millions of laid off workers in our very own country.
The system has a financial assistance package for these people–it’s called unemployment insurance. Unfortunately the system has promoted a culture of paying people to look for jobs rather than create jobs. A case in point is that I, in California, am not eligible for unemployment insurance because I am starting a business that has already employed several people rather than looking for work “full time.”
When my previous company hit the wall and laid everyone off, I had two choices: 1) look for a new job, or 2) start my own company. For a variety of reasons (mostly good ones), I decided that it was time for me to do the latter. I searched around for resources and stumbled upon a program by the US Department of Labor that suggests entrepreneurs can obtain assistance similar to unemployment benefits when starting a new business. It’s called Self-Employment Assistance and is characterized as a drop-in replacement for unemployment benefits for those who have become jobless and are looking to start a new business.
Rather than pay people to be unemployed, the program pays people to create businesses that in turn can create even more jobs. Unfortunately, only about seven states participate in the program and California isn’t one of them. I asked around at the California EDD, but no one seems to know what I’m talking about.
It’s really a shame. By the figures, there are hundreds of thousands of perfectly capable people that have been laid off in the past month alone. These are experienced people that can become contributors to renewed growth by creating new businesses.
While I agree with Paul’s thoughts and feel they are well-placed, I am quite certain we can find 10,000 jobless entrepreneurs in our own country perfectly willing to try their hand at starting up a company. There is a program available to encourage them to take this step, but unfortunately many of our states don’t subscribe to it.
This has got to be at least the fifth time I’ve restarted this blog. It sits here for long periods of time untouched. I occasionally come by to update WordPress to its latest version, but always lack words to place on these pages.
I’ve begun revisiting the design documents for KhmerConnection v3. These documents tell a story about the site, its purpose, its being and its aspirations. What I enjoy doing is writing the document and letting it sit for long periods of time. I come back and revisit what I had written after the world has changed some degree and evaluate my thinking at the time. More often than not, I see jewels of feedback and they are these jewels that will form the next version.
I think I’ve neglected KhmerConnection for long enough. I am grateful to the single moderator that remained to try to keep order in the site, Kadin. Although she was reviled and disliked by some, many respect and enjoy her company. There was the group of nice folks that became upset at me for neglecting the site and decided to start their own site. I wholeheartedly commend their effort, thank them for taking some of the load off my hands and apologize for my inaction. I started KhmerConnection to test myself and to test the open waters, but it has always been a hobby to me. My attention to it comes and goes with the seasons. This will begin to change because there is much in store.
I have learned a tremendous amount from KhmerConnection and this knowledge I have gained has propelled me further than I could ever have imagined. I feel now is the time for me to bring this knowledge around full circle. In the coming weeks and months, I will begin to set forth a series of activities that will result in the production of the next version of KhmerConnection.
Just as KhmerConnection v1 and v2 inspired dozens of sites to spawn after it, v3 will set a new, higher bar for community interaction. I won’t go into details on this post, but know that the work will be a culmination of seven years of experience. To everyone who has been a part of KhmerConnection in any way, I thank you for making KhmerConnection a part of your life, even if for the briefest of moments. To those who have left, you will find reason to return. To those who have remained committed, you will not be disappointed.
For anyone using any of the Apps I have written and need help, please try dropping a new comment on the App’s page.
As for this blog, I will begin making a concerted effort to talk about at least one thing that matters in my world view each week. I may talk about KhmerConnection, I may talk about technology, or I may just rant about something obscure. In any event, it will be thoughtful and hopefully engaging. If anything I say resonates with you, I encourage you to respond and engage.
Have you ever wanted to clear all your tweets without deleting your account and losing all your follows and followers? It’s a bit cumbersome for people that have massive tweet histories, but you can use TwitterClear to remove all your tweets. TwitterClear will remove up to 100 messages per hour, a restriction that Twitter has on their API. This restriction may be lifted if Twitter sees an obvious use for TwitterClear, but I haven’t thought to contact them yet since my own tweet history was only about 200 entries.