Sunday, December 26, 2010
نرم افزار VirtualBox
Sunday, December 19, 2010
مختصری راجع به yum
Saturday, December 18, 2010
پرینت از طریق سرویس پرینت ویندوز
اتصال به شبکه های ویندوز
Wednesday, December 15, 2010
نرم افزار FileZilla
نرم افزار SeaMonkey
Tuesday, December 14, 2010
مشکل در اجرای TrueCrypt
اضافه کردن کاربر جدبد به لیست sudoers
غیر فعال کردن SELinux
Monday, November 8, 2010
چگونه نرم افزار های نصب شده توسط wine را حذف کنیم
Sunday, November 7, 2010
نصب MATLAB
Saturday, November 6, 2010
برنامه ای که تمام فایل های صوتی تصویری را اجرا می کند!
$> 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دریافت فایل از طریق
yum استفاده از پروکسی در
اضافه کردن زبان فارسی
java نصب
yum خطا در اجرای
Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. Please verify its path and try again
80.239.156.215 mirrors.fedoraproject.org
Thursday, June 17, 2010
Math Parser
here is the code or this is another link to download.
and recently I submitted the code here.
Friday, May 7, 2010
Demand note database application
Saturday, May 1, 2010
How to use an sql query result
using System.Data;
using System.Data.SqlClient;
///
///
///
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
$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
Monday, March 8, 2010
PWM speed control (pic18f4550)
#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)
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)
#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)
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)
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
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#
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
Saturday, February 27, 2010
hiddemo.exe and OScope.exe
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
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
LED Blink pic18f4550
#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
}
}
LED Blink pic16f84a
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
Friday, February 19, 2010
how to run your webcam
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
Wednesday, January 20, 2010
Friday, January 15, 2010
Installing Grub
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
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!
Compiling Kernel
make
make modules
make modules-install
mkinitrd -o /boot/initrd.img-(...)
make install
update-grub
Adding Windows to grub
root (hd0,0)
savedefault
makeactive
chainloader +1
or
menuentry "Windows XP" {
set root=(hd0,3)
chainloader +1
}