RSS

CATaZine Competition

CATaZine Competition

 

 CATaZineLive announce about competition in writing technical articles , and We will print the best 5 articles in the printed version Of CATzineLive soon,InchaAllah .
Note that the deadline of receiving topics is the next Friday 30/03/2012.
To send your article please send to: catazine@catreloaded.net with brief info about you , and with subject ” Competition “ .
Note: You must be the writer of the article (preserving the copyrights).
Thanks!

 


 

تعلن مجلة CATaZineLive عن بدأ مسابقة في كتابة المقالات التقنية ، وسيتم طباعة أفضل 5 مقالات في نسخة الكاتازين المطبوعة المقرر طرحها قريبا ان شاء الله.
مع العلم أن أخر موعد لاستلام المقالات في المسابقة يوم الجمعة القادم 30-3-2012.

لارسال المقالات ارسلها على : catazine@catreloaded.net مرفقة ب بيانات عنك , و بجانب العنوان كلمة – Competition-.

ملحوظة : يجب ان تكون المقالة من ابداع الكاتب (حفاظا على حقوق الملكية وحقوق النشر).

و ترقبوا المزيد عن المسابقة في الفترة القادمة ان شاء الله 🙂

 

 

 

 

 
1 Comment

Posted by on March 23, 2012 in Announcement, CAT, Featured

 

The Weekly Harvest – الحصاد الأسبوعي

The Weekly Harvest – الحصاد الأسبوعي

السلام عليكم 🙂

الحصاد الاسبوعي من مجلة كاتازين لايف ! | The Weekly Harvest

 

 

CATaZineLive HTML win vs linux networks lets python nouran saad ftoh marwa amratya
 
 

Tags: , , ,

Python Part (9) : OOP

Python Part (9) : OOP

تعملنا سابقا بعض العناصر الاساسية في البايثون مثل (strings ,list,dictionary,….) كل هذه العناصر تعتبر objects.

وبما انهم يندرجون تحتى مسمى واحد ، فمن المؤكد ان هناك بعض العوامل والصفات المشتركة فيما بينهم ،هذا الحديث سيقودنا مباشرة الى ال(oop) ، ولكن دعونا في البداية نلقي نظرة على مفهوم ال (functions) .

Functions

تعمل ال(functions) على تقسيم البرنامج الى قطع معية من الكود ، كل قطعة تقوم بعمل خاص ومميز ، هذه القطع تسمى (function) وتعمل بمجرد استدعائك لها في المكان المناسب في كود البرنامج لكي تقوم بالوظيفة المطلوبة في الوقت المناسب اثناء عمل البرنامج  .

يحاول المبرمجون -قدر الامكان – تقسيم البرامج الكبيرة الى (functions) وجعل البرنامج في شكل قطع مرتبة من الكود ، وهذا لاسباب عديدة من اهمها

تسهيل قراءة الكود وتصور ما يمكن ان يقوم به الكود عند تشغيل البرنامج  .

يساعد المبرمج في التعرف على اي جزء من البرنامج في حالة حدوث اخطاء .

سهولة التعديل والتطوير في الكود فيما بعد اذا لزم الامر .

(حتى الان) تعد هذه مقدمة عامة عن مفهوم ال (oop و ال functions) ، ولكن دعونا نجعل الامر اكثر تخصصية في البايثون ،ولنبدأ بالتحدث عن بعض المفاهيم الاساسية في ال(oop) .

Object

ال(object) يتكون من مجموعة من ال(data)  تقوم بتوصيف ال(object) ، ومجموعة من ال(methods) تقوم بتحديد المهمة او الوظيفة التي يؤديها ال(object) .

Class

هو الهيكل العام او القالب الذي يصنع منه ال(object) ، وللتسهيل : اعتبر ان الكلاس عبارة عن وعاء يحتوي على مجموعة من ال(objects) من نفس النوع . وفي الكلاس يتم تعريف ال(methods) والمتغيرات التي تتحكم في ال(object) .كما يمكن تعريف اكثر من object في نفس الكلاس .

 

في الجزء الثامن من هذه السلسلة تعلمنا كيفية تعريف دالة جديدة ، عن طريق (def) وذكرنا ان ال(def) هي احدى طرق ال(abstraction) .

في الحقيقة تكمن فائدة ال(abstraction)  الاساسية وهي تعني “التجريد” في توفيرها للجهد والوقت على المبرمج اثناء كتابة الاكواد الضخمة . وهنا تظهر فكرة ال(function) مرة اخرى ، انك تقوم بتعريف دالة تقوم بوظيفة محددة وتقوم باستدعائها فيما بعد في البرنامج كلما لزم الامر ، او حتى استخدامها في وظائف مشابهة في برامج اخرى ان امكن .

 ملحوظة مهمة  :

يفضل ان يقوم المبرمج بجعل ال(functions) اقل اعتمادية على البرنامج نفسه ،بحيث يقوم بتحويلها الى (Parametrized Functions) ، وجعلها (Generic) الى اقصى حد ممكن ، وذلك لسهولة استخدامها في برامج اخرى فيما بعد .

والان دعونا نسرد خصائص ال(oop) :

1- Polymorphism:

اصل الكلمة تعني “تعدد الاشكال” ،وتعني في ال (oop) : وجود عملية تؤدي نفس الوظيفة على انواع مختلفة من الكائنات (objects) .

بمعنى انه يمكن استخدام عملية الجمع ،لجمع الارقام ،ويمكن استخدامها ايضا لجمع مجموعة من ال(characters).

مثال :

في البداية : قمنا بتعريف دالة (add) تقوم بعملية جمع شيئين ،وارجاع الناتج .

بعد ذلك تعاملت الدالة مع الارقام وارجعت الناتج ، ثم تعاملت مع الحروف وارجعت الناتج ،وهذا يوضح مفهوم ال(Polymorphism).

2- Encapsulation:

معناها الحرفي هو “التغليف”.

اما في ال(oop) فهو استخدام اي جزء من (object) معين ،سواء كان (method) او (attribute) دون التعرف على محتواه ،ودون التعرف على طريقة تعريفه .

3- Inheritance:

معناها الحرفي هو الوراثة” .

في ال(oop) تعني الوراثة ايضا ولكن بشكل مختلف قليلا. فهي تعني ان يرث الكلاس مجموعة من الخصائص للكلاس الاصلي .لكن ياتي الاختلاف بين الوراثة في الحقيقة وبين الوراثة في ال(oop) في النقطة التالية:

– الوراثة الحقيقية يأخذ الطفل مجموعة من صفات الاب ولكن ليس بالضرورة ان يأخذ جميع الخصائص والصفات .

– في ال(oop) يأخذ الكلاس جميع صفات الكلاس الاصلي + مجموعة من الصفات الخاصة (ان وجدت) .

 

الى هنا نكون قد وضحنا بعض معالم ال(oop) في البايثون ، نستكمل حديثنا في المرة القادمة ان شاء الله  بالتفصيل  مع ذكر الامثلة .

 
2 Comments

Posted by on March 21, 2012 in Featured, Programming, Software

 

Tags: , , ,

let's forge !! ()

let's forge !! ()

welcome all ,

sure you are wondering what’s Forge !!
Forge is a Cross-platform app framework  which enables you to create native apps for multiple platforms from a single HTML5 codebase.

Here are a few benefits of Forge:

    • ** Single code base
    • ** Ability to generate mobile applications for Android and iPhone
    • ** Ability to generate browser extensions for Chrome, Safari, Firefox, and IE
    • ** Rapid development
    • ** Reduced maintenance costs

 

It doesn’t require to write any line of  java or objective-c or learn any platform-specific APIs.
now let’s get started

 

    1.  Download the development environment
              ** To use Forge, you will first need to sign up for the service at https://trigger.io/forge/
      •  download the Forge development environment and unzip it to any directory .

 

    1.  For Win users >> run go.bat
      • ** for linux and MAC users >> from the terminal change the directory to wherever you extracted the zip file run source  go.sh

 

    1.  Creating your first app
               ** by now u should have a command terminal look something like that.

 

(forge-environment)

** HINT ** if u want to keep each of your apps separated u should use another directory for them

mkdir “../test-apps”
cd “../test-apps”

now we are in a separated directory , let’s create the app

forge create
after that you will be prompted to enter the app name , your user-name , password and that’s it you are done 🙂

you can switch to the app directory and try run your index page named index.html Now if u wanna start your app as an extension to chrome , or Firefox add-on or android , iphone app >> let’s move to another level i would prefer to start it as an extension to chrome .

by now u should see src  directory under the app directory , this is where all the extensions will be placed

inside , u should see “config.jsonwhich automatically generated and holds all the settings for the extension .

 

1- Create a file called background.js” inside the “src” directory and add the following code
     window.alert(‘Hello Chrome’);

2- Open config.json and add this file to the background_files array
     “background_files”: [“background.js”],

3- Building and load Chrome Extensions Using Forge

** Navigate to the directory where you extracted the build tools from the terminal

** Windows users run go.bat. OSX/Linux users run source go.sh

** Run forge build.

** When the build finishes take a look inside the development directory and you should see your generated Chrome extension

** Open the Chrome browser and go to chrome:extensions.

** If Developer mode isn’t already enabled click the [+] button at the top right.

** Click Load unpacked extension.

** Navigate to the development directory which contains the generated extension.

** Select the chrome folder and click OK.

** You should see ‘Hello Chrome’ alert window as soon as the extension has loaded.

>> NOTE  <<
only the “Get Started” apps are FREE , more pricing here >> https://trigger.io/pricing/

>> REFERENCE <<
https://trigger.io/

 

 

How to be a network adminstrator (2)

How to be a network adminstrator (2)

We will begin  network admin package 2 , Check the first package here :

 Agenda for this package :

  • $$ netstat
  • $$ ifstat
  • $$ tcpdump
  • $$ dhclient
  • $$ nmap
  • $$ telnet
  • $$ ssh
  • $$ minicom
  • $$ ftp
  • $$ wget
  • $$ showmount

 

1- netstat

  • ** Function : used to display network connections , information , else ..
  • ** Syntax :

$netstat [option]

hint : option like [-r] [-s] ,make view of info page

 

example

 

netstat without options used to display all active localhost connections.

 

2- ifstat

  • ** Function : a simple tool to report interface activity
  • ** Syntax :

$ifstat

example

  • ifstat need to install may be by default with system if not make this
    ◦ sudo apt-get install ifstat for debian
    ◦ yum install ifstat

 

3- tcpdump

  • ** Function : tcpdump command is also called as packet analyzer . With tcpdump allow us to capture packets , then we can use it in analyziz ,we can save it in fie with extension .pcap
  • ** syntax :

$tcpdump [option] [argument such as file name with extension type]

 

example

may be say that you don’t have perrmission fot that

  • $ type su
  • $ tcpdump -i eth0   #network interface

  • making tcpdump files

◦ tcpdump -w test.pcap -i eth0

just after this make ls command and see that will make afile called  test.pcap

 

4- dhclient :

  • ** Function : Dynamic Host Configuration Protocol Client , what !!!

it  provides a means for configuring one or more network interfaces using the Dynamic Host Configuration Protocol

 

  • ** Syntax :

# dhclient [optiom] [argument]

 

example :
from abilities of dhclient that its can renews the ip address

  • ** su
  • ** dhclient eth0                #eth0 (my network interface)

 

 

5- nmap : (Short for network mapper)

  • $ Function :  nmap is a network exploration tool and security
  • $ used as port scanner , so what is the mean of port scanner !
  •  
  • $ Port scanner : A software program designed to go through a large listing of interesting ports or all available network ports and probe each port to see if it is available or open and accepting packets.

 

I am not good an asecurity guy so I am not good at this point , but let’s do some with this

 

  • example :

 

notice PORT and STATE .

 

 

6- telnet :

Function : we can use telnet tool to connect to another remote computer .

  • Syntax :

# telnet  [ server name for example ]

this will ask u for >>

                                    username :

                                    password :

 

 

7- ssh : ( secure shell )

  • # Function : is an encrypted protocol and associated program intended to replace telnet . It can also be used for creating secure tunnels .
  • # Syntax :

# ssh [ server name for example]

 

8- minicom

  • # Function : used to connect to serial device such as router and servers such as cisco router for example .

           #  Syntax  :

 minicom >>>> make connection with default serial device

minicom -s Edit minicom settings

 

 

9- ftp : ( file transfer protocol )

  • ** Function : is commonly used for copying files to and from other computers. These computers may be at the same site or at different sites thousands of miles apart.
  • ** Syntax :

$ftp [option] [host]

when type this this will open a shell begin with ftp> we can make ftp command

 

  • this is the list of available command for ftp

 

5

10 – wget : File download utility for Linux systems

  • ** Function : is a file download utility for the command line. It can be used to download files via HTTP and FTP protocols. In the above example, a file is downloaded from a

remote HTTP system and saved in the current directory.

  • ** Syntax :

examples

▪                     wget http://%5BHOST/FILE%5D

▪                     wget ftp://[HOST/FILE]

 

 
Leave a comment

Posted by on March 18, 2012 in Featured, Linux, Networks

 

Tags: , , , , , , , , , ,