Before and After you join a company
I just think this is funny.
Translated loosely from a Chinese blog post (http://drjimdiary.blogspot.com/2009/06/blog-post.html)
Before you join the company …
Boss: Welcome! Office without you sure will looks different!
Employee: If I am too tired working, I may just quit.
Boss: Don’t worry about that, I won’t let it happens.
Employee: Can I rest on weekends?
Boss: Of coz! That’s the bottom line of our company policy.
Employee: Do we need to OT till midnight?
Boss: No way, Who told you that?
Employee: Do we have meal allowance?
Boss: Needless to say, its definitely higher than other companies.
Employee: Is it possible that I will work till death?
Boss: No, why are you thinking in that way?
Employee: Will the company organize overseas trip for us?
Boss: It’s part of our company policy!
Employee: Do I need to come to work on time?
Boss: No, it depends.
Employee: How about salary, always paid on time?
Boss: Always!
Employee: Will the new hire got to do all the jobs?
Boss: How can that be possible? There are many seniors staff above you.
Employee: Will I get a chance if there is vacancy for management position?
Boss: No question about it, that’s how the company survived.
Employee: You are not lying to me are you?
After you join the company, just read in reverse order …
Using GMail to backup your MySQL database
I have few gmail accounts and some are really under utilized in terms of storage.
So I put up a simple script to be ran as a cron job to backup my database and auto email it to gmail for good.
NOTE: This should be feasible only if you have relatively small database.
Requirements: You will need to have mysqldump, tar, and nail programs installed.
Create this simple shell script in your home directory, I call it backup_db.sh
#!/bin/bash mysqldump --user=your_db_username --password=your_db_password --all-databases > mysql.db.backup.sql tar zcvf mysql.db.backup.tar.gz mysql.db.backup.sql rm mysql.db.backup.sql nail -s "Database backup" -a ./mysql.db.backup.tar.gz dummy@gmail.com < /dev/null rm mysql.db.backup.tar.gz
Then in your cron job, add this line:
01 23 * * 0 /home/your_username/backup_db.sh 2>&1
This will run the back up script once a week on Sunday, 1101pm. You can modify the timing and frequency to your preference.
In this way, you will see an email sitting in your gmail inbox with your database backup, on every monday morning
Assuming your mysql database is relatively small, say about 10MB in size, and you have 7G gmail account; then 7G / 10MB / 54 weeks = 12.9. In another word, with a gmail account, you can backup your data for almost 13 years. Heh.
Then again, this solution is probably only good for small web application, say personal blog kind of thing. But shall be a good way to utilize your gmail storage (seriously, anyone really using > 1G of gmail space?).
Have fun backup-ing.
Using Linode as SSH Proxy for Web Browsing
Just learned a neat trick today: Using your linode as a secure proxy server for web browsing.
I am trying this in Windows, so I used cygwin’s ssh. You should have ssh already if you are on a linux desktop.
To create a proxy server, simply run this command:
$ssh username@linode-ip-address -D 9999
Enter the password to login when prompted.
This will create a proxy server in your own computer (localhost) at port 9999.
So in you browser, say Firefox, just need to configure the proxy setting to localhost:9999 and that’s it, you have a secure proxy as all web traffic will be tunneled through this ssh connection.
NOTE: I found that you need to keep all other proxy setting blank, only set the proxy for SOCKS, else it may not work.
With that, have fun browsing, securely!
References:
http://embraceubuntu.com/2006/12/08/ssh-tunnel-socks-proxy-forwarding-secure-browsing/
http://keystoneit.wordpress.com/2010/01/22/ssh-tunneling-with-firefox/