bibekshrestha's blog

Swimming

in

Every so often, I bang into a new idea or a new want to do something, a new learning perhaps. I will be noting these things down in a kind of TODO, a check list which can be viewed here http://bibekshrestha.com.np/i-want

This early morning, I was reading the Do-Newsletter and figured I should learn to swim. And some day jump into a river.

I jumped in a river with some of the smartest, kindest, friendliest people on the planet.

I would love to do that. But for now, it is to learn to swim.

Send mail from command line from specific email address

in

In an email, from is set in the header. To set FROM in any email sent through the mail command, here is the syntax

echo 'Mail body' | \
mail -s 'this is the email subject' -a 'From: sender@example.com' receiver@example.com

Night experiments with my camera

in

Loadshedding time.
Got my tripod and my Canon Powershot to see what I could get out of it.

 

Innocence

in

Ma speeeiinngg bhanau?
Malai thaha cha, ma speeeinng bhanau?

Am ee ee an aa
Am ee ee an aa.

Two smallll kids returning from school.

Poking log

Saturday June the 13th 1:17 AM,

Poke,

Ouch,

Haha!!
:(|)

Chameleon

Owl

Telepathic, I get it!!

bed time. me going down under. (offline)

Sigh!!

--

Other form of communication.

There are more fun things to life than work

While I was working impatiently today, a friend of mine sent an email that said:

There are more fun things to life than work as well. so keep alive to enjoy that too!

So I called up a friend, went out for coffee and chit chatted.

Made my day today. I hope it made her's too.

MySQL command line backup and restore

A lot of beginners are very much dependent upon phpMyAdmin for their daily work. However a lot of them are not familiar with the basic command line tool like mysql and mysqldump. These two commands can help a lot when I am working on servers without phpMyAdmin installation.

I will show you how to quickly backup and restore database between your local computer and server.

We have a database called dbproject_local which I will migrate to server. The server already has database dbproject_server.

Don't think

in

Don't think

Thinking makes you weak,
thinking makes you strong,
thinking makes you unhappy,
thinking brings you joy

And if emotion is the drunk husband, thought the cunning wife.
 

No title

in

"Good Night" is sufficient to her. She's doesn't ask for more or does she complain. She is like a small drizzle, its enough for her. For me, I want to love the drizzle but if she knew I thrive on a heavy downpour. I want to get wet, no I want to drown. I wonder if the drizzle will ever fullfill.

I wouldn't judge myself, or so I think. I am unhappy and unsatisfied. Wishing for the monsoon, only if life a cyclic season.

Using custom php.ini in a cPanel server

Recently in our office at YIPL, we needed to increase the upload_max_filesize and post_max_size of one of our clients. We run on a virtual private server with WHM and cPanel.

The default php runs as a FastCGI with suexec enabled.

Here is how I configured apache to run custom php.ini.

1. Know where your existing php.ini file exists.

Just create a phpinfo.php file in your public_html or www folder. Use the phpinfo() function know the current location of default php.ini.

/home/username/public_html/phpinfo.php

<?php
phpinfo();
?>

Access the file with http://www.sitename.com/phpinfo.php.

2. Copy the file inside your cgi-bin folder

$ cp /usr/local/lib/php.ini /home/username/public_html/cgi-bin

3. Create a custom cgi executable to run php.

$ vim /home/username/public_html/php.cgi

Add following lines

#!/bin/sh
/usr/local/cpanel/cgi-sys/php5 -c /home/username/public_html/cgi-bin/
# Note, the parameter after -c is the location of new php.ini

Allow executable permission to the new php executable

$ chmod +x /home/username/public_html/cgi-bin/php.cgi

4. Modify .htaccess to run php with our new executable by adding the following lines at the top

$ head /home/username/public_html/.htaccess
Action application/x-httpd-php5 /cgi-bin/php.cgi

#.. other commands

5. Make sure new configuration is loaded.

The http://www.sitename.com/phpinfo.php file should now show /home/username/public_html/cgi-bin/php.ini as the loaded setting file.

6. Remove phpinfo.php for security purposes

$ rm /home/username/www/phpinfo.php

References

Syndicate content