Pages

Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Friday, December 23, 2011

Using ZTE MF 651 Modem on Ubuntu 11.10

Alhamdulillah.. after a week trying to connect my new ZTE MF 651 modem on Ubuntu 11.10, at last i found the how-to.
At first, my modem was only detected by lsusb. It shows like this:

Bus 002 Device 004: ID 19d2:0146 ONDA Communication S.p.A.

Next, i installed usb-modeswitch and create config file:
vi /etc/udev/rules.d/zte_mf651.rules
then fills it with:
SYSFS{idVendor}=="19d2", SYSFS{idProduct}=="0146", RUN+="/usr/bin/eject %k", OPTIONS+="last_rule"
save, and reboot.

voila! After rebooting, my modem was detected!! Just as simple as that...


ref:
http://askubuntu.com/questions/45841/which-usb-modeswitch-d-file-do-i-need-to-use

Monday, October 3, 2011

Install PHP 4 - Apache on Ubuntu 11.04

1. gunzip apache_xxx.tar.gz
2. tar -xvf apache_xxx.tar
3. gunzip php-xxx.tar.gz
4. tar -xvf php-xxx.tar
5. cd apache_xxx
6. ./configure --prefix=/www --enable-module=so
7. make
8. make install
9. cd ../php-xxx

apt-get install flex

apt-get install zlib1g-dev

apt-get install libjpeg8-dev

apt-get install libpq-dev

root@aslam-VGN-SZ79GN-C:~/Downloads/php-4.4.9# ./configure --with-apxs2=/opt/httpd-2.0.64/bin/apxs --with-pgsql=/usr/lib64/postgresql/8.4/bin --with-gd2 --with-jpeg-dir --with-zlib-dir --with-png-dir

12. make
(you should now have an httpd binary which you can copy to your Apache bin d
ir if
it is your first install then you need to "make install" as well)

13. cd ../php-5.x.y
14. cp php.ini-dist /usr/local/lib/php.ini

15. You can edit /usr/local/lib/php.ini file to set PHP options.
Edit your httpd.conf or srm.conf file and add:
AddType application/x-httpd-php .php

Example 2-3. Example commands for restarting Apache
1. Several Linux and SysV variants:
/etc/rc.d/init.d/httpd restart

2. Using apachectl scripts:
/path/to/apachectl stop
/path/to/apachectl start

3. httpdctl and httpsdctl (Using OpenSSL), similar to apachectl:
/path/to/httpsdctl stop
/path/to/httpsdctl start

4. Using mod_ssl, or another SSL server, you may want to manually
stop and start:
/path/to/apachectl stop
/path/to/apachectl startssl

Friday, September 23, 2011

Set ZTE AC2726 modem on Ubuntu

Mainly there are two files to download, one for the modem driver and the other is the application interface.

Go: http://www.ztemt.com/ennewzte/service/ziliao.action

And these links are for further reading:
http://gadgetz4all.blogspot.com/2010/11/modem-usb-zte-ac2726-smart-pada-ubuntu.html
http://mopheatid.blogspot.com/2010/08/modem-zte-ac2726-untuk-mandriva-fedora.html
http://yanname.blogspot.com/2010/03/aplikasi-modem-smart-evdo-zte-ac2726-di.html?showComment=1316785849604#c8170839067319597998

Wednesday, July 13, 2011

How can I get around MySQL Errcode 13 with SELECT INTO OUTFILE?

I am trying to dump the contents of a table to a csv file using a MySQL SELECT INTO OUTFILE statement. If I do:

SELECT column1, column2
INTO OUTFILE 'outfile.csv'
FIELDS TERMINATED
BY ','
FROM table_name;

outfile.csv will be created on the server in the same directory this database's files are stored in.

However, when I change my query to:

SELECT column1, column2
INTO OUTFILE '/data/outfile.csv'
FIELDS TERMINATED
BY ','
FROM table_name;

I get:

ERROR 1 (HY000): Can't create/write to file '/data/outfile.csv' (Errcode: 13)

Errcode 13 is a permissions error, but I get it even if I change ownership of /data to mysql:mysql and give it 777 permissions. MySQL is running as user "mysql".

Strangely I can create the file in /tmp, just not in any other directory I've tried, even with permissions set such that user mysql should be able to write to the directory.

This is MySQL 5.0.75 running on Ubuntu.

====

Which particular version of Ubuntu is this and is this Ubuntu Server Edition?

Recent Ubuntu Server Editions (such as 10.04) ship with AppArmor and MySQL's profile might be in enforcing mode by default. You can check this by executing sudo aa-status like so:

# sudo aa-status
5 profiles are loaded.
5 profiles are in enforce mode.
/usr/lib/connman/scripts/dhclient-script
/sbin/dhclient3
/usr/sbin/tcpdump
/usr/lib/NetworkManager/nm-dhcp-client.action
/usr/sbin/mysqld
0 profiles are in complain mode.
1 processes have profiles defined.
1 processes are in enforce mode :
/usr/sbin/mysqld (1089)
0 processes are in complain mode.

If mysqld is included in enforce mode, then it is the one probably denying the write. Entries would also be written in /var/log/messages when AppArmor blocks the writes/accesses. What you can do is edit/etc/apparmor.d/usr.sbin.mysqld and add /data/ and /data/* near the bottom like so:

...
/usr/sbin/mysqld {
...
/var/log/mysql/ r,
/var/log/mysql/* rw,
/var/run/mysqld/mysqld.pid w,
/var/run/mysqld/mysqld.sock w,
/data/ r,
/data/* rw,

}

And then make AppArmor reload the profiles.

# sudo /etc/init.d/apparmor reload

http://stackoverflow.com/questions/2783313/how-can-i-get-around-mysql-errcode-13-with-select-into-outfile