Categories
Sponsors
Archive
Blogroll
Badges
Community
|
Posted in Sistem Analizi | No Comment | 8,823 views | 31/03/2009 21:11
Sistem Analizi dersinde Tamer Kepçeler hocamız ile redüktör projelendirmesi yaptıktan sonra sıra Servo Motor seçimine geldi. Acaba redüktöre göre servo motor seçimi nasıl yapılır? Bilmiyorum :) Araştıramadım henüz fakat aşağıdaki gibi bir formül var servo motor seçiminde:
P (kw)= (Moment X Hız)/9550
Moment’i Nm biriminden alıyorsunuz.
Hız dediğimiz ise motorun devri oluyor.
Böylece istediğiniz moment ve hıza sahip servo motorun ne kadarlık bir güce ihtiyacı olduğunu bulabilirsiniz. Bu arada unutmadan, az bir güçle çok bir güç elde edilmez :)
Posted in Virtual Machine Manager, Windows Powershell | 1 Comment | 7,554 views | 29/03/2009 23:27
You don’t need to use Data Protection Manager to backup your vhd files. You can use Windows Backup (with a little hack) or my method. It’s not a good method maybe, but it is easy to use and free. Just you need SCVMM Library to use this ps1 file. Now let’s see my codes:
1
2
3
4
5
6
7
8
9
10
11
12
13
| Add-PSSnapin -name # Microsoft.SystemCenter.VirtualMachineManager
Get-Vmmserver localhost
$VMName = $args[0]
SaveState-vm $VMName
$strVMHost = Get-VM $VMName | Get-VirtualHardDisk | Select-Object -Property VMHost
$strVMDisk = Get-VM $VMName | Get-VirtualHardDisk | Select-Object -Property Location
$VMHost = $strVMHost.VMHost
$VMDisk = $strVMDisk.Location
$VMLocation = $VMDisk | foreach {$_ -replace ":", "$"}
$VMPath = "\\$VMHost\$VMLocation"
$VMMPath = "\\scvmm.contoso.fabrikam.com\MSSCVMMLibrary\VHDs"
xcopy $VMPath $VMMPath
Start-vm $VMName |
Add-PSSnapin -name # Microsoft.SystemCenter.VirtualMachineManager
Get-Vmmserver localhost
$VMName = $args[0]
SaveState-vm $VMName
$strVMHost = Get-VM $VMName | Get-VirtualHardDisk | Select-Object -Property VMHost
$strVMDisk = Get-VM $VMName | Get-VirtualHardDisk | Select-Object -Property Location
$VMHost = $strVMHost.VMHost
$VMDisk = $strVMDisk.Location
$VMLocation = $VMDisk | foreach {$_ -replace ":", "$"}
$VMPath = "\\$VMHost\$VMLocation"
$VMMPath = "\\scvmm.contoso.fabrikam.com\MSSCVMMLibrary\VHDs"
xcopy $VMPath $VMMPath
Start-vm $VMName
As you can see, it’s really simple. First, I do “savestate-vm” then find vhd location and copy it to vmm library and finally do “start-vm”. $VMMPath is your SCVMM Library Path. That is just an example. Also you can add date to your vhd files name like win2008-01052009.vhd. But if you want to do that, you should use -replace for a second time. If you want to use this script, you just need to type “backup.ps1 VDS02”. Backup ps1 will save VDS02 and after backing up, will start it again.
You can add a cronjab for this script. It’s a good solution. You may need to change backup.ps1 file to backup all vm’s at the same time.
Posted in Sistem Analizi | No Comment | 3,345 views | 27/03/2009 22:36
Sistem analizi dersinde Tamer Kepçeler hocamızın verdiği değerler doğrultusunda, dişli çark üzerinde hacim hesabı yapılmıştır. Bulunan hacim, sınır değerlerini aşmayacak şekilde optimize edilerek ortaya koyulmaktadır. Matlab komutlarını aşağıda veriyorum.
Öncelikle ilk function dosyamızı yazalım.
1
2
| function f=GearObjFunct(x)
f=(x(6)*(x(3)+x(1)*x(3))/2+x(7)*(x(4)+x(2)*x(4))/2+40)*5*x(5)*(x(2)*x(4)*x(7)+50); |
function f=GearObjFunct(x)
f=(x(6)*(x(3)+x(1)*x(3))/2+x(7)*(x(4)+x(2)*x(4))/2+40)*5*x(5)*(x(2)*x(4)*x(7)+50);
Yukardaki function dosyasını GearObjFunct.m olarak kaydedelim. Diğer function dosyamız,
1
2
3
4
5
6
7
| function [C,Ceq]=GearNonLinConstr(x)
C(1)=(400/(x(3)*x(5)))-x(6)^2;
C(2)=(400*x(1)/(x(4)*x(5)))-x(7)^7;
C(3)=40-x(3)*x(6);
C(4)=60-x(4)*x(7);
C(5)=12-x(1)*x(2);
Ceq=[]; |
function [C,Ceq]=GearNonLinConstr(x)
C(1)=(400/(x(3)*x(5)))-x(6)^2;
C(2)=(400*x(1)/(x(4)*x(5)))-x(7)^7;
C(3)=40-x(3)*x(6);
C(4)=60-x(4)*x(7);
C(5)=12-x(1)*x(2);
Ceq=[];
Yukardaki function dosyasını ise GearNonLinConstr.m olarak kaydedelim. Şimdi gelelim hacmi verecek olan komutlara,
1
2
3
4
5
6
| x0=[2,1.5,14,17,20,0.5,1];
LBnd=[2,1.5,14,17,20,0.5,1];
UBnd=[4,5,20,23,60,2.5,3];
A=zeros(4,7);
b=[0,0,0,0];
[x,f]=fmincon('GearObjFunct',x0,A,b,[],[],LBnd,UBnd,'GearNonLinConstr') |
x0=[2,1.5,14,17,20,0.5,1];
LBnd=[2,1.5,14,17,20,0.5,1];
UBnd=[4,5,20,23,60,2.5,3];
A=zeros(4,7);
b=[0,0,0,0];
[x,f]=fmincon('GearObjFunct',x0,A,b,[],[],LBnd,UBnd,'GearNonLinConstr')
Peki X olarak verdiğimiz girdiler neler? Hemen onları vereyim.
X1 = Birinci kademe çevrim oranı
X2 = İkinci kademe çevrim oranı
X3 = Birinci kademe pinyon diş sayısı
X4 = İkinci kademe pinyon diş sayısı
X5 = Diş genişliği
X6 = Birinci kademe modülü
X7 = İkinci kademe modülü
GearObjFunct içersinde, dişli kutusunun hacmini verecek olan bağıntıyı yazdık. İkinci function dosyasında ise parametreler arasındaki bağıntıları belirttik. Belirttik çünkü parametreler birbirleriyle bağıntılı olduğu için, bir parametrenin değişmesi, diğer parametrelerinden de değişmesini sağlamalı. Yoksa herhangi bir şey belirtmemiş olsak, optimizasyon işlemi sırasında tek parametre değiştirilir, diğerleri ise sabit kalırdı. İşlemde ise LBnd ve UBnd ile X[Y] değerlerinin olması gereken sınırları belirttik. Örneğin X[1] değerinin 2 ile 4 arasında olmasını isteriz. Böylece optimizasyon da bu sınırlar arasında kalmış oldu. İyi çalışmalar..
Posted in Hosting & IIS7, Windows Server | No Comment | 5,540 views | 24/03/2009 09:16
Now what we did? First, we started with Bind Unattended Install, then we did MailEnable unattended install, now we are going to install PHP on IIS7 unattendedly. First, you should download php package (zip) and extract it to somewhere. Then you should make a batch file (.bat) to configure IIS7 Fastcgi support. My batch file:
1
2
3
4
5
6
7
| mkdir "C:\PHP"
xcopy /E "R:\PHP" "C:\PHP\"
setx Path "C:\PHP"
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/fastCGI /+[fullPath='c:\PHP\php-cgi.exe']
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers /+[name='PHP_via_FastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='c:\PHP\php-cgi.exe',resourceType='Unspecified']
%windir%\system32\inetsrv\appcmd set config /section:defaultDocument /+files.[value='index.php']
exit |
mkdir "C:\PHP"
xcopy /E "R:\PHP" "C:\PHP\"
setx Path "C:\PHP"
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/fastCGI /+[fullPath='c:\PHP\php-cgi.exe']
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers /+[name='PHP_via_FastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='c:\PHP\php-cgi.exe',resourceType='Unspecified']
%windir%\system32\inetsrv\appcmd set config /section:defaultDocument /+files.[value='index.php']
exit
As you see, first I copied php files from a source, then configured FastCgi support, after that I added index.php value for Default Document. My source is a network share but you can do whatever you want.
Note: You should use non-thread-safe zip package for fastcgi, for example “PHP 5.2.9-1 Non-thread-safe zip package”.
Posted in Windows Server | No Comment | 4,771 views | 24/03/2009 01:20
As you know Hyper-V supports VSS so you don’t need to shutdown or save state virtual machine when you want to backup them. But If want to backup virtual machines with Windows Server Backup utility, we need to do small registry trick. You should do some registry changes to support Hyper-V on Windows Server Backup. I created small reg files to do that:
1
2
3
4
5
| Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WindowsServerBackup]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WindowsServerBackup\Application Support]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WindowsServerBackup\Application Support\{66841CD4-6DED-4F4B-8F17-FD23F8DDC3DE}]
"Application Identifier"="Hyper-V" |
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WindowsServerBackup]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WindowsServerBackup\Application Support]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WindowsServerBackup\Application Support\{66841CD4-6DED-4F4B-8F17-FD23F8DDC3DE}]
"Application Identifier"="Hyper-V"
Save as HyperVBackup.reg then use this command to import:
1
| reg import "C:\HyperVBackup.reg" |
reg import "C:\HyperVBackup.reg"
You can find an article on Microsoft about backing up by Windows Server Backup (KB958662)
Posted in Hosting & IIS7, Windows Server | No Comment | 5,858 views | 23/03/2009 11:30
Today I learn, we can install MailEnable with Silent switch. I don’t know, it’s MailEnable feature or InstallShield feature (because Installshield has a silent switch) but It’s quite good for IT developers. You can install mailenable unattendedly with this command:
1
| mailenablestandart.exe /s /B |
mailenablestandart.exe /s /B
/s switch is Silent and /B switch is Batch Installation Mode. If you don’t use /B, you will prompt for some corfirmations. So you should you /B. But before installing MailEnable, you have to work on Registry. In that point, reg import command will be useful. If I finished test of unattended install, I’ll write the results.
Update: After testing of unattended install, I saw you have to do a registry trick before installation. New batch file:
1
2
3
4
5
6
7
8
| reg import "R:\Registry\MailEnable.reg"
"R:\MailEnable\mailenablestandard.exe" /s /B
net start "MailEnable List Connector"
net start "MailEnable Mail Transfer Agent"
net start "MailEnable POP Service"
net start "MailEnable Postoffice Connector"
net start "MailEnable SMTP Connector"
exit |
reg import "R:\Registry\MailEnable.reg"
"R:\MailEnable\mailenablestandard.exe" /s /B
net start "MailEnable List Connector"
net start "MailEnable Mail Transfer Agent"
net start "MailEnable POP Service"
net start "MailEnable Postoffice Connector"
net start "MailEnable SMTP Connector"
exit
I don’t why but after installation, you have to start services manually. So I did net start commands to start all services. Now let’s see our mailenable.reg file:
1
2
3
4
5
6
7
8
| Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Mail Enable]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mail Enable\Mail Enable]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mail Enable\Mail Enable\Services]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mail Enable\Mail Enable\Services\WEBMAIL]
"ApplicationType"="ASPX"
"Virtual Directory"=dword:00000001
"WebRoot"="IIS://localhost/w3svc/1/ROOT" |
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Mail Enable]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mail Enable\Mail Enable]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mail Enable\Mail Enable\Services]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mail Enable\Mail Enable\Services\WEBMAIL]
"ApplicationType"="ASPX"
"Virtual Directory"=dword:00000001
"WebRoot"="IIS://localhost/w3svc/1/ROOT"
If you use my reg file, MailEnable’s Webmail will be installed on “Default Web Site”. If you want to change it, you should change WebRoot.
Posted in Windows Server | 1 Comment | 7,203 views | 23/03/2009 10:56
Real nightmare! But I did it. After 6 hours, I finally did a deployment script for ISC Bind 9.6.0 release. As you know, bind has a setup.exe but you can’t use it with silent switch. So what should we do? Making MSI patch is a solution but be sure It isn’t working for Bind :) My deployment script:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| mkdir "C:\Windows\System32\dns"
xcopy /E "R:\Bind" "C:\Windows\System32\dns\"
CACLS C:\Windows\System32\dns /G "NETWORK SERVICE":F /E
CACLS C:\Windows\System32\dns\etc /G "NETWORK SERVICE":F /E
CACLS C:\Windows\System32\dns\etc\* /G "NETWORK SERVICE":F /E
CACLS C:\Windows\System32\dns\bin /G "NETWORK SERVICE":F /E
CACLS C:\Windows\System32\dns\bin\* /G "NETWORK SERVICE":F /E
reg import "R:\Registry\bind.reg"
xcopy "R:\Registry\bind.msi" "C:\"
"C:\bind.msi" /quiet /passive
del "C:\bind.msi"
sc create "ISC BIND" binpath= c:\Windows\System32\dns\bin\named.exe start= auto obj= "NT AUTHORITY\NETWORK SERVICE"
net start "ISC BIND" /Y
exit |
mkdir "C:\Windows\System32\dns"
xcopy /E "R:\Bind" "C:\Windows\System32\dns\"
CACLS C:\Windows\System32\dns /G "NETWORK SERVICE":F /E
CACLS C:\Windows\System32\dns\etc /G "NETWORK SERVICE":F /E
CACLS C:\Windows\System32\dns\etc\* /G "NETWORK SERVICE":F /E
CACLS C:\Windows\System32\dns\bin /G "NETWORK SERVICE":F /E
CACLS C:\Windows\System32\dns\bin\* /G "NETWORK SERVICE":F /E
reg import "R:\Registry\bind.reg"
xcopy "R:\Registry\bind.msi" "C:\"
"C:\bind.msi" /quiet /passive
del "C:\bind.msi"
sc create "ISC BIND" binpath= c:\Windows\System32\dns\bin\named.exe start= auto obj= "NT AUTHORITY\NETWORK SERVICE"
net start "ISC BIND" /Y
exit
In this scenario, Bind works with Network Service account. It’s better than named, i think. I won’t share bind.msi and bind.reg files but maybe you can see that files at Radore Telecom NOC Blog page. Our blog page is not online but you can follow here: http://www.rh.com.tr
|