February 2011 Posts

Linux
In some ways, after years of doing programming and scripting, I’m now sort of rediscovering the power of the shell. Tonight, I was working on my server and remembered that I needed to start backing up my MySQL databases (which you do also … right?). So instead of writing a script to do that, with a little research, I was able to come up with a way to: Dump each database to a separate SQL file, with a timestamp. bzip the file. Keep 5 days worth of backups for each database, rotating the oldest backup off. Here’s what I came up with: cd /backup/mysql; for i in $(mysql -BNe 'show databases' -u root -p<password>); do mysqldump -u root -p<password> $i | bzip2 > $i-`date +"%Y%m%d"`.sql.bz2; rm -rf $i-`date -d "-5 day" +"%Y%m%d"`.sql.bz2; done > /dev/null 2>&1 Shoved that in my crontab. Works great. Linux rocks.
Read More
Randomness
I sit here watching Egyptians partying in Tahrir Square on the Internet. Mostly because Al Jazeera is the only group that hasn’t just totally halfassed the coverage of what has unfolded a half a world away. However, I did flip on CNN to watch some coverage on there. "No dictator, no invader can hold an imprisoned population by force of arms forever. There is no greater power in the universe than the need for freedom. Against that power, governments and tyrants and armies cannot stand." G'kar, Babylon 5 They interviewed several of the protesters and organizers. All of them young - even relative to me, and I ain’t exactly an old guy - and all of them taking the time to actually thank*for making the revolution possible. What were they thanking? Facebook and Twitter. One guy even said he hoped he could meet Mark Zuckerberg and thank him personally. "People with a passion can change the world for the better." Steve Jobs It occurs to me that these are the Digital Natives coming of age and taking power. To these people, the Internet is an integral part of their life, and have no memory a time before using the Internet to communicate. They think nothing of talking to people around the world. They’ve been exposed to worldwide ideas. Social and political borders mean nothing to them. They’re all old ideas. The ideas of their parents. We are just now beginning to grasp the social ramifications of a worldwide network that connects all people. The Internet is, for lack of a better analogy, like a virus that infects the world’s population. People can access the world’s repository of knowledge, and talk with people around the world with minimal effort. They can organize with minimal effort. This communication infects them with ideas of freedom and a desire to communicate. Now, to be sure, the Internet didn’t get out there and protest. The Internet didn’t physically stand in Tahrir Square and chant protests against Mubarak. The Internet didn’t take gunshots for freedom. But the Internet and social media did provide the tools and the framework in which the revolution could be organized. People will always be the ones taking action. But the ability to communicate - quickly, efficiently, and massively, in such a way that was unthinkable twenty years ago - is going to completely reshape the way the world works going forward. Iran was the warmup. Egypt and Tunisia are the warning shots to nations around the world: neglect your people at your own peril. Now, as for Egypt. The optimist in me hopes for a democratic republic. The pessimist in me fears a military dictatorship or, worse, an Islamic dictatorship. I guess we’ll know soon enough.
Read More