Stream of Ry

Yet Another Geek In The World

Archive for the ‘Programming’ Category

Apache, MySQL and PHPMyAdmin stuff

leave a comment

I finally moved towards native Apache and MySQL installations instead of the usual LAMPP. This way, I can have all the files on my root directory. As usual, this is going to be a dump of all the different workarounds to achieve some functionality.

<All packages (apache2,mysql-server,phpmyadmin) are installed via Synaptic on a Ubuntu 9.10 box>

Apache: Per user htdocs directory
mkdir ~/public_html;
chmod 755 ~/public_html;
sudo a2enmod userdir;
sudo /etc/init.d/apache2 restart;

If you want to change the folder name (not using public_html), you have to change the config file:
/etc/apache2/mods-available/userdir.conf

As always, make a backup of any existing config file first before changing.

MySQL: Resetting the root password to null
sudo /etc/init.d/mysql stop;
sudo mysqld_safe --skip-grant-tables &;
sudo mysql --user=root mysql;

then inside MySQL:
update user set password=PASSWORD("") where User='root';
flush privileges;
exit;

back to terminal:
sudo killall mysqld_safe
sudo /etc/init.d/mysql start

PHPMyAdmin: Allowing null users to log in
Edit /etc/phpmyadmin/config.inc.php and look for ‘AllowNoPassword’ and set it to TRUE.

The following would lead to a public_html folder as web space, a password-less root and enabling the password-less root to log in to phpmyadmin.

It’s probably a security expert’s worst nightmare but it sure is convenient.

Written by rystraum

July 2nd, 2010 at 10:41 am

Posted in Programming,Software

Tagged with , ,

CakePHP and AJAX: Inline Editing

7 comments

** Warning: Heavy Webdev Jargon Post — Javascript, PHP, Object-oriented concepts **

So, I spent my entire weekend trying to wrap my head around how CakePHP does things, but I spent more time trying to figure out how to make different AJAX methods to work with it.

Well, for starters, CakePHP is an rapid development MVC framework for PHP. It’s similar with RoR and Groovy and Grails. It implements ORM… and a lot more. ( If you have trouble with some of the jargon they have on the site, you can ask me here and I’ll try explaining them. )

Here’s my supposed laundry list of AJAX stuff to try:

  • Inline editing
  • Drag and Drop
  • Dynamic updating of selects
  • Quick saving

So far, I’ve finished… 1 of 4. X3

Read the rest of this entry »

Written by rystraum

April 4th, 2010 at 6:40 am

For keepsakes

2 comments

Too bad I wasn’t there last night. XD

Read from bottom-up. :3

Read the rest of this entry »

Written by rystraum

March 23rd, 2010 at 10:47 pm

Posted in Personal,Programming,Software

Tagged with , ,

Sample Ballot (for approval by USEB)

leave a comment

Before I give you the link, I would like to clarify that:
“This is a demo installation and Single User Session locking and Recording of Votes were disabled to accommodate every tester without having to create additional accounts.”

Which means, even if you vote using the sample accounts, it will not be recorded, ever (in this demo install).

Comments and questions are welcome and encouraged.

Sample Ballot for Chairperson, Vice Chairperson and Councilors are hosted (temporarily) here.

Written by rystraum

February 12th, 2010 at 10:17 pm

ImportError: No module named test_config

leave a comment

I have been playing around with the Google Data Python Library and in the process of installation, I encountered this:


$ python tests/gdata_test.py
Traceback (most recent call last):
File "tests/gdata_test.py", line 29, in
import gdata.test_config as conf
ImportError: No module named test_config

I managed to fix it after trying out the Appendix attached in the Getting Started with Google Data Python Library. So just follow the instructions there and it should be okay. I guess they shouldn’t have put it in as appendix since appendices are rarely read, imo.

Appendix: Modifying the PYTHONPATH

When you import a package or module in Python, the interpreter looks for the file in a series of locations including all of the directories listed in the PYTHONPATH environment variable. I often modify my PYTHONPATH to point to modules where I have copied the source code for a library I am using. This prevents the need to install a module each time it is modified because Python will load the module directly from directory which contains the modified source code.

I recommend the PYTHONPATH approach if you are making changes to the client library code, or if you do not have admin rights on your system. By editing the PYTHONPATH, you can put the required modules anywhere you like.

I modified my PYTHONPATH on a *nix and Mac OS X system by setting it in my .bashrc shell configuration file. If you are using the bash shell, you can set the variable by adding the following line to your ~/.bashrc file.

export PYTHONPATH=$PYTHONPATH:/home//svn/gdata-python-client/src

You can then apply these changes to your current shell session by executing

source ~/.bashrc.

For Windows XP, pull up the Environment Variables for your profile: Control Panel > System Properties > Advanced > Environment Variables. From there, you can either create or edit the PYTHONPATH variable and add the location of your local library copy.

Written by rystraum

September 5th, 2009 at 7:53 pm