Ana içeriğe atla

Kayıtlar

linux etiketine sahip yayınlar gösteriliyor

VirtualBox 4.0 Closed Source Edition On Ubuntu Server 10.10

Ok trying to configure a windows xp guest on this server, I did the directions on the manual at virtualbox.org. I used VBoxHeadless which is great for a server environment. Previously I tried virtual OSE provided by Ubuntu repos whose version is 3.2.8 at the time.But it seemed that OSE doesnt support vrdp although here is a post claiming otherwise http://forums.freebsd.org/showthread.php?t=13499. Then I decided to install closed source edition from the provider according to this post http://www.howtoforge.com/vboxheadless-running-virtual-machines-with-virtualbox-4.0-on-a-headless-ubuntu-10.10-server.Everything worked fine and I installed the guest host. Then I noticed that there are two mouse pointers and the resolution is not adjustable. Then after some work I reinvented (remembered) that one must need to install guest additions thing too. After installing it now the machine working nice.

Getting along with Django

These days I am tackling with Django on a centos server. I installed django package downloaded from its site.Started a simple app. Now trying to use database mysql. When it ocmes to mysql I needed to install some packages like mysql-devel,python-devel and most importantly MySQL-python (notice the capital letters). An older version of this is in centos stable repos.After some search I learned I can install it in different ways like compiling or using test repo.I chose the former and installed python-setuptools. And then I realised that there is easy_install in this package which helps me installing the required MySQL-python package. And voila.

Centos mcelog reports incorrect record size

On a centos 5.5 64 bit server I was getting mcelog errors from cron.hourly/mcelog.cron stating "/etc/cron.hourly/mcelog.cron: mcelog: warning: record length longer than expected. Consider update" As a workaround I did add 2>&1 to the last line of /etc/cron.hourly/mcelog.cron file as mentioned in Known Issues in this page http://elrepo.org/tiki/kernel-ml    

An Encryption Method

Lately I have been told to make a new encryption method as an assignment. The method should be not preused and tried before. So it was me who is supposed to invent a new encryption method. I have thought of Rubik's cube and placing the letters of the alphabet on this cube. Then the coordinates of each letter would be send as ciphertext. Thinking on it lead to some diffucilties. So I decided to take another way. I believe that a good  encryption technique is still available by using Rubik's cube but for now I quitted. Instead, I thought of 3x3 or 5x5 squares on which we place the letters beginning from an arbitrary letter but obeying the order. So here is an example with a 3x3 square   2 H I J 1 K L M 0 N O P   0 1 2 With such a layout we represent each letter on this square using the pivot letter (lets say) L H=L02   I=L12   J=L 22   K=L01  L=L11  M=L21 etc.  On a 5x5 square we will have similar representations of letters. Even...

Windows Server Anomalities

Lately I have been struggling on port forwarding to a windows 2003 server from different modems. There were 4 modems pointing to same windows server port. I couldnt have succeeded in forwarding all these same ports from 4 modems to this server. Some were pointing some wasnt. I finally realised that this is a stupid mistake about windows routing configuration. I have had enabled the auto metric configuration for the gateways. But that was the wrong thing I did. There were different metrics for each gateway and this was causing the trouble. I changed them to same number and voila. All ports are forwarding coreectly.  

Centos Nginx PHP APC FastCGI 2 (Dealing with problems)

My journey to nginx continues with problems that follow up. I have had 3-4 problems to get nginx work. But after resolving them voila. It works now :) The problems were: directory index of "/usr/share/nginx/html/vhosts/domain.com/subdomains/data/" is forbidden -> Solved by writing the correct domain name to nginx.conf or any of virtual host files. No input file specified -> Solved by writing the full path of php scripts to one of my virtual host conf. FastCGI sent in stderr: "PHP Fatal error:  Uncaught exception 'Zend_Session_Exception' with message  'Zend_Session::start() - /usr/share/nginx/html/vhosts/lib/Zend/Session.php(Line:438): Error #2 session_start() -> which is solved by giving correct ownership to folders /var/lib/php and /var/lib/php/session. Before those folders owned by root.apache and I changed them to root.php where php is the correct user. Now lets benchmark the sites!  

Centos Nginx PHP APC FastCGI

These days I am working on centos vps installation. I try nginx for the first time and heard that it will be delicious when it is served with php,apc and fastcgi. I began by enabling EPEL repos to centos. Installed php and its required modules. Then nginx and applied its fast-cgi patch according to nginx's wiki site. Alternatively one can use spawn-fcgi program, I installed but not using right now. Then it comes apc. For that install php-pear and then "pecl install apc". If you get an error like "ERROR: make failed" as in my case, try installing pcre-devel and after that pecl install apc works. And lets try if all is working.  

"ssh_exchange_identification connection closed" error

I have getting these messages from a windows install of bash and ssh when I try connecting to this host. The problem was about reverse dns resolution.Ssh cant resolve reverse dns's of clients and because of "ALL:PARANOID:DENY" directive on /etc/hosts.allow file on this host, it was refusing the connections. To resolve it I commented out this directive and restarted the service and ohh.

Rsync with SSH

I have forgot to make rsync on ssh and decided to note here: To rsync local files at dir/ to remote server  we do this rsync -rave ssh dir/* user@rem:/remotedir

Ubuntu Freenx is not installed or was disabled problem

I have had such an error after I installed freenx from its ppa to Kubuntu 10.10 and tried to connect to it from another Kubuntu. I have searched the solution from web. But couldnt find a solution.Later I have realised that it is a problem with file permissions and did this sudo chmod o+rw /var/lib/nxserver/db/running/ That solved my case.

Bash String Split

I was looking for ways of splitting strings in bash and found and awesome one. If you have a delimited string lets say by an _ you do this first set IFS="_" then ar=($string_delimited_by__) You got an array ar with elements coming from this string.

Debian Multimedia

As described in http://wiki.debian.org/MultimediaCodecs when you need multimedia codecs for debian you must add this repo for lenny deb http://debian-multimedia.org/ lenny main non-free.

Debian Lenny Freenx and Pidgin

Recently installed debian lenny on two machines. after using ubuntu much time, debian comes a bit stranger. Correct repos need to be enabled. Everything not as easy as in ubuntu. But debian does its job better.Anyway, the first problem is with pidgin.Pidgin doesnt have MSN support if you install it from the standart repos. After some search I understood that one needs to install it from debian-backports repo by this apt-get -t lenny-backports install pidgin. The second one is about freenx. There is some info about this at net. Some non-official repos gives freenx binaries which I didnt want to try. Instead I used ubuntu freenx ppa team's official repo for this. Here is the repos for freenx deb http://ppa.launchpad.net/freenx-team/ppa/ubuntu intrepid main deb-src http://ppa.launchpad.net/freenx-team/ppa/ubuntu intrepid main. Easily installed freenx from these and voila.

Rarely known unix text utilities

I have come across with some new text commands in a book that I hadnt seen before .These are : fmt, tac, join,(un)expand,split. Among them I am very impressed by join which makes an Sql-like join between 2 (or more I guess) files which is very useful.Here an example:Suppose you have two files whose one columns are equal (or contains same information, like an id column of sql) and you want to join these files with respect to tht column.You simply write join file1 file2 if the first columns of file1 and file2 are common. If the common column is not first you can define it by -1 clnr or -2 clnr switches. There is also an -o switch which is useful for formatting output.To print the first and second columns from file 1 and say third column from file2 we write -o 1.1,1.2,2.3 .Here is a complete example join file1 file2 -j 3 -o 1.1,1.3,2.2 . Split is another nice command which splits larger files into smaller ones to easily handle them (when uploading,transferring etc). You just write split -...

Sed grouping and paranthesis

I forgot how to group regex in sed and also using \ with paranthesis. Here is a summary 1-If you group a regex with () then \1,...,\10 is the way to call them. 2-You must put \'s before any paranthesis inside sed like this sed "s/\([0-9]\{1,3\}),\([0-9]\{1,3\}/\1.\2/g" This sed makes two groups [0-9]\{1,3\} representing the digits before and after ",". And makes the comma between them a point ".". And prints the result. This is the page which inspired me http://www.catonmat.net/blog/sed-one-liners-explained-part-one/

I love this game

Mysql to mysql backup through secured mysql connection between two ends. The situation is this: I have two mysql servers behind two modems. Only port 22 is open on modems. Ports 3306 are open on both servers. First port forward on the server which is going to be backed up by ssh -L 23306:127.0.0.1:3306 user@remoteserver(backupserver) Then mysqldump -t -u localuser -p db | mysql -v --host=127.0.0.1 --port=23306 -u remoteuser -p -C db makes the magic. By mysqldump we dump the mysqlserver which is going to be backed up. And point it to the local (forwarded) port 23306 and everything is written to the remote host. Wow. BTW, to connect to backup server from local we need this mysql --host=127.0.0.1 --port=23306 thing.

Incognito

Incognito is a live cd which makes you invisible on the web. It uses tor to make you anonym. It has even virtualisation support. Take a look at here http://www.browseanonymouslyanywhere.com/incognito/index.php

DSL (Embedded)

DamnSmallLinux is a cool stuff. It is very small and efficient. You can put it on a cd (ofcourse), usb flash or even a floppy disk. It has virtual images to be used with virtualisation. It even works from *inside* Windows with a magic(QEMU). http://www.damnsmalllinux.org/