زکات علم

زَکاةُ العِلمِ أن تُعَلِّمَهُ عِبادَ اللّه‏ِ امام باقر (ع)
زکات علم

مطالبی در زمینه کامپیوتر و علاقه مندی های شخصی من مطالب این وبلاگ غالبا مطالبی ست که در جای جای اینترنت کتاب یا دانشته های شخصی خودم می باشد که به عنوان مرجعی برای رجوع دوباره در اینجا جمع آوری شده اند .
ehsunitd.ir personal website

پیوندها

CentOS Samba 4 - Active Directory Domain Controller

 

With the recent stable release of Samba 4, it is possible to create a compatible Active Directory Domain Controller that runs on the Linux platform. Samba 4 has been in beta for years now, but with the stable release as of December 11, 2012 you should now have a compelling argument for implementing Samba into your enterprise IT network. Samba 4 is a complete re-working of the Samba code and to sum it up best is to simply quote from the Samba 4 website:

“Samba 4 is available for download via the Samba Website or from the Git repository. In short, you can join a Windows (all recent releases should be supported) machine to a Samba 4 domain, and it will behave much as it does in AD, including Kerberos domain logins where applicable. The official press release can be found on theSamba website.”

 

  • ehsan gholami

Y} Faux Capiz Shell Pendant

 
 
A couple weeks ago I showed you the crystal globe pendant I hung in Ellie's room.  Since there isn't an overhead light in her room, the pendant is a nice way to give the illusion of a fun light fixture without the expense and hassle of running wires and installing one.

Ada's room is the same, with no overhead light, and I wanted to hang something above her chair too.  I'd been seeing a lot of faux capiz shell chandeliers around and decided that was the way I wanted to go.  As for the look, I liked the layered look of this real capiz chandelier from West Elm:
 

I also liked the draped top of this beaded chandelier:
 

I set out to combine the two looks by constructing a frame out of the top of an old lampshade, metal craft rings, and clear hanging wire.
 

I used four rings total, in descending size order.  It's important to measure the hanging wire carefully and space them equally apart to get the rings to hang level.  To be honest, this step was a little more tedious than I thought it would be.

For the top, I used the smallest size craft ring and hung it about a foot above the largest ring.  I cut a wooden skewer to the diameter of the top ring, hot glued a metal rope to the center, then hot glued the sides of the skewer to the ring.
 
 
Once the frame was done, it was time to make those fake little capiz shells.  I tore sheets of wax paper about 15" long, stacked three on top of each other, and used a hot iron to bond them together.  It only takes a few seconds to iron each stack of wax paper.  I used about two boxes worth of wax paper and had around 20 finished sheets.  Then I used a circle punch to punch out the "shells."
 
Here are the tips I learned along the way.  Hold 4-5 finished sheets together to punch at one time.  Otherwise the punch sticks and rips the paper (plus it goes faster!).  Don't punch too close to the edge or the punch kind of sticks too.  I would punch a row of shells and then use a paper cutter to slice off the bottom and then do another row, and so on.  The paper cutter was much easier and quicker than cutting the punched edges with scissors.
 
After I had a pile of the fake capiz shells, I threaded my sewing machine with white thread and used the same technique as I did for the circle garland to sew them together.  It takes a little time but with the number of shells I had, sewing was much quicker than laying them all out and hot gluing them together with thread (I've seen it done this way).  I was left with ribbons and ribbons of faux capiz shells.
 
 
I hung the frame from a curtain rod and started attaching the shells on the largest ring first.  I cut strips of five shells, put a dab of hot glue on the top shell or second from the top and then folded the top shell over the ring and pressed together with the next one to hang the strip from the ring.
 
 
 
I continued all the way around until the whole ring was covered then continued with the remaining smaller rings, adjusting the length each time to get the look I wanted.
 
For the top part, I glued a fake shell to the top shell on the largest ring, then held up the string of shells to determine the length, cut it to size, and glued it to the top.  You want to consider spacing here so it looks neat when finished.  I worked in quarters at a time.
 
 
When it was all finished I added an anchor and hook to the ceiling in Ada's room and put the new faux capix pendant in place.  
 
 
I could easily convert this into an actual light someday if we wind up in a house that has hard wired ceiling lights.  But for now, I love the soft, whimsical interest it adds to Ada's room. 
 
 
 
 
Full disclosure here, this was not a quick project.  Between making the frame, the fake capiz shells, and putting it all together it took me several days.  But, for me, it was totally worth the effort!
  • ehsan gholami
 
 
How to Enable or Disable the Built-in Elevated Administrator Account in Windows 7
 
information   Information
This tutorial will show you how to enable or disable the built-in elevated Administrator account in Windows 7.
 
Note   Note
Standard user (Users) - The standard account is an unelevated restricted users account. It can help protect your computer by preventing users from making changes that affect everyone who uses the computer, such as deleting files that are required for the computer to work. It is recommend to create a standard account for each user instead of an administrator account for the user. When you are logged on to Windows with a standard account, you can do almost anything that you can do with an administrator account, but if a standard user wanted to do something that requires elevated rights that affects other users of the computer, such as installing software or changing security settings, Windows will give the standard user a UAC prompt to enter the password of an administrator account for approval and confirmation before allowing the action.

administrator user - Is an unelevated administrator account that is created by default during the installation of Windows 7, or is already setup or you on a OEM (ex: Dell) computer. An administrator account has complete access to the computer, and can make any desired changes. To help make the computer more secure, this administrator account type will be prompted by UAC by default to give confirmation before allowed to make any changes that require elevated administrator rights. Such as those that affect the system, other users, or when running anything elevated (Run as Administrator) since running elevated will allow it to have access to the entire computer.

Built-in "Administrator" - Is the hidden elevated administrator account that has full unrestricted access rights and permission on the computer. By default, this elevated "Administrator" account is not prompted by UAC by default to provide confirmation before allowed to make any changes that requireelevated administrator permissions since it is an elevated account. 

 
warning   Warning
If you enable the built-in Administrator account, then it is recommended to create a password for better security.

For additional security purposes, it is also not recommended to leave the built-in Administrator account always enabled, or to use it for everyday purposes.

 


  • ehsan gholami

این روزها تب لاغری و کاهش وزن خیلی تند است و در این میان افرادی که لاغرند و می‌خواهند چند کیلویی چاق شوند فراموش می‌شوند. اگر در این بخش در ارائه‌ی مطلب به این عزیزان تأخیر یا کوتاهی شده است عذرخواهی ما را بپذیرید.

برای افرادی که چاق هستند لاغر شدن کار آسانی نیست و برای افرادی که لاغرند و دوست دارند چند کیلویی اضافه وزن داشته باشند قضیه کاملاً برعکس است و چاق شدن کار راحتی نیست.

اساساً زندگی یعنی تلاش برای رسیدن به خواسته‌ها هر چند هم که سخت باشند.

برای اینکه چاق شوید و به اندام ایده‌آل خود نزدیک شوید در گام اول باید صبور باشید و به تغذیه‌ی خود اهمیت ویژه ای بدهید. حتماً شما هم از اطرافیانتان توصیه های گوناگونی برای چاق شدن شنیده‌اید. اصلی‌ترین و مهم‌ترین توصیه ما برای شما این است که زیاد غذا بخورید و حسابی ورزش کنید. برای چاق شدن رژیم غذایی درست و ورزش از اهمیت بالایی برخوردار است. برای آشنایی با توصیه های دیگر ما مطالعه‌ی این مطلب را از دست ندهید.

  • ehsan gholami

«1» port چیست‌؟                                                                                                                                                              فهرست مطالب

بطور کلی هر کامپیوتر  ( به ازای هر کارت شبکه اش ) یک IP دارد، که از طریق این IP‌ می توان به ماشین فوق دسترسی پیدا نمود. این آدرس ( IP ) به 653535 پورت ( PORT ) تقسیم می شود. PORT یک مفهوم منطقی است که به کمک آن می توان بطور همزمان با چندین ماشین دیگر، ارتباط برقرار نمود.

PORT ها به دو گروه رزرو شده (پورت های بین 1 تا 1024) و غیر رزرو شده (سایر پورت ها) تقسیم می شوند. پورت های رزرو شده برای کاربردهای استاندارد مورد استفاده قرار می گیرند. مانند :

 

USAGE

PORT NUMBER

SMTP

25

HTTP

80

POP

110

News Server

119

 

 

در برنامه های Server/ Client از PORT های غیر رزرو شده که آزاد باشند ( مورد استفاده سایر برنامه ها نباشند) می توان جهت برقراری ارتباطات مورد نیاز، استفاده نمود. یعنی می تواند به ازای هر پورت با یک برنامه ارتباط برقرار کند.

 

TCP or UDP Port

 

======================================

«2» socket چیست؟                                                                                                                                                          فهرست مطالب

سوکت یک ارتباط قابل اطمینان جهت انتقال داده ها بین دو host (ماشین مورد نظر) می باشد. سوکت، برنامه نویسان را از پیچیده گی های فرآیند برقراری ارتباط بین دو ماشین مانند جزئیات کد کردن بسته ها، فرآیند ارسال داده ها در شبکه، ارسال مجدد بسته های خراب و ... دور می سازد و برنامه نویسان به راحتی قادر به توسعه برنامه ها یتحت شبکه می باشند.

یک سوکت در حقیقت ترکیبی از IP یا  HostName و یک شماره پورت ( Port Number ) از آن IP می باشد.

بطور کلی یک سوکت چهار عمل اصلی زیر را انجام می دهد:

    «1» اتصال به ماشین راه دور

    «2» ارسال داده ها

    «3» دریافت داده ها

    «4» بستن یا خاتمه اتصال

توجه به این نکته مهم می باشد که یک سوکت در یک زمان فقط قادر است تا فقط با یک ماشین (host) ارتباط برقرار کند.

با توجه به تعاریف فوق، می توان به راحتی تفاوت PORT و SOCKET‌ را درک نمود.

======================================

   «3» پروتکل Transmission Control Protocol )    TCP )                                                                                                              فهرست مطالب

پروتکلی برای انتقال داده ها (سرویس ها) بین دو ماشین با ضریب اعتماد بالا می باشد. چنین ارتباطی (بین دو نقطه) را Unicast می نامند. ‌ TCP پروتکل اتصال گرا ( Connection - Oriented ) است یعنی ارتباط برقرار شده بین کلاینت و سرور تا پایان روند انتقال اطلاعات باقی می ماند. این پروتکل در مواردی که اطمینان از انتقال صحیح داده ها بین مبدا و مقصد بسیار مهم است ( مانند زمان دانلود کردن داده ها) مورد استفاده قرار می گیرد. در چنین حالتی کامپیوتر مقصد با دریافت صحیح هر بسته از مبدا یک Acknowledgment‌ به منظور اطلاع از دریافت صحیح و بی عیب به ماشین مبدا ارسال می کند. اگر پیغام اعلام وصول فوق به مبدا نرسد، مبدا دوباره بسته را ارسال می کند.

======================================

   «4» پروتکل User Datagram Protocol )    UDP )                                                                                                                       فهرست مطالب

پروتکل فوق یک پروتکل بدون اتصال (Connection - Less) می باشد. این پروتکل امکان توزیع داده ها را با سرعت بالا تضمین می کند، ولی هیچ تضمینی در جهت صحت ارسال داده ها و دریافت آنها توسط ماشین مقصد ارائه نمی دهد. بر اساس شرایط این پروتکل اگر در روند انتقال اطلاعات مشکلی پیش آید و بسته ارسال شده به صورت کامل به مقصد نرسد،بسته فوق مجددا برای کامپیوتر مقصد ارسال نخواهد شد.

«نکته» از پروتکل فوق به منظور انتقال داده ها به چندین ماشین با استفاده از BroadCast‌ و یا MultiCast استفاده می شود.

به عنوان مثال، در سایتهایی که اقدام به پخش موسیقی از طریق اینترنت می نمایند، از این پروتکل استفاده می شود. در بعضی لحظات در حین گوش دادن به موسیقی متوجه قطع و وصل شدن یا مکث در پخش موسیقی می شویم. علت این امر نرسیدن یک یا چند بسته از بسته های ارسالی می باشد.

======================================

«5» تفاوت serverSocket و datagramSocket چیست؟                                                                                                             فهرست مطالب

بسته به نوع برنامه ای که ایجاد می کنیم، می توان از datagramSocket‌ یا  serverSokect استفاده نماییم. اگر برنامه ما بر مبنای پروتکل UDP باشد ازdatagramSocket‌  و اگر بر مبنای پروتکل TCP باشد از serverSokect استفاده می کنیم. همانطور که گفته شد، پروتکل TCP جهت ارسال داده ها همراه با تضمین موفقیت آمیز بودن عمل انتقال مانند دانلود و از پروتکل UDP جهت ارسال داده ها با سرعت بالا، اتصال به چند ماشین به طور همزمان و بدون تضمین موفقیت آمیز بودن عمل انتقال مانند کاربردهای RealTime‌  از جمله ویدئو کنفرانس، Internet TV و ... استفاده می شود.

هر دو Socket فوق در سمت ماشین سرور ایجاد می شوند. زمانی که یک ماشین سرور بخواهد از طریق یکی از پورتهایش منتظر رسیدن درخواست اتصال یک کلاینت شود (  در اصطلاح در حال Listen کردن است) ابتدا باید یک سوکت از یکی از نوع های فوق ایجاد کند. سپس پورت مورد نظر را به آن متصل ( Bind ) نموده و به حالت انتظار فرو می رود.

 «نکته» اگر شماره پورتی که می خواهیم با serverSocket مورد نظرمان Bind‌ کنیم، توسط سوکت دیگری در حال استفاده باشد، با پیغام خطای زیر مواجه می شویم.

java.net.BindException

======================================

   «6» بررسی روند برقراری ارتباط بین کلاینت و سرور                                                                                                                   فهرست مطالب 

در برنامه های کلاینت/سروری یا اصطلاحا برنامه نویسی تحت Socket‌ در جاوا، روند برقراری ارتباط بین برنامه کلاینت و برنامه سرور بصورت زیر می باشد:

«1» ابتدا برنامه سرور بر روی ماشین خود اجرا شده و پورتی که در برنامه جهت دریافت درخواست های کلاینت تعیین گردیده است، گوش می دهد. همانطور که گفته شد در این مرحله، برنامه سرور باید یک سوکت از نوع serverSocket یا datagramSocket‌ ایجاد نماید.

«2» برنامه کلاینت اجرا شده و با توجه به IP‌ یا HostName‌ سرور و شماره پورتی که سرور به آن گوش می دهد، درخواستی را به سمت سرور و به جهت برقراری ارتباط ارسال می کند.

ارتباط بین کلاینت و سرور

«3» در این مرحله برنامه سرور درخواست کلاینت را از پورت مشخص شده، دریافت می نماید و اگر همه چیز خوب پیش رود و کلاینت مورد تایید سرور قرار بگیرد، برنامه سرور ابتدا یک پورت دیگر را از سمت ماشین سرور به طور خودکار انتخاب کرده و بر اساس آن یک سوکت جدید ایجاد می کند و به برنامه کلاینت اختصاص می دهد.

ارتباط بین کلاینت و سرور

«4» برنامه کلاینت نیز در ماشین کلاینت یک سوکت بر اساس پورتی که از طریق آن با سرور ارتباط برقرار نموده، ایجاد می کند.

پس از انجام چهار مرحله فوق، یک ارتباط دو طرفه که در هر یک از دو سر آن یک سوکت قرار دارد، بوجود آمده و دو برنامه قادر به برقراری ارتباط با یکدیگر می باشد.

«نکته»  در زمان ایجاد سوکت در برنامه کلاینت، نیازی نیست که برنامه کلاینت پورتی با شماره یکسان نسبت به شماره پورت برنامه سرور انتخاب کند.

 

 

کلید واژه: 

برنامه نویسی سوکت ، Socket چیست ، کار با سوکت ها در جاوا ، ارتباط کلاینت ( Client ) و سرور ( Server ) از طریق سوکت ( Socket )

  

  • ehsan gholami

Setting up Code::Blocks and MINGW, A Free C and C++ Compiler, on Windows

Step 1: Download Code::Blocks

  • Go to this website: http://www.codeblocks.org/downloads
  • Follow the link to "Download the binary release" (direct link)
  • Go to the Windows 2000 / XP / Vista / 7 section
  • Look for the file that includes mingw in the name. (The name as of this writing was codeblocks-10.05mingw-setup.exe; the 10.05 may be different).
  • Save the file to your desktop. It is roughly 74 megabytes.

Step 2: Install Code::Blocks

  • ehsan gholami

Remove Empty Directories 2.2 نرم افزاری که با جستجوی در هارد دیسک شما فولدرهای خالی که در آن فایلی وجود ندارد را شناسایی میکند و برای لیستی از آنها را برای حذف در اختیار شما قرار میدهد. نرم افزا امکان جستجو در فولدرهای مخفی شده را نیز دارا میباشد

 

پسورد فایل فشرده : soft98.ir 

 

  • ehsan gholami

Method # 1: Find and delete everything with find command only

The syntax is as follows to find and delete all empty directories:

 
find /path/to/dir -empty -type d -delete
 

Find and delete all empty files:

 
find /path/to/dir -empty -type f -delete
 

Where,

  • -empty : Only find empty files and make sure it is a regular file or a directory.
  • -type d : Only match directories.
  • -type f : Only match files.
  • -delete : Delete files. Always put -delete option at the end of find command as find command line is evaluated as an expression, so putting -delete first will make find try to delete everything below the starting points you specified.

Method # 2: Find and delete everything using xargs and rm/rmdir command

The syntax is as follows to find and delete all empty directories:

 
## secure and fast version ###
find /path/to/dir/ -type d -empty -print0 | xargs -0 -I {} /bin/rmdir "{}"
 

OR

## secure but may be slow due to -exec  ##
find /path/to/dir -type d -empty -print0 -exec rmdir -v "{}" \;

The syntax is as follows to delete all empty files:

 
## secure and fast version ###
find /path/to/dir/ -type f -empty -print0 | xargs -0 -I {} /bin/rm "{}"
 

OR

 
## secure but may be slow due to -exec  ##
find . -type f -empty -print0 -exec rm -v "{}" \;
  • ehsan gholami
  1. background#edeeefurl('/images/background.png?1368816104');
  2. background-color#9092B0;
  3. background-imageurl(/assets/noise-4d7e90250411b8afcc688fd74d898542.png),-webkit-linear-gradient(-45deg, #8eb5df,#917386);
  4. background-imageurl(/assets/noise-4d7e90250411b8afcc688fd74d898542.png),-moz-linear-gradient(-45deg, #8eb5df, #917386);
  5. background-imageurl(/assets/noise-4d7e90250411b8afcc688fd74d898542.png),-o-linear-gradient(-45deg, #8eb5df, #917386);
  6. background-imageurl(/assets/noise-4d7e90250411b8afcc688fd74d898542.png),linear-gradient(-45deg, #8eb5df,#917386);
  7. box-shadowinset 0px 3px 0px 0px rgba(0,0,0,0.25);
  8. padding3em 0;
  • ehsan gholami

 آن زمان ها گذشت که چند نفر شریک دور هم جمع می شدند تا مغازه اجاره کنند و یک کار و بار راه بیندازند. این روزها فروشندگان در اولین قدم به جای اجاره مغازه، یک صفحه در اینستاگرام باز می کنند و در عرض چند روز کار جدیدشان را آغاز می کنند. کافی است این روزها سری به اینستاگرام بزنید تا با انبوهی از صفحات فروش محصولات مختلف روبرو شوید که با انواع تبلیغات سعی دارند مشتریان مختلفی را به سمت خود جلب کنند.

همین موضوع نشان می دهد با فراگیر شدن اینستاگرام، فرهنگ خرید و فروش تفاوت های چشمگیری کرده و فعلا هم فروشندگان از این اتفاق راضی هستند و هم خریداران.

  • ehsan gholami