How to replace a given string inside a mysql table?

Ιουλίου 23, 2010

Just use the fabulous command REPLACE provided by mysql. The syntax goes like this:

update database_table set table_column = replace (table_column, "oldstring", "newstring");

For instance, to replace all occurrences of «modules» inside the linuxformat.gr drupal db with «sites/all/modules» I typed in:

update linuxformat_system set filename = replace (filename, "modules", "sites/all/modules");

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
3

Name-based Virtual Hosts in Apache

Ιουλίου 14, 2010
Tags:

Name-based virtual hosting enables us to serve different domains from a single server. All we need is to add this line to /etc/apache2/sites-available/default:

NameVirtualHost *

The * specifies that Apache will serve requests for all IP addresses; optionally we can specify only a certain IP on the server.

Next, we create a new for each different domain we want to serve.

This can be done either by adding a few lines inside /etc/apache2/sites-available/default

<VirtualHost *>
    ServerName www.lxf.gr
    ServerAlias lxf.org
    DocumentRoot /media/oxy/www/lxf
</VirtualHost>

or by creating a new file (i.e. lxf.gr) inside /etc/apache2/sites-available

<VirtualHost *>
 ServerAdmin dkalamaras@onemail.com
 ServerName lxf.gr
 ServerAlias lxf.gr
 DocumentRoot /media/oxy/www/lxf
 <Directory /media/oxy/www/lxf>
  Options Indexes FollowSymLinks
  Options -MultiViews
  AllowOverride All
  Order allow,deny
  Allow from all
 </Directory>
 CustomLog /var/log/apache2/lxf-access.log combined
 ServerSignature On
</VirtualHost>

and symlinking it to /etc/apache2/sites-enabled:

sudo ln -s /etc/apache2/sites-available/lxf  /etc/apache2/sites-enabled/

Technorati Tags: ,

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
0

free space is important!

Μαΐου 26, 2010
Tags: ,

That is the lesson I have learned today.

Despite my eagerness to update my N900 to Maemo 5 v10.2010, the software update tool kept giving me the following cryptic message:

«not enough memory in target location«

Wtf? The message was a surprise for me, since I thought the 32GB of my N900 would be more than enough for an 113.1MB update. But…Rootfs partition in n900 amounts only to 227MB, which apparently was nearly consumed by all the silly tools I have installed recently (mc, gnu-tar, openssh, lighttpd (yep, I run a web server on my mobile phone!), numpty-physics, bouncy, scummvm etc), along with ovi maps, micro-blogging app, etc.

After a while searching the Internet, I ended up in the maemo.org excellent wiki which of course was giving some usual-space-saving linux tips:

apt-get clean
apt-get autoremove

along with some more unusual (to me!) ‘opt-ifications’.

What’s that? The maemo slang for «move whatever can be moved from /usr to /home/opt». For instance, you can easily mv nokia-maps from /usr/share to /home/opt and then ln -s back to where it was, so that the relevant application could run. Using this technique I managed to free almost 60MB in rootfs.

Now the update is underway and I am eager to see what’s new.

 

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
2

Για τους κηπουρούς

Μαΐου 10, 2010
Tags:

Αν αγαπάτε τα φυτά (και όχι τα «φυτά»), και δεν το ξέρετε ήδη, στην Κηφισιά γίνεται κάθε χρόνο τέτοιο καιρό μια μεγάλη έκθεση λουλουδιών. Θα τελειώσει νομίζω την άλλη Κυριακή. Ακόμα κι αν δεν είστε της κηπουρικής, είναι χάρμα να πάτε μια βόλτα είτε το απόγευμα μετά τη δουλειά είτε το Σαββάτο. Εμείς πήγαμε χτες και πήραμε τα λουλουδάκια μας: ένα νυχτολούλουδο και ένα φιλάδελφο (philadelfus coronarius) με λευκά άνθη. Πάρτε γεύση:

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
0

Corkboard theme!

Μαΐου 6, 2010
Tags:

Eleni’s pet project (and vehicle to experiment with social cooking), www.supersyntages.gr, has got a new theme. The new graphical theme, designed and implemented by yours truly, plays with the notion of recipe notes pinned on a corkboard. The frontpage ‘carousel’ is still the old one, but it somehow fitted nice.  I am not a designer but I think it turned out to be a nice idea. Check it out!

New corkboard theme [notice the bottom social toolbar]

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
4