A Simple Djb File

Default:

#domain.tld:
&domain.tld::ns1.nameserver.tld:3600
&domain.tld::ns2.nameserver.tld:3600
+domain.tld:97.107.130.190:3600
+*.domain.tld:97.107.130.190:3600
@domain.tld:97.107.134.172:mail.domain.tld::3600
Zdomain.tld:ns1.nameserver.tld:dns.nameserver.tld:2009081301:3600
‘domain.tld:v=spf1 a mx ip4\07297.107.130.190 -all:360

Simple one:

#egitimpili.com:
&egitimpili.com::ns1.runotech.com:3600
&egitimpili.com::ns2.runotech.com:3600
+egitimpili.com:97.107.130.190:3600
+*.egitimpili.com:97.107.130.190:3600
@egitimpili.com:97.107.134.172:mail.:etimpili.com:3600
Zegitimpili.com:ns1.runotech.com:dns.runotech.com:2009081301:3600
‘egitimpili.com:v=spf1 a mx ip4\07297.107.130.190 -all:3600

For more: http://cr.yp.to/djbdns.html


Related posts

Tags: , , , ,

Generally , i don’t share music or videos. Actually i have never posted any before. But i thought that, you should listen this:

Loreena Mckennitt – All Souls Night


Bonfires dot the rolling hillsides
Figures dance around and around
To drums that pulse out echoes of darkness
Moving to the pagan sound.

Somewhere in a hidden memory
Images float before my eyes
Of fragrant nights of straw and of bonfires
Dancing ’til the next sunrise.

CHORUS:
I can see the lights in the distance
Trembling in the dark cloak of night
Candles and lanterns are dancing, dancing
A waltz on All…All Souls Night.

Figures of cornstalks bend in the shadows
Held up tall as the flames leap high
The Green Knight holds the holly bush
To mark where the Old Year passes by.

CHORUS

Bonfires dot the rolling hillsides
Figures dance around and around
To drums that pulse out echoes of darkness
Moving to the pagan sound.

Standing on the bridge that crosses
The river that goes out to the sea
The wind is full of a thousand voices
They pass by the bridge and me.

Related posts

With this security vulnerability, your admin password can be reset if your wordpress version <=2.8.3.  For more information about exploit visit: http://www.milw0rm.com/exploits/9410

Solution:

open wp-login.php

Find this line

if ( empty( $key ) )

and change with this:

if ( empty( $key ) || is_array( $key ) )


or

patch: http://wordpress.org/development/2009/08/2-8-4-security-release/

Related posts

Tags: , , ,

I am here again. I have started work and i am working with python (2.6) now. I really like it, coding with python is very enjoy. Also python is very very easy, my first progam is a deamon with python :) , Here is my changes.

  • Started with working python instead of Java
  • discovered Oracle Berkeley DB
  • I’m using Gnome now, it is a fact that gnome is more stabile
  • Discovered the VIM, the best editor, i have ever used.
  • I transfered all my account to linode.com and i am using apache2, php5, python2.6(with mod wsgi), djb dns, postfix, mysql
  • Started to read every ” The design of everyday things”

This list can give an idea about what i will write soon  :)

The most article that i want to write is configuration of a web server.

Related posts

Tags: , , , ,

To learn your linux and kernel version ( release ) you can use /proc/version

Type it in console:

cat /proc/version

Linux version 2.6.18-92.el5
(brewbuilder@ls20-bc2-13.build.redhat.com)
(gcc version 4.1.2 20071124 (Red Hat 4.1.2-41))
#1 SMP Tue Apr 29 13:16:15 EDT 2008

In this output, you get to see the following information:

  1. Exact version of the Linux kernel used in your OS: Linux version 2.6.18-92.el5
  2. Name of the user who compiled your kernel, and also a host name where it happened: brewbuilder@ls20-bc2-13.build.redhat.com
  3. Version of the GCC compiler used for building the kernel: gcc version 4.1.2 20071124
  4. Type of the kernel – SMP here means Symmetric MultiProcessing kernel, the one that supports systems with multiple CPUs or multiple cpu cores
  5. Date and time when the kernel was built: Tue Apr 29 13:16:15 EDT 2008

For more: http://www.unixtutorial.org/2009/04/use-proc-version-to-identify-your-linux-release/

Related posts

Tags: , , , , ,

My C++ Homework

Here is the question, homework is containing the stack library ( written by me ), inheritance, nested if, constructor, destructor. You can see the sample. I had 2 hours to finish and send , so it is not a perfect code. (Even i would have time, i don’t think i can write perfect code :) ) Anyway, you can download cpp file from here, and here is stack file

Problem:

You are expected to find an escape route from a maze. The maze is inputted by user with 1’s and 0’s, where 1 represents a wall and 0 represents a road. Maze is a grid of cells, which can be considered as a 2-D array having cells. The start point for the maze is always at cell (1, 1) and exit from the maze will be always at cell (3, 3). (Consider a 5×5 matrix with walls in its outer boarders).
For finding the path, move from the starting cell and search for the neighbors of that cell by checking the cells in the directions North, East, South, and West. The search for the available neighbors will be in clockwise direction (so start checking North cell, then East cell,…)
Assume there is one possible route to exit.
Use class Cell to hold position and information for each cell in the maze grid as:

Classes:
class Cell

{ int row, column, direction;

bool visited;

int wallstatus; //could be 1 or 0

public:

//necessary members for the Cell

};
To play the game, create class Game:
class Game

{
//Matrix to hold the maze of cells

// Cell position of the goal

// Current Position on the Matrix
// Next Position of the Matrix

//Stack to hold the positions in the path

public:

//constructor to read the shape of the maze from user, and store it to the

matrix, and store the position of the goal. Then it will call the function to

traverse the maze

//function to perform the traversal

//function to calculate and return the next position using the table below

//function to set outer cells as wall.
//function to get all user input and generate the maze

//function to check whether you can move from current location or not

(direction<=3?)

//other necessary functions
};
Algorithm:

The maze traversal will be done using a stack. It will be used to store the cells for the route to the exit. The possible traversal algorithm will be as follows:
Start from (1,1) position, and set direction to 0

Push this cell to stack

While (stack is not empty && the goal is not found)

If you can’t move from current position and stack is not empty Pop () the stack

to go to the previous location

While (until all the directions are checked &&until the goal is not found)//there are available moves from current position

Find the nextrow and nextcolumn positions from the current direction

If (newrow and newcolumn is the goal)

Push the location and exit from loops

Else if (the new position is not a wall && it was not visited before)

{ Mark the new position as visited in the matrix

Check the next direction by updating it by 1

Push the new position with its row, column and direction to stack

Update current row& column with the new ones

Update direction as 0 to start searching for the available location

from north

}

Else

Check the next direction by updating the direction by 1

If (the goal is found)

While (stack not empty)

Pop the stack and output

Else

Maze does not have an exit
To calculate new row and column values to move in different directions, use the following table:

Direction

direction value

update for row

update for column

North

0

-1

0

East

1

0

1

South

2

1

0

West

3

0

-1
At the end of the game, the points for the escape route with their row and column values and the hop number required to escape will be displayed.
Sample Run: (For 5×5 mazes)

Enter the maze:
000

101

100
5 hops needed for escape

The cells to follow:

(1, 1)

(1, 2)

(2, 2)

(3, 2)

(3, 3)
The Maze Generated by User Input in the Sample Run:

<!– @page { margin: 2cm } P { margin-bottom: 0.21cm } –>

1

1

1

1

1

1

0

0

0

1

1

1

0

1

1

1

1

0

0

1

1

1

1

1

1

In the Sample run we say it’s a 5×5 matrix, but we get the input of a 3×3 matrix because the outside of the maze is always a wall which will not be inputted from the user. The Matrix above shows the final maze inputted by the user.

#include "oestack.h"
#include <iostream> // including library
using namespace std;
#include <string>
class cell // class of cell
{
        int row,column;
        int visited;
        int wallstatus;
        public:
                void addcell(int a,int b,int c) // which row, which column and also is it a wall, save this info.
                {
                  row=a;
                  column=b;
                  wallstatus=c;
                  visited=0;
                }
                void editvisit() //for checking.
                {
                        visited=1;
                }
                int checkvisit()
                {
                        return visited;
                }
                int checkwall()
                {
                        return wallstatus;
                }
                int checkrow()
                {
                        return row;
                }
                int checkcolumn()
                {
                        return column;
                }
};

class game:public cell
{

        public:
                stack<cell> stackcell; //created a stack type of cell
                cell kop[5][5]; // created an array from cell object
        game()
        {

                int l,z,i;

                for(i=0; i<5; i++) // All cell is visited now, all of them is wall.
                {
                        for(int k=0;k<5; k++)
                        {
                                kop[i][k].addcell(1,1,1);
                        }
                }
                cout<<"Enter maze from left to right:"<<endl<<"***"<<endl<<"***"<<endl<<"***"<<endl;
                cout<<"Enter 1 for wall , 0 for gate, but like, 0 enter 1 enter 0 enter … (nine times)"<<endl; //You should write nine times,I didn’t use getch or smt like that so you have to write by one by

                for(int j=1; j<4; j++) //Create 9 cell for maze , for each cell, write it is cell or wall. From left to right
                {
                        for(l=1;l<4;l++)
                        {
                                cin>>z;
                                kop[j][l].addcell(l,j,z); //create
                        }

                }

                for(i=0; i<5; i++) // write our maze to the screen
                {
                        for(int k=0;k<5; k++)
                        {
                                cout<<kop[i][k].checkwall();
                        }
                        cout<<endl;
                }
        }

        void find_goal()
        {
                int i=1,k=1,found=0; // i and k is 1 because we start from cell (1,1)
                cell start,back,yaz; // i need three object
                stack<cell> terstenyaz(9); // to write from last :)
                start = kop[i][k]; // start
                kop[i][k].editvisit(); // you visited where you start.
                stackcell.push(start); // put (1,1) (start place) to in your stack
                while (found == 0) // found 0
                {
                        if(kop[i][k].checkrow()==3 &amp;&amp; kop[i][k].checkcolumn()==3) // if end of the maze
                        {
                                found =1; // find way to escape
                        }

                        else if(kop[i][k-1].checkwall() == 0 &amp;&amp; kop[i][k-1].checkvisit() != 1) //check left , if not visited then go
                        {

                                k=k-1;
                                kop[i][k].editvisit();
                                stackcell.push(kop[i][k]);
                        }
                        else if(kop[i+1][k].checkwall() == 0 &amp;&amp; kop[i+1][k].checkvisit() != 1) //check below , if not visited then go
                        {
                                i=i+1;
                                kop[i][k].editvisit();
                                stackcell.push(kop[i][k]);
                        }
                        else if(kop[i][k+1].checkwall() == 0 &amp;&amp; kop[i][k+1].checkvisit() != 1) //check right , if not visited then go
                        {
                                k=k+1;
                                kop[i][k].editvisit();
                                stackcell.push(kop[i][k]);
                        }
                        else if (kop[i][k].checkrow() == 1 &amp;&amp; kop[i][k].checkcolumn()== 1) // if you go back to start then there is no escape from maze
                                {
                                cout<<"No escape from there"<<endl;
                                found = 1;
                        }
                        else if(kop[i-1][k].checkwall() == 0 and kop[i-1][k].checkvisit() == 0) //check up , if not visited then go
                        {
                                i=i-1;
                                kop[i][k].editvisit();
                                stackcell.push(kop[i][k]);
                        }
                        else //if you can not go anywhere , go 1 cell back and check there is another way or not.
                        {
                                back = stackcell.pop();
                                i = back.checkrow();
                                k = back.checkcolumn();
                        }

                }

                if(found == 1) // escaped
                {

                        while(stackcell.isEmpty() != 0) //to write from last to first, maybe recursive functions can be used,but i had no time to use it.
                        {
                                yaz = stackcell.pop();
                                terstenyaz.push(yaz);
                        }

                        while(terstenyaz.isEmpty() != 0) //write on screen
                        {
                                yaz=terstenyaz.pop();
                                cout<<"("<<yaz.checkcolumn()<<","<<yaz.checkrow()<<")"<<endl;
                        }

                }

        }

};
        int main ()
        {
                game a; //call
                a.find_goal();
                getchar();
                getchar();
        }

Related posts

Tags: , ,

To convert nrg files to iso files, you should install nrg2iso
sudo apt-get install nrg2iso
Usage:
nrg2iso a.nrg a.iso

Related posts

Tags: , , ,

i am using windows to work with Photoshop, however transfering files is very difficult  without using shared folder.

to add shared folder to your virtualbox, run your virtual os.

31. Click install guest additions from devices

31 2. Click yes to download iso file.

4

3.Click link and download it to your desktop.

5

4. Devices -> Mount CD/DVD-ROM -> CD/DVD-ROM Image

6

5. choise your iso file

76. Go to My computer and install guest additions like installing a program.

8

7. To add shared folders click Shared Folders.. from devices

9

8. Click add an slect your folder , i selected my foder named “Belgelerim”, don’t forget to make your folder permanent

10

9. Go to windows explorer , you can see your shared folder in My Network (or something like that) / VirutalBox Shared Folder /

i hope it helped you…

Related posts

Tags: , ,

Dbus Error Solution

After i installed the kde4 package, pisi gave erro
“org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.PolicyKit.AuthenticationAgent was not provided by any .service files”
to solve you should resinstall policykit

“sudo pisi it PolicyKit-kde –reinstall”
After restart your computer.

Related posts

Tags: ,

SSH Shell Commands

I moved my vps so i need some ssh commands, i found very usefull article for ssh command.

ls : list files/directories in a directory, comparable to dir in windows/dos.
ls -al : shows all files (including ones that start with a period), directories, and details attributes for each file.

cd : change directory · · cd /usr/local/apache : go to /usr/local/apache/ directory
cd ~ : go to your home directory
cd - : go to the last directory you were in
cd .. : go up a directory cat : print file contents to the screen

cat filename.txt : cat the contents of filename.txt to your screen

chmod: changes file access permissions
The set of 3 go in this order from left to right:
USER – GROUP – EVERONE
0 = —  No permission
1 = –X  Execute only
2 = -W-  Write only
3 = -WX  Write and execute
4 = R–  Read only
5 = R-X  Read and execute
6 = RW-  Read and write
7 = RWX  Read, write and execute

Usage:
chmod numberpermissions filename

chmod 000 : No one can access
chmod 644: Usually for HTML pages
chmod 755: Usually for CGI scripts

chown: changes file ownership permissions
The set of 2 go in this order from left to right:
USER – GROUP

chown root myfile.txt : Changes the owner of the file to root
chown root.root myfile.txt : Changes the owner and group of the file to root

tail : like cat, but only reads the end of the file
tail /var/log/messages : see the last 20 (by default) lines of /var/log/messages
tail -f /var/log/messages : watch the file continuously, while it’s being updated
tail -200 /var/log/messages : print the last 200 lines of the file to the screen

more : like cat, but opens the file one screen at a time rather than all at once
more /etc/userdomains : browse through the userdomains file. hit Spaceto go to the next page, q to quit

pico : friendly, easy to use file editor
pico /home/burst/public_html/index.html : edit the index page for the user’s website.

File Editing with VI ssh commands
vi : another editor, tons of features, harder to use at first than pico
vi /home/burst/public_html/index.html : edit the index page for the user’s website.
Whie in the vi program you can use the following useful commands, you will need to hit SHIFT + : to go into command mode

:q! : This force quits the file without saving and exits vi
:w : This writes the file to disk, saves it
:wq : This saves the file to disk and exists vi
:LINENUMBER : EG :25 : Takes you to line 25 within the file
:$ : Takes you to the last line of the file
:0 : Takes you to the first line of the file

grep : looks for patterns in files
grep root /etc/passwd : shows all matches of root in /etc/passwd
grep -v root /etc/passwd : shows all lines that do not match root

ln : create’s “links” between files and directories
ln -s /usr/local/apache/conf/httpd.conf /etc/httpd.conf : Now you can edit /etc/httpd.conf rather than the original. changes will affect the orginal, however you can delete the link and it will not delete the original.

last : shows who logged in and when
last -20 : shows only the last 20 logins
last -20 -a : shows last 20 logins, with the hostname in the last field

w : shows who is currently logged in and where they are logged in from.
who : This also shows who is on the server in an shell.

netstat : shows all current network connections.
netstat -an : shows all connections to the server, the source and destination ips and ports.
netstat -rn : shows routing table for all ips bound to the server.

top : shows live system processes in a nice table, memory information, uptime and other useful info. This is excellent for managing your system processes, resources and ensure everything is working fine and your server isn’t bogged down.
top then type Shift + M to sort by memory usage or Shift + P to sort by CPU usage

ps: ps is short for process status, which is similar to the top command. It’s used to show currently running processes and their PID.
A process ID is a unique number that identifies a process, with that you can kill or terminate a running program on your server (see kill command).
ps U username : shows processes for a certain user
ps aux : shows all system processes
ps aux –forest : shows all system processes like the above but organizes in a hierarchy that’s very useful!

touch : create an empty file
touch /home/burst/public_html/404.html : create an empty file called 404.html in the directory /home/burst/public_html/

file : attempts to guess what type of file a file is by looking at it’s content.
file * : prints out a list of all files/directories in a directory

du : shows disk usage.
du -sh : shows a summary, in human-readble form, of total disk space used in the current directory, including subdirectories.
du -sh * : same thing, but for each file and directory. helpful when finding large files taking up space.

wc : word count
wc -l filename.txt : tells how many lines are in filename.txt

cp : copy a file
cp filename filename.backup : copies filename to filename.backup
cp -a /home/burst/new_design/* /home/burst/public_html/ : copies all files, retaining permissions form one directory to another.
cp -av * ../newdir : Copies all files and directories recurrsively in the current directory INTO newdir

mv : Move a file command
mv oldfilename newfilename : Move a file or directory from oldfilename to newfilename

rm : delete a file
rm filename.txt : deletes filename.txt, will more than likely ask if you really want to delete it
rm -f filename.txt : deletes filename.txt, will not ask for confirmation before deleting.
rm -rf tmp/ : recursively deletes the directory tmp, and all files in it, including subdirectories. BE VERY CAREFULL WITH THIS COMMAND!!!

TAR
: Creating and Extracting .tar.gz and .tar files
tar -zxvf file.tar.gz : Extracts the file
tar -xvf file.tar : Extracts the file
tar -cf archive.tar contents/ : Takes everything from contents/ and puts it into archive.tar
gzip -d filename.gz : Decompress the file, extract it

ZIP Files:  Extracting .zip files shell command
unzip file.zip

Firewall - iptables commands
iptables -I INPUT -s IPADDRESSHERE -j DROP : This command stops any connections from the IP address
iptables -L : List all rules in iptables
iptables -F : Flushes all iptables rules (clears the firewall)
iptables –save : Saves the currenty ruleset in memory to disk
service iptables restart : Restarts iptables

Apache Shell Commands
httpd -v : Outputs the build date and version of the Apache server.
httpd -l : Lists compiled in Apache modules
httpd status : Only works if mod_status is enabled and shows a page of active connections
service httpd restart : Restarted Apache web server

MySQL Shell Commands
mysqladmin processlist : Shows active mysql connections and queries
mysqladmin drop databasenamehere : Drops/deletes the selected database
mysqladmin create databasenamehere : Creates a mysql database

Restore MySQL Database Shell Command
mysql -u username -p password databasename < databasefile.sql : Restores a MySQL database from databasefile.sql

Backup MySQL Database Shell Command
mysqldump -u username -p password databasename > databasefile.sql : Backup MySQL database to databasefile.sql

kill: terminate a system process
kill -9 PID EG: kill -9 431
kill PID
EG: kill 10550
Use top or ps ux to get system PIDs (Process IDs)

EG:

PID TTY TIME COMMAND
10550 pts/3 0:01 /bin/csh
10574 pts/4 0:02 /bin/csh
10590 pts/4 0:09 APP

Each line represents one process, with a process being loosely defined as a running instance of a program. The column headed PID (process ID) shows the assigned process numbers of the processes. The heading COMMAND shows the location of the executed process.

Putting commands together
Often you will find you need to use different commands on the same line. Here are some examples. Note that the | character is called a pipe, it takes date from one program and pipes it to another.
> means create a new file, overwriting any content already there.
>> means tp append data to a file, creating a newone if it doesn not already exist.
< send input from a file back into a command.

grep User /usr/local/apache/conf/httpd.conf |more
This will dump all lines that match User from the httpd.conf, then print the results to your screen one page at a time.

last -a > /root/lastlogins.tmp
This will print all the current login history to a file called lastlogins.tmp in /root/

tail -10000 /var/log/exim_mainlog |grep domain.com |more
This will grab the last 10,000 lines from /var/log/exim_mainlog, find all occurances of domain.com (the period represents ‘anything’,
– comment it out with a so it will be interpretted literally), then send it to your screen page by page.

netstat -an |grep :80 |wc -l
Show how many active connections there are to apache (httpd runs on port 80)

mysqladmin processlist |wc -l
Show how many current open connections there are to mysql

I take from here

Related posts

Tags: , ,

§