Wednesday, December 26, 2012

Assembly Language


i have changed my first PHPpage interface but it seem err not like 
what i want... it's look like so typical web. maybe im too new about 
this... have to learn and read more and more...

ok leave my PHP for a while ...i will explain in my next post bout 
that.. hehe

now. i want to do 3 task with assembly language.
this is a quite famaous questions to google for.. believe me. :P

no. im not doing this in my nano. im doing this coding using windows. 
(Microsoft c++ 2010 Express). im just try because i dont know wth of 
output i can get from the code. Still blur-ing.

6. Fibonacci Numbers

   Write a program that uses a loop to calculate the first seven values
   of the Fibonaccinumber sequence,described by the following formula:
   Fib(1) = 1, Fib(2) = 1, Fib(n) = Fib(n - 1) +   Fib(n - 2). Place
   each value in the EAX register and display it with a call 
   DumpRegsstatement (see Section 3.2) inside the loop. 

TITLE Question6 assignment1  (main.asm)

; Description:
; This progam adds and subtracts 32-bit unsigned
; integers and stores the sum in a variable
; Revision date:

INCLUDE Irvine32.inc

main PROC
 mov   eax,1
 call DumpRegs ;1st value    
 call DumpRegs ;2nd value

 mov   ebx,0 ; initial setup
 mov   edx,1
    mov   ecx,6 ; count

L1:
 mov  eax,ebx ; eax = ebx + edx
 add  eax,edx
 call DumpRegs ; display eax
 mov  ebx,edx
 mov  edx,eax
    Loop L1

 exit
main ENDP
END main

This is the output that i get ::
noted :: this is the wrong answer. why .? because the question want the first seven values... but it show you 8 in that output. The answer should be like this. pic below. But the coding must change a bit, you cant start the number from = 0, but = 1 .
so the answer for this task is :: 110 1100 7. Arithmetic Expression Write a program that implements the following arithmetic expression: EAX = −val2 + 7 − val3 + val1 Use the following data deļ¬nitions: val1 SDWORD 8 val2 SDWORD -15 val3 SDWORD 20 In comments next to each instruction, write the hexadecimal value of EAX. Insert a call DumpRegsstatement at the end of the program.

TITLE Question7 assignment1  (main.asm)

; Description:
; This progam adds and subtracts 32-bit unsigned
; integers and stores the sum in a variable
; Revision date:

INCLUDE Irvine32.inc

.data
 val1  SDWORd 8
 val2  SDWORD -15
 val3  SDWORD 20
 finalVal SDWORD ?

.code
main PROC

 mov eax, val2 
 neg eax ; eax=-15
 add eax, 7; -val2 + 7

 mov ebx, val3
 add ebx, val1 ; val3+val1

 sub eax,ebx

 mov finalVal, eax 
 call DumpRegs  ; display the registers

exit

main ENDP
END main

This is the output that i get ::
** double checking := −val2 + 7 − val3 + val1 = 15 + 7 - 20 + 8 = 10 8. Copy a String Backwards Write a program using the LOOP instruction with indirect addressing that copies a string from source to target, reversing the character order in the process. Use the following variables: source BYTE "This is the source string",0 target BYTE SIZEOF source DUP('#') Insert the following statements immediately after the loop to display the hexadecimal contents of the target string: movesi,OFFSET target ; offset of variable mov ebx,1 ; byte format movecx,SIZEOF target ; counter callDumpMem If your program works correctly, it will display the following sequence of hexadecimal bytes: 67 6E 69 72 74 73 20 65 63 72 75 6F 73 20 65 68 74 20 73 69 20 73 69 68 54

TITLE Question8 assignment1  (main.asm)

; Description:
; This progam adds and subtracts 32-bit unsigned
; integers and stores the sum in a variable
; Revision date:

INCLUDE Irvine32.inc

.data
source BYTE " This is the source string", 0 
target BYTE SIZEOF source DUP('#') 

.code
main PROC

 mov esi, (OFFSET source) + (SIZEOF source) - 2
 mov edi, OFFSET target
 mov ecx, SIZEOF source

L1: mov al, [esi]
 mov [edi], al
 dec esi              ; pointer to source string
 inc edi              ; pointer to target string
 loop L1
 
 mov esi, OFFSET target     ; offset of variable
 mov ebx, 1   ; byte format
 mov ecx, SIZEOF target-1 ; counter
 call Dumpmem
 
 exit

main ENDP
END main

This is the output that i get ::
the different is... there is extra space in the output compare the answer that already give in the question. to solve this... ** mov esi, (OFFSET source) + (SIZEOF source) - 2 change that 2 to 1. ** mov esi, (OFFSET source) + (SIZEOF source) - (1) then u'll get the output exactly like shown above in the question. :)
done. (",)v . got 10 marks for this.

Tuesday, December 18, 2012

My FirSt PHP ProjeCt.


Because this is the first time i will create PHP interface and start 
doing my final PSM project, i have search the web for this and i found 
one. Here allocation for the web. With my ankel help, i start discover 
what's the instruction is all about. 

I will take the introduction from the web.

Whether you have a small or a huge website, you know how much hassle 
and time it takes to upgrade your web site pages. The upgrade process 
becomes even more irritating when you make a change that needs to be 
upgraded on every page of your website; a good example of such a change 
is adding a button to the header or changing the copy right information 
in the footer of your website.  

What u need to start is :: 

1. Requirement :
>> Server/Hosting capable of running php scripts.


2.The Tutorial :

Step 1
Create a folder on your server and name it "design".
Create another folder and name it "pages"

- i have create those folder in my public_html folder
     [dora@localhost ~]$ cd public_html
     [dora@localhost public_html]$ ls
     = design  pages  rnd  smf

- but we must set directory
  >> define folder to become DocumentRoot

     [dora@localhost public_html]$ pwd
     = /home/dora/public_html

     [dora@localhost public_html]$ mkdir project1
     [dora@localhost public_html]$ ls
     = design  pages  project1  rnd  smf

     [dora@localhost public_html]$ mv design  pages project1/
     [dora@localhost public_html]$ ls
     = project1  rnd  smf

     [dora@localhost public_html]$ cd project1
     [dora@localhost project1]$ ls
     = design  pages

- now, project1 is my DocumentRoot for the design. :)
  because the best way do not mess up DocumentRoot with other files.

Step 2
Now in the root directory create a file and give it the 'index.php'

** my DocumentRoot is 'project1' folder
   so i will put index.php inside 'project1'

     [dora@localhost project1]$ pwd
     = /home/dora/public_html/project1
     [dora@localhost project1]$ ls
     = design  index.php  pages

Step 3
In the "pages" directory, create a page and give it the name: 'main.html'

     [dora@localhost project1]$ cd pages
     [dora@localhost pages]$ nano -w main.html



     [dora@localhost pages]$ ls
     = main.html

     [dora@localhost pages]$ cd .. (cmd for return dir.)

Step 4
Add the following code to your 'index.php' file

     [dora@localhost project1]$ nano -w index.php



Step 5
Create the following files in the design folder:
'header.html', 'footer.html', 'right_column.html', 'left_column.html'

-> header.html
   [dora@localhost design]$ nano -w header.html



-> footer.html
   [dora@localhost design]$ nano -w footer.html



-> right_column.html
   [dora@localhost design]$ nano -w right_column.html



-> left_column.html
   [dora@localhost design]$ nano -w left_column.html



** and to add a little touch to my design, i've create a 'styles.css' 
   file in the design folder and add the following code:

-> styles.css
   [dora@localhost design]$ nano -w styles.css



** Now give it a test drive spin!

   http://server.www.project1

   noted :: i just follow the intructions from this web.

Actually it wont work. The tutorial is not complete. The main.html didnt call the css scripts. Now i have to edit main.html
   
   [dora@localhost pages]$ nano -w main.html
   


EXAMPLE OF PHP INTERFACE - from the tutorial.

addition :: system checking. su - [root@localhost ~]# find / -name httpd.conf = /etc/httpd/conf/httpd.conf [root@localhost ~]# cat /etc/httpd/conf/httpd.conf |grep text/css >> nano -w /etc/httpd/conf/httpd.conf find the empty line :: fill in => AddType text/css .css then save. [root@localhost ~]# apachectl configtest [root@localhost ~]# apachectl restart EDITING CSS THAT I DO.. :P http://server/www/project1/index.php/page=main.html
i will edit more later. hehe. i must read about HTML/CSS scripts more. done for now.

Monday, December 17, 2012

How To Start New ProjeCt.


Now i will playing with PHP coding and try to learn about PHP and the syntax. First i need a place to do my coding test. It's just like i will start a new project for this. :)
To make all the things ready,
- go to linux

- ssh dora@server
  [dora@localhost ~]$ ls
  >> BNC.docx  public_html  smf_2-0-2_install.tar.bz2

- cmd :: mkdir public_html/rnd ; cd public_html/rnd

- using nano.
  nano -w testcode.php
  ** insert the code inside.
  from [html] ...... [/html]

- save

Now i can view from my SAFARI .

>> http://server/www/rnd

Sunday, December 16, 2012

How To Backup My CentOS


I guess backup ur system is an important things to do. We always try and error. who know when we try and error it's goes to permanent error to ur system. So i highlight this in my new post. Because i want to remember doing this. hehe.
i will do this in my MAC . not in my centOS.

cmd ::

cd VirtualBox\ VMs/

   Aaliyahs-MacBook-Pro:VirtualBox VMs aaliyahdora$ 
   Aaliyahs-MacBook-Pro:VirtualBox VMs aaliyahdora$ ls
   >> CentOS6

/VirtualBox VMs$ tar cjf CentOS6-`date '+%d-%B-%Y'`.tar.bz2 CentOS6/
/VirtualBox VMs$ ls |grep bz2

** the dated will be auto in. ( i fill the cmd with dated when i 
   first try this .. :X )

   Aaliyahs-MacBook-Pro:VirtualBox VMs aaliyahdora$ ls
    >> CentOS6  CentOS6-24-November-2012.tar.bz2

   du -sh ( to check file size )

   Aaliyahs-MacBook-Pro:VirtualBox VMs aaliyahdora$ du -sh 
   CentOS6-24-November-2012.tar.bz2

   >> 328M CentOS6-24-November-2012.tar.bz2

   Aaliyahs-MacBook-Pro:VirtualBox VMs aaliyahdora$ du -sh CentOS6

   >> 1.1G CentOS6

psst : have free to try this.. :)

Friday, December 14, 2012

Create a Simple Machines Forum (SMF) - Part03


This is the interface of my SMF .



i mean first interface after done the installation.

Now, i will try to change the templates FORUM and set up my FORUM until it looks more cute like me. hehe.

1. i have search for SMF templates. googl-ing i mean.
2. then i download about 4-5 templates that im interest to my MAC.
3. i compress the files to tar.bz2 n upload the files to my server.

cmd ::
- open vbox

- open my MAC terminal. ** Aaliyahs-MacBook-Pro:~ aaliyahdora$ cd Downloads -> ls

- then i upload all the templates files to the server. ** Aaliyahs-MacBook-Pro:Downloads aaliyahdora$ scp green-ornamental. tar.bz2 dora@192.168.56.10:/home/dora/public_html/smf/Themes ** Aaliyahs-MacBook-Pro:Downloads aaliyahdora$ scp Boxit_2. tar.bz2 dora@192.168.56.10:/home/dora/public_html/smf/Themes ** Aaliyahs-MacBook-Pro:Downloads aaliyahdora$ scp Salava_1_0_x. tar.bz2 dora@192.168.56.10:/home/dora/public_html/smf/Themes ** Aaliyahs-MacBook-Pro:Downloads aaliyahdora$ scp extreme. tar.bz2 dora@192.168.56.10:/home/dora/public_html/smf/Themes ** Aaliyahs-MacBook-Pro:Downloads aaliyahdora$ scp dzinerstudio_urban. tar.bz2 dora@192.168.56.10:/home/dora/public_html/smf/Themes ** Aaliyahs-MacBook-Pro:Downloads aaliyahdora$ scp Dirt_3. tar.bz2 dora@192.168.56.10:/home/dora/public_html/smf/Themes ** Aaliyahs-MacBook-Pro:Downloads aaliyahdora$ scp WoW_2. tar.bz2 dora@192.168.56.10:/home/dora/public_html/smf/Themes ** Aaliyahs-MacBook-Pro:Downloads aaliyahdora$ scp Dirt_3_SMF2. tar.bz2 dora@192.168.56.10:/home/dora/public_html/smf/Themes

- extract the files in folder themes. - open SMF and import the file from server.



HOW TO USED SMF TEMPLATES.

let say i want to import extreme templates folder

- FROM A DIRECTORY FROM SERVER :/home/dora/public_html/Themes/extreme

- Copy of Default named : extreme

- click install

then you can choose to use which one templates you want in 
"OVERALL FORUM DEFAULT" & Reset it to everyone.
example of templates in my SMF.

for the first time doing this, i got a problem..

when i click to install the templates from the server, it's always
appear the link like this ::

****  [That theme directory doesn't exist, or doesn't contain a theme!]

for   [dora@localhost Boxit_2]$ pwd
      >> /home/dora/public_html/smf/Themes/Boxit_2

****  if i success installing the themes, templates that i download dont 
      hav the image and backgound.

noted :: this is because centOS6 got little problem with chmod/permission.

then i tried to chmod all my templates files.

cmd ::

try n error :

[dora@localhost Themes]$ 
chmod 777 /home/dora/public_html/smf/Themes/Boxit_2/* 
chmod 777 /home/dora/public_html/smf/Themes/Boxit_2/*.*
[dora@localhost Themes]$ 

**** when i used this 2 cmd, i can see the Boxit_2 template name already
     in the list of template in my SMF but when i choose the template as
     default.. there's no background & image attach. it is just like a 
     plain html without css.

then i try this cmd :

[dora@localhost Themes]$ 
chmod -R 777 /home/dora/public_html/smf/Themes/Boxit_2/

**** when i reload the pages. it's well done. suddenly i got beautiful 
     templates in my SMF. Then i do the command to all the templates 
     folder in server.

[dora@localhost Themes]$
chmod 777 /home/dora/public_html/smf/Themes/Dirt_3_SMF2/* 
[dora@localhost Themes]$ 
chmod 777 /home/dora/public_html/smf/Themes/Dirt_3_SMF2/*.*
[dora@localhost Themes]$ 
chmod -R 777 /home/dora/public_html/smf/Themes/Dirt_3_SMF2/
[dora@localhost Themes]$ 
chmod 777/home/dora/public_html/smf/Themes/WoW_2/*
[dora@localhost Themes]$ 
chmod 777 /home/dora/public_html/smf/Themes/WoW_2/*
[dora@localhost Themes]$ 
chmod 777 /home/dora/public_html/smf/Themes/WoW_2/*.*
[dora@localhost Themes]$ 
chmod -R 777 /home/dora/public_html/smf/Themes/WoW_2/
[dora@localhost Themes]$ 
chmod 777 /home/dora/public_html/smf/Themes/Catalysm_2/*
[dora@localhost Themes]$ 
chmod 777 /home/dora/public_html/smf/Themes/Catalysm_2/*.*
[dora@localhost Themes]$ 
chmod -R 777 /home/dora/public_html/smf/Themes/Catalysm_2/
[dora@localhost Themes]$ 
chmod 777 /home/dora/public_html/smf/Themes/green-ornamental/*
[dora@localhost Themes]$ 
chmod 777 /home/dora/public_html/smf/Themes/green-ornamental/*.*
[dora@localhost Themes]$ 
chmod -R 777 /home/dora/public_html/smf/Themes/green-ornamental/
[dora@localhost Themes]$ 
chmod 777 /home/dora/public_html/smf/Themes/extreme/*
[dora@localhost Themes]$ 
chmod 777 /home/dora/public_html/smf/Themes/extreme/*.*
[dora@localhost Themes]$ 
chmod -R 777 /home/dora/public_html/smf/Themes/extreme/
[dora@localhost Themes]$ 
chmod 777 /home/dora/public_html/smf/Themes/Salava_1_0_x/*
[dora@localhost Themes]$ 
chmod 777 /home/dora/public_html/smf/Themes/Salava_1_0_x/*.*
[dora@localhost Themes]$ 
chmod 777 /home/dora/public_html/smf/Themes/Salava_1_0_x/*
[dora@localhost Themes]$ 
chmod -R 777 /home/dora/public_html/smf/Themes/Salava_1_0_x/
[dora@localhost Themes]$ 
chmod 777 /home/dora/public_html/smf/themes/Salava_1_0_x/*.*
[dora@localhost Themes]$ 
chmod 777 /home/dora/public_html/smf/Themes/dzinerstudio_urban/*
[dora@localhost Themes]$ 
chmod 777 /home/dora/public_html/smf/Themes/dzinerstudio_urban/*.*
[dora@localhost Themes]$ 
chmod -R 777 /home/dora/public_html/smf/Themes/dzinerstudio_urban/ 

**** it's done. :)
MY TEMPLATES EXAMPLE.








psst :: it's great. (".)v

Thursday, December 13, 2012

Create a Simple Machines Forum (SMF) - Part02


SMF installing check list.

1. Check Client Requirements
2. Check Server Requirements
3. Check Server Recommendations
4. Obtain SMF
5. Upload SMF
6. Run the SMF Installer
7. Using Webinstall

Now you're in the first page of SMF installer from localhost.

STEP 1 :: WELCOME



STEP 2 :: WRITABLE CHECK



to work manually, Some files need to be writable for SMF to work properly. This step allows you to let the installer make them writable for you. However, in some cases it won't work - in that case, please make the following files 777 (writable, 755 on some hosts)

Used user dora in my linux. i will trying to start writable to all data in the list above.

[dora@localhost smf]$ chmod 777 attachments
[dora@localhost smf]$ chmod 777 avatars
[dora@localhost smf]$ chmod 777 cache
[dora@localhost smf]$ chmod 777 Packages
[dora@localhost smf]$ chmod 777 Packages/installed.list
[dora@localhost smf]$ chmod 777 Smileys
[dora@localhost smf]$ chmod 777 Themes
[dora@localhost smf]$ chmod 777 agreement.txt
[dora@localhost smf]$ chmod 777 Settings.php
[dora@localhost smf]$ chmod 777 Settings_bak.php

when you do this steps, as you can see, writable file will be gone from the list. But if you go to smf file in your server, you can see the writable files will be auto highlight in there.



Now you're in the STEP 3 :: DATABASE SETTINGS



FIRST, you must make sure your mysql is ready.
cmd:: [root@localhost ~]# mysql -u root
        mysql> show databases;
        mysql> use mysql;
        >> ERROR 1044 (42000):Access denied for user ''@'localhost' to
           database 'mysql'

*** this is because i got something wrong with my mysql/database.

       [root@localhost ~]# /sbin/service mysqld stop 
       [root@localhost ~]# mysqld_safe --skip-grant-tables &
       [root@localhost ~]# mysql -u root 
         mysql> show databases;
         mysql> use mysql;
         mysql> update user set password=PASSWORD("123456") where  
                User='root';
         mysql> flush privileges;
         mysql> \q

       [root@localhost ~]#  /etc/init.d/mysqld stop
       [root@localhost ~]#  /etc/init.d/mysqld start

then reload my phpadmin. user :: root / pass :: 123456
>> #1045 - Access denied for user 'root'@'localhost'(using password:YES)

*** this is because i still got something wrong with my mysql/database.

        [root@localhost ~]# cat /etc/sysconfig/selinux
        [root@localhost ~]# chkconfig --list |grep restorecond
        [root@localhost ~]#  netstat -tanp |grep 3306
        [root@localhost ~]# mysql -u root -p  
           Enter password :      (password : 123456)
           >> ERROR 1045 (28000):Access denied for user 'root'@'localhost
              '(using password: YES)
        [root@localhost ~]# mysql -u root 
           mysql> show databases;
           mysql> \q

        [root@localhost ~]# mysqladmin -u root password 123456
           >>mysqladmin: Can't turn off logging; error: 'Access denied;
             you need the SUPER privilege for this operation'
        [root@localhost ~]# mysqladmin -u root -p'123456' password 1234
           >>mysqladmin: connect to server at 'localhost' failed
        [root@localhost ~]# mysqladmin -u root -p'123456' password 123456
           >>mysqladmin: connect to server at 'localhost' failed

*** this mean i cant used this mysqld. So i have to delete it and install
    it back one more time.

        [root@localhost ~]# rpm -e mysql-server-5.1.66-1.el6_3.i686
        [root@localhost ~]# rpm -qa |grep mysql-server
        [root@localhost ~]#  ls -l /usr/lib/mysql/

****    yum install mysql-server
        [root@localhost ~]# /sbin/service mysqld start

** the results is still same.

        [root@localhost ~]# yum remove mysql mysql-libs mysql-server

****    yum install  mysql mysql-libs mysql-server  phpmyadmin
        [root@localhost ~]# /sbin/service mysqld start

** when the results still same. mean i still didnt have 'mysqld' in show 
   database mysql.

****    yum install mlocate
        [root@localhost ~]# yum remove mysql mysql-libs mysql-server

        [root@localhost ~]# updated.
        [root@localhost ~]# locate mysql'then the history of mysql appear
        [root@localhost ~]# rm -rf /var/lib/mysql/
        [root@localhost ~]# updatedb
        [root@localhost ~]# locate mysql
        [root@localhost ~]#  rm -rf /var/log/mysql/
        [root@localhost ~]#  rm -rf /var/log/mysql*
        [root@localhost ~]#  rm -f/root/.mysql_history
        [root@localhost ~]# updatedb(now see the different of ls 
                                     files left.)

** just delete the files related.

****    yum install  mysql mysql-libs mysql-server  phpmyadmin
        [root@localhost ~]# /sbin/service mysqld start
        [root@localhost ~]# mysql -u root
           mysql> show databases;
           mysql> \q
         
        [root@localhost ~]# cat /etc/httpd/conf.d/phpmyadmin.conf
           = edit file deny to allow from all.
           = nano -w /usr/share/phpmyadmin/config.inc.php 

                  $cfg['blowfish_secret'] = ''; (fill in the blank)
                  $cfg['blowfish_secret'] = 'airbatucampur';

        [root@localhost ~]# apachectl restart

** When everything seems oke now... go back to shell.

         [root@localhost ~]# su - dora
         [dora@localhost ~]$ pwd
            >> /home/dora
         [dora@localhost ~]$ ls
            >> BNC.docx  public_html  smf_2-0-2_install.tar.bz2   
         [dora@localhost ~]$ cd public_html
            >> /home/dora/public_html
         [dora@localhost public_html]$ rm -rf smf
         [dora@localhost public_html]$ mkdir smf ; cd smf ; tar xjf 
                               /home/dora/smf_2-0-2_install.tar.bz2

** new URL : http://192.168.56.10/public_html/smf/install.php 
** Now focus to STEP 3. Database Settings.
    - Go to phpmyadmin
    - login root no password.
    - MySQL > db > Browse > Insert
      ** host = localhost
      ** smf_db = name_db
      ** user = dora
      ** click YES for the top six option (from select_priv until 
         drop_priv & alter-priv [Y])
      ** save.
    - MySQL > user > Browse > Insert
      ** host = localhost
      ** user = dora
      ** password = '' (my password)
         noted : in the back choose 'choose password'
      ** save.
    - click HOME.
    - database name :: smf_db -> create.
    - click Reload privileges. "The privileges were reloaded suc.

    - in SMF database settings.
    - fill in the blank.
    - username :: dora
    - database name :: smf_db
    - table prefix :: smf_ <- let it be.
    - server :: localhost 
** NOTED (in addition)
checking for mysql/httpd
     
     cmd::
     [root@localhost ~]# chkconfig --list |grep mysql
     >> mysqld  0:off 1:off 2:off 3:off 4:off 5:off 6:off

     = it's mean your mysqld wont start in boot time.
       changed it to autostart on boot.

     [root@localhost ~]# chkconfig mysqld on
     [root@localhost ~]# chkconfig --list |grep mysql
     >> mysqld  0:off 1:off 2:on 3:on 4:on 5:on 6:off

     [root@localhost ~]# chkconfig --list |grep httpd
     >> httpd  0:off 1:off 2:on 3:on 4:on 5:on 6:off

     = httpd already auto on while boot.

STEP 4 :: FORUM SETTINGS



STEP 5 :: DATABASE POPULATION



STEP 6 :: ADMIN ACCOUNT



STEP 7 :: FINALIZE INSTALL



** it's done for now. :)

Create a Simple Machines Forum (SMF) - Part01

This is the first asignment from my ankel. :)

1. download smf_2-0-2_install to lappy.
2. compress the file to smf_2-0-2_install.tar.bz2.
3. copy smf_2-0-2_install.tar.bz2 to server
  • 3.1 open vbox
  • 3.2 copy smf_2-0-2_install.tar.bz2 to server cmd ::scp smf_2-0-2_install tar.bz2 dora@192.168.56.10:/home/dora
  • 3.3 check back :: ssh dora@server ls >> [dora@localhost ~]$ ls smf_2-0-2_install.tar.bz
  • 3.4 now make a new directory cmd :: mkdir -p public_html/smf check back :: ls public_html smf_2-0-2_install.tar.bz2
  • 3.5 cmd :: cp smf_2-0-2_install.tar.bz2 public_html/smf
  • 3.6 cd public_html/smf [dora@localhost smf]$ ls smf_2-0-2_install.tar.bz2
  • 4. compress the file.
       cmd :: tar xjf smf_2-0-2_install.tar.bz2
    

    Packages Sources  cache  install_2-0_sqlite.sql ssi_examples.php       SSI.php  Themes   index.php  license.txt  ssi_examples.shtml           Settings.php      agreement.txt  install.php  news_readme.html         subscriptions.php Settings_bak.php  attachments  install_2-0_mysql.sql readme.html       Smileys     avatars      install_2-0_postgresql.sql  smf_2-0-2_install.tar.bz2 

    5. After extract the file like the box above show,
       use this cmd once for a user :: chmod 711 $HOME
       noted : must do it again only to another user.

    6. Now back to root .
       su -
       cd /var/www/html then pwd
       ln -s /home/dora/public_html public_html <- link the file
       ls -1
       exit 
    7. Open my safari :http://server/public_html/smf/install.php

    Now i can see SMF page is ready to setting up from my localhost. :)

    Quick Command U must always Remember.

    To begin playing with your CentOS6 or Terminal, you need to remember all the simple-simple commands that you will always used to code. As oldest always said "Practise make Perfect", it's actually no doubt. You must remember all the commands or else you will loose ur track or lost in what you are doing later.

    This is all the commands that i have used ::

    1. THE NOTED ::
    1. /etc/hosts (for pc internet connection) 
    2. postfix (e-mail connection touch)
    3. varchar - variable character
    4. console/konsole/terminal/shell/exterm (same term)
    5. in my localhost :: 'dora' is my shell user
    6. centOS save energy (click mouse in blank then press spacebar)
    7. Vbox have snapshot to restore the last backup system.
    8. sudo < used in MAC terminal. no function but some system 
       direct edit w/o sudo is not allowed 
    9. Print skrin on MAC : control-shift-4, click SPACEBAR to kamera
       icon and clikc ENTER.
    10.Cant put any active web in /root .
    11.cmd IRC :: /ctcp [nick] version
    

    2. TERMINAL COMMAND ::
    1. ping ( to test IP)
    2. ping -c 4
    3. ls 'this command to see files ls . depend on directory.
    4. cd 'this command used to go into files.
    5. scp [filename] dora@192.168.56.10:/home/dora 'cmd to transfer file to server.
    6. pwd (print work directory) 'command use to see directory.
    7. mkdir [filename] 'create new folder
    8. scp dora@192.168.56.10:/home/dora/BNC* . 'or
    9. scp dora@192.168.56.10:/home/dora/BNC.docx . 'cmd to take file from server.
    10./exec -o df -h |grep home
    11.w
    12.check safari :: safari & / whereis safari

    3. USED WHILE BUILD UP LOCALHOST (server) ::

    1. ls /etc/sysconfig
    2. ls /etc/sysconfig/network-scripts
    3. cat /etc/sysconfig/network-scripts/ifcfg-eth0
    4. dhclient eth0
    5. ifconfig eth0
    6. ifconfig eth1
    7. ifconfig (see how much we have eth) 
    8. ifconfig |grep inet ' grep = choose.
    9. ifconfig -a |grep inet
    10.dmesg |grep eth (check all eth)
    11.ifconfig eth1 up :: using nano - /sbin/ifconfig eth1 up (permanent up)
    12./sbin/ifconfig eth1 192.168.56.10 netmask 255.255.255.0 broadcast 
       192.168.56.255    (set mask ip for localhost)


    4. SETTING UP PHP/MYSQLD/APACHE:: from terminal and root
    1. rpm -qa (look for ls download)
    2. rpm -qa |grep php (look for ls php that have been dl)
    3. cd /var/www/html
    4. cat info.php
    5. yum install wget
    6. rpm -ivh http://packages.sw.be/rpmforge-release/rpmforge-r elease-0.5.2-7. el6.rf.i686.rpm
    7. yum install phpmyadmin
    8. /sbin/service mysqld start
    9. /sbin/service httpd start
    10.apachectl reload
    11.apachectl restart
    12.chkconfig --list |grep mysql
    13.chkconfig mysqld on 14.chkconfig --list |grep httpd


    5. ROOT :: ROOT/USER
    1. ssh (to connect to server) 
       ex :: ssh root@server / ssh dora@server
    2. su - (change/switch user to root)

    6. SERVER COMMAND
    1. rm -f ( delete file/folder )< this cmd should use with careful
    2. adduser [name] 'this is command to adduser in linux.
    3. passwd [user] 
    4. userdel [name] 'this is command to delete user.
    5. yum install 
    6. mv = rename folder
       ex :: mv [oldfoldername] [newfoldername]
    7. tar cjf [folder/filename.tar.bz2] [folder/filename] <- compress
    8. tar xjf [folder/file name] <- decompress
    9. mkdir -p public_html/smf <= make new directory
    10.ls -l (to see what you have install)
    11.ls -s 
    12.uname -an <- will show the system you're in.


    7. NANO EDITOR

    noted :: when you used nano for editing, enter new line from the last command line to type your new command then reboot.
    1. nano test (test nano)
    2. cntl x :: to save
    3. cntl r :: editing
    4. cat test 
    5. nano -w /etc/rc.local (set ip)
    6. nano -w /etc/sysconfig/selinux 'changed.
       SELINUX=enforcing => SELINUX=disabled
    7. nano -w /etc/httpd/conf.d/phpmyadmin.conf7. 
       Deny from all > Allow from all
    8. nano -w /usr/share/phpmyadmin/config.inc.php
       $cfg['blowfish_secret'] = ''; (fill in the blank)
       ex :: $cfg['blowfish_secret'] = 'airbatucampur';
    9. nano -w /etc/my.cnf
    10.sudo nano -w /etc/resolv.conf (terminal) 'for dns 

    8. FILES BACKUP (on system)
    cmd::
    1. cd VirtualBox\ VMs/
    2. /VirtualBox VMs$ tar cjf CentOS6-`date '+%d-%B-%Y'`.tar.bz2 CentOS6/
    3. /VirtualBox VMs$ ls |grep bz2
       ... to check folder size.
    4. /VirtualBox VMs$ du -ms CentOS6-23-November-2012.tar.bz2
    5. /VirtualBox VMs$ du -ms CentOS6 

    9. CHANGE IP TO OTHER WORD ex:server|vbox|centOS|urname
    noted : do in MAC.
    
    1. cat /etc/hosts
    2. sudo nano /etc/hosts
    3. last line add like this :: 192.168.56.10   server
    4. save . cntrl x 

    10. CHANGE DIRECTORY FOLDER NAME ON SERVER
    1. login user << in centOS
       [dora@localhost ~]$ pwd
    2. su - [go to root]
       [root@localhost dora]# pwd
       /home/dora
    3. cd /var/www/html
    4. ls -l 'to locate location.
    5. ln -s /home/dora/public_html/ www
    
    *** with the two cmd above, no. 9 and 10, my URL will be like this:
        http://server/www/newproject.. . 


    noted :: command will be update when new command is used. :)

    How to start using code.


    What i have here :: Mac Terminal / VirtualBox with centOS 06


    details ....

    MacbookPro (Software Mac OS X Lion 10.7.5 )


    Oracle VM VirtualBox setting with ..

    1. General - Name :: Centos06 - Operating System :: Red Hat

    2. System - Base Memory :: 1024MB - Boot Order ::Floppy,CD/DVD-ROM,Hard Disk :: Acceleration :: VT-x/AMD-V,Nested Paging,PAE/NX

    3. Display - Video Memory :: 12MB - Remote Desktop Server :: Disabled.

    4. Storage - Controller : IDE/IDE Secondary Master :: [CD/DVD]Host Drive 'MATSHITA DVD-R UJ-8A8' - Controller : SATA/SATA Port 0 :: CentOS6.vdi (Normal, 8.00 GB)

    5. Audio - Host Driver :: CoreAudio - Controller :: ICH AC97

    6. Network - Adapter 1 :: Intel PRO/1000 MT Dekstop (NAT) - Adapter 2 :: Paravirtualized Network (Host-Only Adaper, 'vboxnet0')

    7. USB - Device Filters :: 0 (0 active)

    8. Shared - None

    9. Description - None

    noted :: This is the first things to set out. :)

    i have set my own localhost :: 192.168.56.10 and changed it with name 'server' , maybe later i will change it to name 'mydora' . :)

    what is that mean .? mean .. i can root my centOS from Mac terminal by only typing 'server' . It's no need to type the IP all the time.. it is easy right .? and looks more smooth for the url . ex http://server/blabla or http://mydora/blabla.

    And i have already installed nano, nano is the unix editor. yum install for phpmyadmin(editor for database interface), wget installed before installed phpmyadmin. Why must installed wget first .?? because phpmyadmin is not in standard repo. I have to installed repoforge first mean i have to install phpmyadmin from another server.