|
Note: Dedicated to Bombim Cadiz, Linux guru extraordinaire, who could always explain in a few words what pages and pages of websites could not.
If you do frequent backups of your website, especially a Linux-based one at that, I'm sure you also have your share of:
- Typing the same tar and mysql commands over and over again,
- Opening all your config files to look for your database usernames and passwords, and
- Basically going crazy over the numerous command switches & options.
When doing repetitive tasks such as backups, it makes more sense to use something called bash.
Bash stands for Bourne-again shell. It is very much like DOS's batch file -- it allows you to save a set of commands in a single file. This means that in you only need to run this one file, and all the commands you placed there will be executed.
A basic backup bash
1. Create the bash file in your favorite text editor.
Here is a simple bash file:
#!/bin/bash
echo "Let's back up your public_html directory!"
tar -cvzf backup.tar.gz public_html/*
echo "Your directory has been backed up. You may now download the file backup.tar.gz."
2. Save the text file. The filename that we are going to use is "backup." I removed the file extension .txt in order to make it easier to run the bash file.
3. Upload the file to your server, preferably in a directory that cannot be accessed by the public.
4. Make the file executable. You can do this via FTP by right clicking on the file, then changing the file attributes to 755.
Or if you're logged in to your shell via SSH, just enter the following commands:
chmod +x file.sh
5. Whenever you need to backup your site, all you have to do is login to your shell, and run the bash file, like so:
./backup
Spicing it up
Here's a modified backup bash for the adventurous in you:
#!/bin/bash
# Change the variables below, depending on your project.
projectname=MYPROJECT # Name of project
dbuser=myname # Database username
dbpass=mypassword # Database password
dbname=mydatabase # Database name
htmdir=public_html # Where your HTM files are located
backupdir=public_html/backups # Where you save your backup files
# Pause function
Pause()
{
echo
echo -n "Press ENTER to continue."
read
echo
}
# Welcome message
echo "Hi! This will backup the HTM and DB of this website. Simply follow the instructions."
Pause
# Ask for suffix of filename
echo "A suffix is appended to the filenames of the backup files."
echo "This is usually in the form of YYYY-MM-DD-TTTT (TTTT is the 24-hour format time)."
echo "For example: 2006-01-01-1200"
echo
echo "Enter your desired suffix now: "
read suffix
Pause
# Delete backup files
echo "Deleting existing backup files"
rm $backupdir/*
echo
echo "Backup files deleted."
Pause
# Tar HTM and DB
echo "Backing up HTM & DB files"
tar -cvzf $projectname-HTM-$suffix.tar.gz $htmdir/*
mysqldump --opt -Q -u $dbuser -p$dbpass $dbname > dump.sql
tar -cvzf $projectname-DB-$suffix.tar.gz dump.sql
rm dump.sql
echo
echo "All HTM and DB files tarred and gzipped."
Pause
# Move files to backup directory
echo "Moving files to backup directory."
mv $projectname-HTM-$suffix.tar.gz $backupdir
mv $projectname-DB-$suffix.tar.gz $backupdir
echo
echo "Files moved to the backup directory."
echo
echo "Thank you."
echo "You can now download your files from the backup directory."
echo
|
|
Some of us have published things we wish we hadn’t. Or wish we had enough sense to at least change the byline. My mushy love poems fall in this category.
But in my defense, that was in High School … when I was young and stupid. (Now, I’m just simply stupid.)
Blame it on the Fairy Tales
Dry your eyes, little girl, you are not to blame
For making a wish on the first bright star,
For cuddling with glass slippers and dames,
And hoping for that castle from afar.
Don’t grieve, for your are not at fault, little girl –
You grew up with the magic of Snow White,
Gave your faith to a fairy godmother,
And longed for that rose and your gallant knight
Don’t cry, little girl, for that broken dream
Of gardens, of love, of the Prince’s first kiss.
Blame the fairy tales for what could’ve been,
Now a mere veil in the clouds of pure bliss
Blame Cinderella for going to the ball,
Blame the fair Belle for transforming the Beast,
Blame them for the Prince so handsome and tall,
You knew he’d come – they promised you, at least.
Blame all the sweet vows said of forever –
For they have made your happiness fall apart.
And made you believe words of happily ever after –
Yes, blame the fairy tales for breaking your heart.
|
|
|
Without further ado, allow me to introduce chette.com v4.00 <insert forced applause here>.
It's been 8 months since the backend of this site was updated. The easiest excuse to throw is that my time is divided between school and a fulltime & highly stressful job.
The real reason is, despite all appearances to the contrary, chette.com is not the easiest backend to update. So many independent components have been customized to tightly integrate with each other, not to mention the dozens of hacks I've put in, that updating even a single component is so daunting.
Design. The most obvious change. Sorry to see you go, dark borders, but I decided to go for the "light" look this time. I'm still trying to work out the color scheme. Feel free to contact me if you have any suggestions.
Comments Security. To all the casino, steroid, and poker websites: Woe is to you. May you be forever hindered in entering another comment spam.
Joomla 1.08. One of the CMS engines close to my heart.
Gallery2. I doubt if you'll notice the difference between the old gallery and this new one, because I sure don't. But it does come with a nice module to publish the latest image on the side columns.
Photos on the Go. A place to dump all the photos taken from my Nokia 9500 Communcator, which, by the way, now pales in comparison with my bitter half's Nokia N80.
Study Groups. Added this to the menu, even if I haven't officially launched this site yet.
The site's not perfect, but it's home :)
|
|
Everything seems to be going well. You have a couple of programs open, and happily going thru your normal computing tasks. After a few minutes, you sit back, aghast -- a window suddenly appeared, screaming:
“Application has encountered a problem and needs to close. We are sorry for the inconvenience. Please tell Microsoft about this problem.”
Second place from the Office Assistant, this error reporting "feature" is one of the foulest things known to humankind. It's beyond me how Microsoft expects anyone to happily click Send Error Report, and believe that they will make Windows a better place.
"But it only appears when a program crashes!" you can almost hear Microsoft explain. Golly wow. And that really never happens.
To those who have also reached the limits of their patience, here is a corking way to disable error reporting:
- Open your Control Panel.
- Select System (doubleclick).
- The System Properties window will appear. Select the Advanced tab.
- Click the Error Reporting button.
- Select Disable Error Reporting. Optionally, you can also check But notify me when Critical Errors Occur.
Adios, error reports!
|
|
 Note: Dedicated to the Mr. Fojas, one of the most enlightening professors I have ever encountered.
Jose Rizal has the great misfortune of being so venerated that people years after his time seem to overanalyze his writings, his thoughts, and his life.
People have always been keen on finding symbolisms and patterns, particularly concerning his two novels, the Noli Me Tangere and El Filibusterismo. For example, Maria Clara was supposed to represent the Philippines, the Filipinos, our natural resources, or the Filipino woman – depending on who your professor was in High School.
Admittedly, I have always been an unwilling participant in these attempts to find hidden meanings. From my exposure to the writings of Rizal, he has never struck me as the type to bury his intention to the point of being undefined – yes, despite the existence of Pilosopo Tasio and his hieroglyphics.
The Rizal I know is someone who wants to awaken the people of his time immediately. Yes, he may be guilty of being “too poetic,” too wordy, and, I have to admit, of constantly beating around the bush, but his intentions has always been crystal clear.
A key characteristic in Rizal’s writings was the abundance of similes, metonymy, and personification. He would also use metaphors, but it would always be laid out so conspicuously that it leaves very little room for misinterpretation.
The quest for hidden meanings has been going on since time immemorial. Filipinos have always romanticized Rizal as having more depth and mystery – maybe to prove to themselves and to the world that Rizal is much more than what he has laid out on the table.
We should all start to accept Rizal for who he is, and not mold him in our own glamorized image of how he should be.
The lack of hidden meanings does not make our Jose Rizal less of a hero.
|
|
|
Yes, I removed the link to the Photo Gallery section a few weeks ago. An upgrade didn’t go well, and work + school left very little time for any troubleshooting. I did this not realizing that someone would notice (and not knowing I actually have site visitors for that matter. Hehe.).
I will bring it back in the next few weeks -- after my final exams. By then, I would have also upgraded to Joomla 1.0.8, which I have been delaying for months. And by then, I would also have also transferred servers, updated the styles in the CSS, removed outdated code, added new sections, updated my hairstyle, had my nails done, and started my diet.
Pasensya na po.
|
|
The obvious benefit of touch typing is the increase in typing speed. When I learned how to touch type, I discovered another little known advantage: Touch typing actually improved the thinking process. Transforming my thoughts into words was faster and easier -- all because I didn’t need to shift my eyes to the keyboard to make sure I was hitting the right keys.
Yes, once upon a time, I too was a contented pindut pindut typist. I’ve been joyously pounding on my keyboard ever since I got hold of a typewriter. I’ve also written hundreds of documents and user manuals just using my two poor index fingers, and saw no real benefit in changing my ways.
Then Ry came along who encouraged us to give our poor fingers a break. It was a skill I never knew I needed, and now can’t live without.
Page Up
So how does one learn how to touch type? I tried a variety of software, and figured out that Stamina was the least frustrating of them all. It’s not perfect -- if you’re a total retard on touch typing as I was, you really have to read the help file.
F1
One thing you have to keep in mind to keep your fingers on the home keys.
The home keys are ASDF and JKL;. There are little pimples on the F and J keys which marked where you should position your index fingers. Consequently, the middle fingers should reside on the D and K, the ring fingers on the S and L, and the pinkies on the A and ;. Both thumbs should rest on the spacebar, although only the right thumb is used when pressing it.
Whenever you need to move your fingers away from these keys, always bring them back home. For example, if you’re going to move your middle finger in order to press I, move it back to K immediately.
Another golden rule: keep the fingers relaxed, and minimize finger and wrist movement. This was not an easy task for me -- I was just learning to touch type, and my entire body, and yes, fingers included, tense up involuntarily. Talking to myself helps: “It’s just a keyboard, honey. Not a ticking timebomb.”
Page Down
The Lessons, or practice sets, can be found in the Mode menu. As almost everyone else, I started with the Basic Lessons. The goal is to go thru the lessons without looking at the keyboard.
There is a keyboard graphic which will guide you on which finger to use. You will actually find yourself pressing the correct keys by simply knowing the finger assignments.
After the Basic Lessons, you can move on to Phrases. I actually never finished Basic Lessons myself -- typing the same character combination can be a real test on anyone's sanity.
After a few days of Phrases, you could move on to External File. This is where you can actually practice touch typing using your preferred text. The web is a vast resource of possible external files (I personally prefer Newsweek and Time Magazine). Simply copy the article, and save them to a text file.
A tip for those using External Files: Make sure that you replace these characters — “ ” with - " '. See the difference? The first set of characters is actually not represented by any key in a standard keyboard. In order to display these characters, you have to press ALT plus a series of digits. It is recommended that you replace these characters with those that can easily be generated by pressing a single key.
| Replace this |
With this |
| Left quote, double |
“ |
Quotation mark |
" |
| Right quote, double |
” |
Quotation mark |
" |
| Left quote, single |
‘ |
Apostrophe |
' |
| Right quote, single |
’ |
Apostrophe |
' |
| Em dash |
— |
Dash |
- |
End
After 2 weeks of Stamina, I have increased my typing speed to 81 words per minute, or 406 characters per minute.
In spite of this, I don’t see myself uninstalling Stamina yet. For one thing, I am still trying to get the hang of touch typing HTML/PHP. And I have to admit, there’s another benefit of Stamina – it is very relaxing. Whenever stress starts taking over, I just let my fingers do the typing ;)
|
|
|