Thursday, April 17, 2014

ubuntu alias cd into directory

michaelz:~$ ls /home/git/repositories/serverConf/ibaobao/ conf etc mysql scripts usr michaelz:~$ alias cdibbs='cd /home/git/repositories/serverConf/ibaobao/' 
michaelz:~$ cdibbs
          michaelz:/home/git/repositories/serverConf/ibaobao$

Wednesday, April 9, 2014

mysqldump then mysql import: Access denied; you need (at least one of) the SUPER privilege(s) for this operation

When a database has view or triggers that is backed with mysqldump using one user say userB, and later on to be imported using another user. The following error would show up.
Access denied; you need (at least one of) the SUPER privilege(s) for this operation
mysql -u userA < schema.sql ERROR 1227 (42000) at line 65: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
To fix the problem is that all the DEFINER=`userB` need to be changed to DEFINER=`userA`

Sunday, January 1, 2012

vpn server on EC2 Ubuntu

I followed instruction on Setting up a VPN-server on Amazon EC2 up to this line:

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Then need to configure /etc/ppp/pptpd-options as:

#refuse-pap
#refuse-chap
#refuse-mschap
require-chap
#require-mschap-v2
#require-mppe-128




Following Configuring a PPTP-VPN on iOS and Android
Make to disable encryption or choose no encryption

If connects well,
tail -f /var/log/syslog should look like:

Jan 2 03:23:30 ip-10-138-31-87 pptpd[6570]: CTRL: Client ???.93.139.47 control connection started
Jan 2 03:23:31 ip-10-138-31-87 pptpd[6570]: CTRL: Starting call (launching pppd, opening GRE)
Jan 2 03:23:31 ip-10-138-31-87 pppd[6571]: Plugin /usr/lib/pptpd/pptpd-logwtmp.so loaded.
Jan 2 03:23:31 ip-10-138-31-87 pppd[6571]: pppd 2.4.5 started by root, uid 0
Jan 2 03:23:31 ip-10-138-31-87 pppd[6571]: Using interface ppp0
Jan 2 03:23:31 ip-10-138-31-87 pppd[6571]: Connect: ppp0 <--> /dev/pts/2
Jan 2 03:23:31 ip-10-138-31-87 pptpd[6570]: GRE: Bad checksum from pppd.
Jan 2 03:23:31 ip-10-138-31-87 pppd[6571]: Warning - secret file /etc/ppp/chap-secrets has world and/or group access
Jan 2 03:23:32 ip-10-138-31-87 pppd[6571]: Deflate (15) compression enabled
Jan 2 03:23:32 ip-10-138-31-87 pppd[6571]: Cannot determine ethernet address for proxy ARP
Jan 2 03:23:32 ip-10-138-31-87 pppd[6571]: local IP address 192.168.0.1
Jan 2 03:23:32 ip-10-138-31-87 pppd[6571]: remote IP address 192.168.0.234

Thursday, December 16, 2010

create forum_openidnonce and forum_openidassociation

easy_install python-openid
Searching for python-openid
Reading http://pypi.python.org/simple/python-openid/
Reading http://www.openidenabled.com/openid/libraries/python/
Reading http://github.com/openid/python-openid
Download error: unknown url type: https -- Some packages may not be found!
Reading http://github.com/openid/python-openid/tarball/2.2.5
Download error: unknown url type: https -- Some packages may not be found!
Reading http://openidenabled.com/python-openid/
Reading http://github.com/openid/python-openid/tarball/2.2.4
Download error: unknown url type: https -- Some packages may not be found!
Best match: python-openid 2.2.5
Downloading http://pypi.python.org/packages/source/p/python-openid/python-openid-2.2.5.zip#md5=f89d9d4f4dccfd33b5ce34eb4725f751
Processing python-openid-2.2.5.zip
Running python-openid-2.2.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-8UpKN5/python-openid-2.2.5/egg-dist-tmp-GI5CT1
warning: no files found matching 'CHANGELOG'
warning: no files found matching '*.css' under directory 'doc'
warning: no files found matching '*.html' under directory 'doc'
zip_safe flag not set; analyzing archive contents...
Adding python-openid 2.2.5 to easy-install.pth file

Installed /usr/local/lib/python2.7/site-packages/python_openid-2.2.5-py2.7.egg
Processing dependencies for python-openid
Finished processing dependencies for python-openid
/home/osqa/osqa-server# python manage.py syncdb --all
Syncing...
Creating table forum_openidnonce
Creating table forum_openidassociation
No fixtures found.

Synced:
> django.contrib.auth
> django.contrib.contenttypes
> django.contrib.sessions
> django.contrib.sites
> django.contrib.admin
> django.contrib.markup
> forum
> south

Tuesday, December 14, 2010

Errors were encountered while processing: procps

There seems to be problem with installing procps.

dpkg -i --force-all /var/cache/apt/archives/procps_1%3a3.2.8-9ubuntu3_amd64.deb
(Reading database ... 30892 files and directories currently installed.)
Preparing to replace procps 1:3.2.8-9ubuntu3 (using .../procps_1%3a3.2.8-9ubuntu3_amd64.deb) ...
Unpacking replacement procps ...
Setting up procps (1:3.2.8-9ubuntu3) ...
start: Job failed to start
dpkg: error processing procps (--install):
subprocess installed post-installation script returned error exit status 1
Processing triggers for man-db ...
Errors were encountered while processing:
procps

The solution for me is to remove the package from /var/cache/apt/archives/procps_1%3a3.2.8-9ubuntu3_amd64.deb
and downloaded a newer verion from http://debomatic64.debian.net/natty/aptcache/procps_1%253a3.2.8-9ubuntu5_amd64.deb

then dpkg -i procps_1%3a3.2.8-9ubuntu3_amd64.deb installation was successful.

Friday, December 3, 2010

JNDI datasource

The following resource need to put into an context element. The default Tomcat has $CATALINA-HOME/conf/context.xml, so the resource can be put into that file.



< resource auth="Container" driverclassname="com.mysql.jdbc.Driver" maxactive="100" maxidle="30" maxwait="10000" name="jdbc/TestDB" password="testTwo" type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/testDb/testTable" username="testTwo">

And in web.xml:

Tuesday, November 30, 2010

ivy target depends on target from a different project

As the value of  depends attribute. it can be composed from project name and target name.


eg:
\
 



In your-project.xml