Sunday, December 26, 2010

نرم افزار VirtualBox

این نرم افزار برای نصب سیستم عامل به صورت مجازی می باشد. که البته دریافت آن از سایت شرکت تهیه کننده مقدور نیست ولی می توانید از اینجا دریافت کنید.

Sunday, December 19, 2010

نرم افزار FatRat

نرم افزاری مناسب برای دریافت فایل که دارای سرعت قابل قبولی است.
 yum install fatrat

مختصری راجع به yum

برای جستجو بدنبال کلمه ای خاص میان بسته ها:
yum search any-package
برای نصب بسته:
yum install any-package
برای حذف بسته:
yum remove any-package
برای اطلاع از وضعیت یک بسته:
yum info any-package

Saturday, December 18, 2010

پرینت از طریق سرویس پرینت ویندوز

برای اتصال به windows printer server از طریق لینوکس و استفاده از سرویس samba به صورت زیر عمل می کنیم.
ابتدا سرویس cups را از طریق مرورگر وب باز می نماییم. که آدرس آن http://localhost:631می باشد.
سپس بر روی تب administration  و استفاده از add printer و استفاده از نام کاربری root و کلمه عبور کاربر ریشه مراحل بعد را انجام می دهیم.
گزینه Windows Printer via SAMBAرا انتخاب می کنیمو به مرحله بعد می رویم.
در قسمت connection آدرس را به صورت زیر وارد می نماییم. 
smb://workgroup/username:password@pserver/HP Laser Black_site
به پرینتر اضافه شده نامی اختصاص می دهید.
حال مدل پرینتر مورد نظر را انتخاب می کنید.
حال بر روی query printer for default options  کلیک می کنید.

اتصال به شبکه های ویندوز

بعد از نصب سرویس samba برای اتصال به شبکه های اشتراک فایل ویندوز باید تنظیمات firewall را تغییر داد برای این کار از مسیر System>Administration>Firewall فایروال را اجرا می نماییم و دو گزینه samba,samba clientرا تیک می زنیم و apply می کنیم

Wednesday, December 15, 2010

نرم افزار FileZilla

یک نرم افزار بسیار ساده و قدرتمند برای FTP که می توانید این نرم افزار را از طریق اجرای خط زیر نصب نمایید.
yum install filezilla

نرم افزار SeaMonkey

نرم افزاری کامل و چند منظوره برای استفاده از اینترنت از سرویس پست الکترونیکی گرفته تا چت و حتی ویرایش و ساخت صفحات web به صورت WYSIWYG این نرم افزار که توسط شرکت mozilla حمایت می شود را می توانید با استفاده از اجرای دستور زیر نصب نمایید.
yum install seamonkey

Tuesday, December 14, 2010

مشکل در اجرای TrueCrypt

در هنگام اولین اجرای این برنامه از ما خواسته می شود که requirettyرا غیر فعال کنیم که این عمل به صورت زیر انجام می شود.فایل /etc/sudoers / را باز کرده و Defaults    requirettyرا پیدا کرده و جلوی آن علامت #را قرار دهید.

اضافه کردن کاربر جدبد به لیست sudoers

بعضی از برنامه ها از جمله نرم افزار TrueCryptبرای انجام بعضی عملیات نیازمند آن هستند که کابر بتواند از دستور sudoاستفاده کند یا به بیان دیگر کاربر در لیست sudoersباشد که این کار از طریق زیر صورت می گیرد.
ابتدا فایل /etc/sudoersرا باز کرده و خط زیر را به خط بعد از معادل آن برای کاربر rootاضافه کنید.
mahyar  ALL=(ALL)       ALL

غیر فعال کردن SELinux

از آنجایی که این برنامه قدرتمند برای کاربران عادی مفید نمی باشد لذا روش غیر فعال کردن آن در زیر بیان شده است.
ابتدا فایل تنظیمات SELinux را باز کرده و enforcingرا به disabled تغییر دهید.
SELINUX=disabled

Monday, November 8, 2010

چگونه نرم افزار های نصب شده توسط wine را حذف کنیم

برای این کار تنها کافی است دستور زیر را اجرا نمایید سپس یک صفحه همانند add/remove ویندوز ظاهر میشود که در آنجا برنامه های نصب شده لیست شده اند.
>>wine uninstaller

Sunday, November 7, 2010

نصب MATLAB

در ابتدا باید مت لب ویژه ی لینوکس را دریافت نماییم که برای دریافت این نرم افزار به صورت رایگان به آدرس زیر مراجعه کنید :
warez-bb.org

ابتدا باید فایل کتابخانه ای زیر را نصب کنید:
yum install libXp.so.6

حال به دستورات فایل install.txt موجود در پوشه ی crack عمل نمایید.

Saturday, November 6, 2010

برنامه ای که تمام فایل های صوتی تصویری را اجرا می کند!

برنامه معروف vlc چنین کاری را برای شما انجام می دهد که نحوه نصب به این ترتیب است:
$> su -
#> rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
#> yum install vlc
#> yum install mozilla-vlc (optionnal)


WINE نحوه کامپایل

ابتدا باید یک سری فایل که برای کامپایل کردن به آنها نیاز است را نصب کنید:
yum install alsa-lib-devel.i686 alsa-lib-devel audiofile-devel.i686 audiofile-devel cups-devel.i686 cups-devel dbus-devel.i686 dbus-devel esound-devel.i686 esound-devel fontconfig-devel.i686 fontconfig-devel freetype.i686 freetype-devel.i686 freetype-devel giflib-devel.i686 giflib-devel hal-devel.i686 hal-devel lcms-devel.i686 lcms-devel libICE-devel.i686 libICE-devel libjpeg-turbo-devel.i686 libjpeg-turbo-devel libpng-devel.i686 libpng-devel libSM-devel.i686 libSM-devel libusb-devel.i686 libusb-devel libX11-devel.i686 libX11-devel libXau-devel.i686 libXau-devel libXcomposite-devel.i686 libXcomposite-devel libXcursor-devel.i686 libXcursor-devel libXext-devel.i686 libXext-devel libXi-devel.i686 libXi-devel libXinerama-devel.i686 libXinerama-devel libxml2-devel.i686 libxml2-devel libXrandr-devel.i686 libXrandr-devel libXrender-devel.i686 libXrender-devel libxslt-devel.i686 libxslt-devel libXt-devel.i686 libXt-devel libXv-devel.i686 libXv-devel libXxf86vm-devel.i686 libXxf86vm-devel mesa-libGL-devel.i686 mesa-libGL-devel mesa-libGLU-devel.i686 mesa-libGLU-devel ncurses-devel.i686 ncurses-devel openldap-devel.i686 openldap-devel openssl-devel.i686 openssl-devel zlib-devel.i686 pkgconfig sane-backends-devel.i686 sane-backends-devel xorg-x11-proto-devel glibc-devel.i686 prelink fontforge flex bison libstdc++-devel.i686 pulseaudio-libs-devel.i686 gnutls-devel.i686 libgphoto2-devel.i686 openal-soft-devel openal-soft-devel.i686 isdn4k-utils-devel.i686 gsm-devel.i686 samba-winbind libv4l-devel.i686 cups-devel.i686 libtiff-devel.i686 gstreamer-devel.i686
 
حال در این قسمت دستورات زیر را اجرا کنید:
./configure
make
make install

Thursday, November 4, 2010

Bluetoothدریافت فایل از طریق

برای اینکار ابتدا مرورگر فایل خود را باز کرده به صفحه ی خانگی خود رفته و سپس به پوشه ی Downloads بروید در پایین address bar دکمه ای با عنوان launch preferences مشاهده میکنید بر روی آن کلیک کنید در صفحه ای باز می شود تنظیمات دلخواه را برای دریافت فایل از طریق Bluetooth در بخش recieve files over bluetoothانجام دهید.

yum استفاده از پروکسی در

برای اینکار باید چند خط زیر را به فایل etc/yum.conf/ اضافه کنید : 

# The proxy server - proxy server:port number 
proxy = http://yourproxy:8080
# The account details for yum connections 
proxy_username=نام کاربری
proxy_password=کلمه عبور

اضافه کردن زبان فارسی

برای اینکار از منوی system -> keyboard تب layouts را انتخاب می کنیم و سپس بر روی دکمه add  کلیک می کنیم و سپس iran  را انتخاب می کنیم.

java نصب

برای نصب جاوا و در نهایت اجرای نرم افزار سودمند  YourFreedomچنین می کنیم :

yum install  java-1.6.0-openjdk java-1.6.0-openjdk-plugin

و برای اجرای YourFreedom از دستور java -jar استفاده می کنیم .

yum خطا در اجرای

Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. Please verify its path and try again

برای اینکار باید فایل های /etc/yum.repos.d/fedora.repo و /etc/yum.repos.d/fedora-updates.repo را تغییر دهید ابتدا علامت #  را از جلوی baseurl برداشته و به جلوی mirrorlist منتقل نمایید سپس خطوط زیر را به فایل /etc/hosts اضافه نمایید:

80.239.156.215          mirrors.fedoraproject.org
213.129.242.84          mirrors.rpmfusion.org

اجرای نرم افزار ها از طریق کاربر ریشه

اجرای مرورگر فایل :
$su -
#nautilus


Thursday, June 17, 2010

Math Parser

This program is a simple calculator with a math parser class which is written in c# .
here is the code or this is another link to download.
and recently I submitted the code here.

Friday, May 7, 2010

How to print datagridview

here is the c# code which really helps you.

Demand note database application

this application was written in Farsi language.here is the C# code plus its compiled files.I used access database.here is the screenshots:

Saturday, May 1, 2010

How to use an sql query result

using System;
using System.Data;
using System.Data.SqlClient;

///
///
Demonstrates how to work with SqlConnection objects
///
class SqlConnectionDemo
{
static void Main()
{
// 1. Instantiate the connection
SqlConnection conn = new SqlConnection(
"Data Source=(local);Initial Catalog=Northwind;Integrated Security=SSPI");

SqlDataReader rdr =
null;

try
{
// 2. Open the connection
conn.Open();

// 3. Pass the connection to a command object
SqlCommand cmd = new SqlCommand("select * from Customers", conn);

//
// 4. Use the connection
//

// get query results
rdr = cmd.ExecuteReader();

// print the CustomerID of each record
while (rdr.Read())
{
Console.WriteLine(rdr[0]);
}
}
finally
{
// close the reader
if (rdr != null)
{
rdr.Close();
}

// 5. Close the connection
if (conn != null)
{
conn.Close();
}
}
}
}

Monday, April 26, 2010

Microsoft Access Essential Queries




Example 1:
Select * from customers

Example 2:
select * from customers where Country ='uk'

Example 3:
select City,Country from customers order by city

Example 4:
select City,Country from customers order by 1

Example 5:
select distinct City,Country from customers order by 1

Example 6:
Select Count(*) from Customers where Country ='uk

Example 7:
Select sum(Quantity) from[order details] where productid = 11

Example 8:
Select productid, sum(Quantity) as sum_qty from [Order Details] group by productid

Monday, April 5, 2010

LED Blink ATmega32

here is the bascom code :

$regfile = "m32def.dat"
$crystal = 8000000
Config Portd = Output
Do
Portd.6 = 0
Waitms 500
Portd.6 = 1
Waitms 500
Loop
End

pin10 ---> vcc
pin11 ---> gnd
pin20 ---> led+resistor(470 ohm)

Sunday, March 21, 2010

Linux Commands

to verify your pci hardwares : /sbin/lspci

Monday, March 8, 2010

PWM speed control (pic18f4550)

here is the ccs code:

#include <18f4550.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock = 20000000)
void main() {
unsigned int16 value;// Input variable
setup_adc_ports(ALL_ANALOG);// Input combination
setup_adc(adc_clock_internal);// ADC clock
set_adc_channel(0);// Select RA0
setup_ccp1(ccp_pwm); // Select timer and mode
setup_timer_2(T2_DIV_BY_16,248,1); // Clock rate & output period
while(1) {
value=read_adc();//Get input byte
set_pwm1_duty(value);// Set on time
}
}

everything is exactly same as previous post + a simple potentiometer which is connected to pin2.

here is the execution:

Driving a motor (pic18f4550)

you can use the information mentioned in previous post as the pic side program to increase or decrease the speed of a motor as an example. now I want to use ULN2003APG driver to drive a motor.

using ULN2003APG :

pin1 ---> MCU output
pin16 ---> Motor
pin8 ---> Motor GND and MCU GND

and connect vcc to the motor.we use mcu signal to connect gnd to the motor to run with separate vcc but common gnd.


PWM (pic18f4550)

to use pwm here is the ccs code:

#include <18f4550.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock = 20000000)

void main() {
setup_ccp1(ccp_pwm); // Select timer and mode
set_pwm1_duty(25); // Set on time
setup_timer_2(T2_DIV_BY_16,248,1); // Clock rate & output period
while(1) { } // Wait until reset
}

pin17 ---> pwm output
+ everything was mentioned in previous posts in order to run a 18f pic.

Friday, March 5, 2010

How to make a DVD (Advanced concepts)

sometime you download subtitles which are in sub/idx format which is not supported in DVD-Lab pro so you can do the following :

1. Use dvdsupdecode to convert the .sup file into a .txt file and several .bmp files,
with the -bitmap parameter and either the -pal or -ntsc parameter according to the
original DVD you demuxed the .sup file from

2. Open the .txt file in notepad, remove the lines at the start which are similar to the
following ones:

Code:

;Subpictures_20.sup
FrameRate=29.97
Palette=2010
Alpha=FFF0

and instead add a line like this one (depending on the original value indicated by
"Framerate="):

Code:

{29.97}

Also, do a couple global replaces to get rid of the { and } surrounding the subpicture
names, the easiest way is to replace {Sub with Sub and then bmp} with bmp.
Save the file with the ".sub" extension.

3. Load Subtitle Workshop, and open the .sub file you just save as a MicroDVD
subtitle file.

4. Save the file as a Spruce DVD Maestro .son file.

5. Open the saved .son file in Notepad. By default, the lines at the start will read:

Code:

st_format 2
Display_Start non_forced
TV_Type PAL
Tape_Type NON_DROP
Pixel_Area (0 573)
Directory

For NTSC only, change that to:

Code:

st_format 2
Display_Start non_forced
TV_Type NTSC
Tape_Type NON_DROP
Pixel_Area (2 479)
Directory

Also, further down, you'll find a couple of lines that read

Code:

Color (0 1 2 3)
Contrast (0 15 15 15)

Adjust those to match the original .txt file's "Palette=" and "Alpha=" entries, keeping
in mind that they go backwards. So, for our example

Code:

Palette=2010
Alpha=FFF0
becomes:
Code:
Color (0 1 0 2)
Contrast (0 15 15 15)

Save the .son file again with the changes.

6. Now you can import the .son subtitle file into DVD Lab Pro in the same way you
import .srt subtitles. Be sure to set the vertical margin to 0, and leave the "drop frame"
option unchecked (or the "non-drop frame" option checked, depending on whatever
the checkbox actually reads).

How to make a DVD (DVD-Lab pro)

1.make a new project and select "Normal (VTS Menu + Movie)" and select PAL.
2.Import converted files to your project their bitrates is better to be about 1200kbps.
3.from "connections" select "movie1" and add the imported video and audio which are now separated.
4.add your subtitle remember to choose proper script for its font.
5.sometimes you need to save *.sub as *.son (Spruce DVDMaestro) using subtitle workshop.
6.from menu select movie->Auto-Chapter and set 30 chapters for each movie.
7.now click on the "menu1" then select your background at the bottom of the page in the "background tab" and add some text and then right click on text and link it to first chapter of the movie.
8.you can compile your dvd and then burn it.

Tuesday, March 2, 2010

Hid Demo

finally I could find a library in order to work with usb very easily here is the library itself.
usb hid can be downloaded here which is written in c#.
usb pic side can be downloaded here which is made which ccs.

this code is not complete and is just for learning how to use usbLibrary. In order to use see the result :
pin2 ---> ADC
pin20 ---> led+resistor(470 ohm)
+ everything was mentioned in previous post in order to implement usb.
and this is the hid:

Monday, March 1, 2010

How to import dll C#

make a console project and paste the code.here is the code :

using System;
using System.Runtime.InteropServices;
class Example
{
// Use DllImport to import the Win32 MessageBox function.
[DllImport("user32.dll")]
static extern int MessageBox
(IntPtr hWnd, String text, String caption, uint type);
static void Main()
{
// Call the MessageBox function using platform invoke.
MessageBox(new IntPtr(0), "Hello, World!", "Hello Dialog", 0);
}
}

remeber the name MessageBox is unique entry in this dll.

The extern modifier is used to declare a method that is implemented externally. A common use of the extern modifier is with the DllImport attribute when using Interop services to call into unmanaged code; in this case, the method must also be declared as static

after execution :

Sunday, February 28, 2010

Where to download C#

I use Microsoft Visual C# 2008 Express Edition with SP1 which can be freely downloaded from here.


Saturday, February 27, 2010

hiddemo.exe and OScope.exe

this file is compatible with the example ex_usb_hid.c which is mentioned in ccs:
CCS DELPHI HOST DEMO

USB test with pic18f4550




just program .hex file to the chip the code was written in mcc18 :
Generic HID pic side
Generic HID pc side

USB

+5V
Data +
DATA -
GND

Friday, February 26, 2010

Lcd Hello World pic18f4550



here is ccs code :

#include <18f4550.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=4000000)
#include

void main() {
lcd_init();
lcd_putc("Hello!");
}

LCD pins D0-D3 are not used and PIC D3 is not used.

D0 enable
D1 rs
D2 rw
D4 D4
D5 D5
D6 D6
D7 D7

strange errors in ProgICD2

I prefer using mplab programmer itself but inorder to program pic 16f84 there is no other choice.

LED Blink pic18f4550

here is the code written in ccs :

#include <18f4550.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=4000000)

void main() {

while (TRUE) {
output_high(PIN_D1);
delay_ms(500);
output_low(PIN_D1);
delay_ms(500);
}
}

remeber to select PCH 16 bit to compile

pin1 ---> vcc
pin11 ---> vcc
pin12 ---> gnd
pin13 & pin14 ---> crystal + 20pf capacitor
pin20 ---> led+resistor(470 ohm)
pin31 ---> gnd
pin32 ---> vcc

Thursday, February 25, 2010

Lcd Hello World pic16f84a






here is the mikroC code:

// LCD module connections
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;

sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
// End LCD module connections

char *text = "Hello World"; //Constant holding text to be displayed

void main() //Main program
{
TRISB = 0; // PORTB is output
Lcd_Init(); // Initialize LCD connected to PORTB
Lcd_Cmd(_Lcd_CLEAR); // Clear data on lcd
Lcd_Cmd(_LCD_CURSOR_OFF); // Turn cursor off
while(1) //while loop, not necessarily needed
{
PORTA = ~PORTA;
Lcd_Out(1, 1, text); // Print text to LCD, 2nd row, 1st column
}
}

datasheet

pic18f4550
pic16f84
ULN2003APG
LCD 2x8

LED Blink pic16f84a

here is the mikroC code :

void main() {
PORTB = 0;
TRISB = 0;
while (1) {
PORTB = ~PORTB;
Delay_ms(100);
}
}

and

pin4 ---> vcc
pin5 ---> gnd
pin9 ---> led+resistor(470 ohm)
pin14 --->vcc
pin15 & pin16 ---> crystal + 20pf capacitor

Tuesday, February 23, 2010

cant read--- .ICEauthority

sudo chown username /home/username/.ICEauthority

Friday, February 19, 2010

how to run your webcam

Skype

Go to main menu, System, Preferences, Menus: Applications, Internet, Items: Skype, Properties, and replace the Command with

bash -c 'LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype'

Thursday, January 21, 2010

Free Software

this article is written in farsi:
Freedom

Wednesday, January 20, 2010

Timer

This is a simple timer for whom are busy with downloading files all day long and they want to control everything automatically
Download

Friday, January 15, 2010

Installing Grub

1.insert Live CD
2.sudo grub
3.find /boot/grub/stage1
4.root "the result of previous"
5.setup (hd0)
6.quit

Upgrading Alsa

Installation :


To do this, we must begin by determining our version of alsa as follows :



cat /proc/asound/version

Advanced Linux Sound Architecture Driver Version 1.0.20.


To avoid problems during the upgrade of Alsa-utils, we need to stop it with the following command :


sudo /etc/init.d/alsa-utils stop


We must then install the necessary tools to compile along with the kernel headers :

sudo apt-get -y install build-essential ncurses-dev gettext xmlto

sudo apt-get -y install linux-headers-`uname -r` libncursesw5-dev


Then, we go in our personal folder and download alsa-driver, alsa-lib and alsa-utils :


cd ~

rm -rf ~/alsa* ~/.pulse*

wget ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.21.tar.bz2

wget ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.0.21a.tar.bz2

wget ftp://ftp.alsa-project.org/pub/utils/alsa-utils-1.0.21.tar.bz2


After that, we create a new folder for the compilation and
installation of the 3 files. Then, we move the 3 tar files that we just
downloaded in this folder :


sudo rm -rf /usr/src/alsa

sudo mkdir -p /usr/src/alsa

cd /usr/src/alsa

sudo cp ~/alsa* .


Unpack the 3 tar files :


sudo tar xjf alsa-driver*

sudo tar xjf alsa-lib*

sudo tar xjf alsa-utils*


We compile and install alsa-driver :


cd alsa-driver*

sudo ./configure

sudo make

sudo make install


We compile and install alsa-lib :


cd ../alsa-lib*

sudo ./configure

sudo make

sudo make install


We compile and install alsa-utils :


cd ../alsa-utils*

sudo ./configure

sudo make

sudo make install


If like me, you got this error during the last “sudo ./configure” :


checking form.h presence... yes

checking for form.h... yes

checking for new_panel in -lpanelw... no

configure: error: panelw library not found


You will need to add those symbolics links (only if you got the error) and restart the installation from the last “sudo ./configure” :


sudo ln -s libpanelw.so.5 /usr/lib/libpanelw.so

sudo ln -s libformw.so.5 /usr/lib/libformw.so

sudo ln -s libmenuw.so.5 /usr/lib/libmenuw.so

sudo ln -s libncursesw.so.5 /lib/libncursesw.so


Then, we remove the 3 tar files in our personal folder that are not anymore necessary :


rm -f ~/alsa-driver*

rm -f ~/alsa-lib*

rm -f ~/alsa-utils*


Then, just restart your computer and your alsa version should be 1.0.21!


You can verify that you have now indeed have this version of alsa :


cat /proc/asound/version

Advanced Linux Sound Architecture Driver Version 1.0.21.

Compiled on Oct 15 2009 for kernel 2.6.31-14-generic (SMP)


Just to be sure everything is well configured, execute this command :


sudo alsaconf


and reboot again!


Installing rpm on deb base

sudo alien -k file_name.rpm

Compiling Kernel

make menuconfig
make
make modules
make modules-install
mkinitrd -o /boot/initrd.img-(...)
make install
update-grub

Adding Windows to grub

title Microsoft Windows XP Home Edition
root (hd0,0)
savedefault
makeactive
chainloader +1

or

menuentry "Windows XP" {
set root=(hd0,3)
chainloader +1
}

Wednesday, January 13, 2010

First Post

this is my first post I hope you enjoy reading it!