Programming and more

Entries for June, 2011

how to mount a remote directory to linux, using ssh.

This tutorial is for linux and tested on Centos. Might work with other systems too. I think what changes is the install command. 1) Install the SSHFS yum -y install sshfsyum -y install sshfs 2) create the folder that will contain the newly mounted remote folder mkdir ~/remotefoldermkdir ~/remotefolder 3) Run sshfs to mount the […]

How to login to SSH with public keys and no password (centos and all linux)

Let’s say you want to automatically login with ssh to a remote server, or run an rsync script automatically with a cron, or mount a remote folder with sshfs, again automatically without entering a password. There is a way to do it. The steps are simple. 1) First, on client, create a new public key-private […]

How to delay starup programs in windows boot (and speed up computer)

Yes. Windows it’s a mess. A couple of months after the format, you just want to kill your windows computer. There are some tricks so that you prolong the killing a little. First clean your registry and temporary files. Don’t underestimate registry. I saw computers that took them 10 minutes to boot into windows, after […]

Built your own MVC PHP framework tutorials

I am into web development for some time now. I started scripting into .php files, that had both logic and html in the same pages. And now, if I want to change the template of the site … I will have to rebuilt everything. Unfortunately I have some old websites that grew very big, and […]

Java: Decode a base64 string

Took me a while to put everything together on how to decode a base64 string in hava but finally I did it. Unfortunately this feature not in the standard huge java library. You have to download this file: (jar file) copied here: http://www.r00t.gr/files/commons-codec-1.5.jar. Read the description on what that is, I am really not interested […]

Zip a folder in linux

Very very very easy: zip -9 -r <zip file> <folder name>zip -9 -r <zip file> <folder name>

CentOS Linux: Fix bash: ntpdate: command not found centos

First you have to install ntp: Run as root: yum install ntpyum install ntp Then if you run ntpdate again you might get the error again. You can run ntpdate with: /usr/sbin/ntpdate 2.pool.ntp.org/usr/sbin/ntpdate 2.pool.ntp.org Replace 2.pool.ntp.org with another server if that doesn’t work. If you get a ntpdate[585863]: the NTP socket is in use, exiting […]

SQLite3: Unable to Open Database File (PDO PHP)

If you have this error, first of all check if the server has write permission on the file AND the folder that contains the file. That was the error for me, the server didn’t have write access on the folder of the file. So that’s it. Thanks for visiting.

How to temporarily suspend crons in a linux machine

All you have to do is stop the crond daemon. Just run as root: /etc/init.d/crond stop/etc/init.d/crond stop And you want to start them again: /etc/init.d/crond start/etc/init.d/crond start

Disable stopwords in mysql Full text index

Disable stopwords in mysql Full text index if you didn’t know what full text index for mysql is google it. It makes searches for text much faster than using “where text like ‘%keywod1%’ AND text like ‘%keyword2%’. (at least 100 times faster) That trick saved me in a when I had an overloaded server. Anyway, […]