Ярлыки
.htaccess
(4)
тестирование
(8)
шаблоны проектирования
(3)
css
(5)
Debian
(6)
docker
(2)
Doctrine2
(6)
Git
(6)
html
(4)
java
(6)
javascript
(13)
jquery
(11)
LFS
(3)
linux
(23)
mac os
(4)
mod_rewrite
(2)
MSSQL
(4)
MySQL
(18)
ORM Doctrine
(17)
patterns
(3)
PDO
(3)
perl
(7)
PHP
(64)
PHPUnit
(8)
Python
(15)
SEO
(2)
Silex
(1)
SimpleXML
(1)
SQL
(14)
ssh
(4)
Ubuntu
(24)
Yii1
(1)
Zend Framework
(19)
ZendFramework2
(8)
среда, 30 ноября 2011 г.
четверг, 17 ноября 2011 г.
Ubuntu. Управление скоростью вентилятора процессора.
Определяем наличие сенсоров на мат плате
Из этого ясно, что мат плата - ASUS M4A88T-M/USB3, которая позволяет управлять скоростью вращения кулера, необходимо лишь включить некоторые модули ядра. А именно - it87.
Загрузка модуля
Настраиваем датчики для "pulse width modulation (pwm)"
Смотрим конфиг файл, который получился
Запускаем службу управления вентиляторами
В итоге имеем вместо > 2500 оборотов, скромные 1025 и это при обычном режиме работы (netbeans, skype, pidgin, firefox)
leon@Berta:~$ sudo sensors-detect ... # sensors-detect revision 5946 (2011-03-23 11:54:44 +0100) # System: System manufacturer System Product Name # Board: ASUSTeK Computer INC. M4A88T-M/USB3 This program will help you determine which kernel modules you need to load to use lm_sensors most effectively. It is generally safe and recommended to accept the default answers to all questions, unless you know what you're doing. Some south bridges, CPUs or memory controllers contain embedded sensors. Do you want to scan for them? This is totally safe. (YES/no): Module cpuid loaded successfully. Silicon Integrated Systems SIS5595... No VIA VT82C686 Integrated Sensors... No VIA VT8231 Integrated Sensors... No AMD K8 thermal sensors... No AMD Family 10h thermal sensors... Success! (driver `k10temp') AMD Family 11h thermal sensors... No AMD Family 12h and 14h thermal sensors... No Intel digital thermal sensor... No Intel AMB FB-DIMM thermal sensor... No VIA C7 thermal sensor... No VIA Nano thermal sensor... No Some Super I/O chips contain embedded sensors. We have to write to standard I/O ports to probe them. This is usually safe. Do you want to scan for Super I/O sensors? (YES/no): Probing for Super-I/O at 0x2e/0x2f Trying family `National Semiconductor'... No Trying family `SMSC'... No Trying family `VIA/Winbond/Nuvoton/Fintek'... No Trying family `ITE'... Yes Found `ITE IT8712F Super IO Sensors' Success! (address 0x290, driver `it87') Probing for Super-I/O at 0x4e/0x4f Trying family `National Semiconductor'... No Trying family `SMSC'... No Trying family `VIA/Winbond/Nuvoton/Fintek'... No Trying family `ITE'... No Some systems (mainly servers) implement IPMI, a set of common interfaces through which system health data may be retrieved, amongst other things. We first try to get the information from SMBIOS. If we don't find it there, we have to read from arbitrary I/O ports to probe for such interfaces. This is normally safe. Do you want to scan for IPMI interfaces? (YES/no): Probing for `IPMI BMC KCS' at 0xca0... No Probing for `IPMI BMC SMIC' at 0xca8... No Some hardware monitoring chips are accessible through the ISA I/O ports. We have to write to arbitrary I/O ports to probe them. This is usually safe though. Yes, you do have ISA I/O ports even if you do not have any ISA slots! Do you want to scan the ISA I/O ports? (yes/NO): Lastly, we can probe the I2C/SMBus adapters for connected hardware monitoring devices. This is the most risky part, and while it works reasonably well on most systems, it has been reported to cause trouble on some systems. Do you want to probe the I2C/SMBus adapters now? (YES/no): Using driver `i2c-piix4' for device 0000:00:14.0: ATI Technologies Inc SB600/SB700/SB800 SMBus Module i2c-dev loaded successfully. Next adapter: SMBus PIIX4 adapter at 0b00 (i2c-0) Do you want to scan it? (YES/no/selectively): Client found at address 0x50 Probing for `Analog Devices ADM1033'... No Probing for `Analog Devices ADM1034'... No Probing for `SPD EEPROM'... Yes (confidence 8, not a hardware monitoring chip) Probing for `EDID EEPROM'... No Client found at address 0x51 Probing for `Analog Devices ADM1033'... No Probing for `Analog Devices ADM1034'... No Probing for `SPD EEPROM'... Yes (confidence 8, not a hardware monitoring chip) Client found at address 0x52 Probing for `Analog Devices ADM1033'... No Probing for `Analog Devices ADM1034'... No Probing for `SPD EEPROM'... Yes (confidence 8, not a hardware monitoring chip) Client found at address 0x53 Probing for `Analog Devices ADM1033'... No Probing for `Analog Devices ADM1034'... No Probing for `SPD EEPROM'... Yes (confidence 8, not a hardware monitoring chip) Now follows a summary of the probes I have just done. Just press ENTER to continue: Driver `it87': * ISA bus, address 0x290 Chip `ITE IT8712F Super IO Sensors' (confidence: 9) Driver `k10temp' (autoloaded): * Chip `AMD Family 10h thermal sensors' (confidence: 9) To load everything that is needed, add this to /etc/modules: #----cut here---- # Chip drivers it87 #----cut here---- If you have some drivers built into your kernel, the list above will contain too many modules. Skip the appropriate ones! Do you want to add these lines automatically to /etc/modules? (yes/NO)YES Successful! Monitoring programs won't work until the needed modules are loaded. You may want to run 'service module-init-tools start' to load them. Unloading i2c-dev... OK Unloading cpuid... OK
Из этого ясно, что мат плата - ASUS M4A88T-M/USB3, которая позволяет управлять скоростью вращения кулера, необходимо лишь включить некоторые модули ядра. А именно - it87.
Загрузка модуля
leon@Berta:~$ sudo service module-init-tools start ... module-init-tools stop/waiting
Настраиваем датчики для "pulse width modulation (pwm)"
leon@Berta:~$ sudo pwmconfig # pwmconfig revision 5857 (2010-08-22) This program will search your sensors for pulse width modulation (pwm) controls, and test each one to see if it controls a fan on your motherboard. Note that many motherboards do not have pwm circuitry installed, even if your sensor chip supports pwm. We will attempt to briefly stop each fan using the pwm controls. The program will attempt to restore each fan to full speed after testing. However, it is ** very important ** that you physically verify that the fans have been to full speed after the program has completed. Found the following devices: hwmon0 is atk0110 hwmon1/device is k10temp hwmon2/device is it8712 Found the following PWM controls: hwmon2/device/pwm1 hwmon2/device/pwm2 hwmon2/device/pwm3 Giving the fans some time to reach full speed... Found the following fan sensors: hwmon0/fan1_input current speed: 3292 RPM hwmon0/fan2_input current speed: 0 ... skipping! hwmon0/fan3_input current speed: 0 ... skipping! hwmon2/device/fan1_input current speed: 3260 RPM hwmon2/device/fan2_input current speed: 0 ... skipping! hwmon2/device/fan3_input current speed: 0 ... skipping! Warning!!! This program will stop your fans, one at a time, for approximately 5 seconds each!!! This may cause your processor temperature to rise!!! If you do not want to do this hit control-C now!!! Hit return to continue: Testing pwm control hwmon2/device/pwm1 ... hwmon0/fan1_input ... speed was 3292 now 1008 It appears that fan hwmon0/fan1_input is controlled by pwm hwmon2/device/pwm1 Would you like to generate a detailed correlation (y)? Note: If you had gnuplot installed, I could generate a graphical plot. PWM 255 FAN 3260 PWM 240 FAN 3199 PWM 225 FAN 3154 PWM 210 FAN 3125 PWM 195 FAN 3000 PWM 180 FAN 2872 PWM 165 FAN 2710 PWM 150 FAN 2528 PWM 135 FAN 2335 PWM 120 FAN 2191 PWM 105 FAN 2156 PWM 90 FAN 2156 PWM 75 FAN 1854 PWM 60 FAN 1730 PWM 45 FAN 1679 PWM 30 FAN 1614 PWM 28 FAN 1577 PWM 26 FAN 1516 PWM 24 FAN 1461 PWM 22 FAN 1403 PWM 20 FAN 1347 PWM 18 FAN 1290 PWM 16 FAN 1240 PWM 14 FAN 1186 PWM 12 FAN 1147 PWM 10 FAN 1142 PWM 8 FAN 1134 PWM 6 FAN 1126 PWM 4 FAN 1117 PWM 2 FAN 1106 PWM 0 FAN 1022 hwmon2/device/fan1_input ... speed was 3260 now 1018 It appears that fan hwmon2/device/fan1_input is controlled by pwm hwmon2/device/pwm1 /usr/sbin/pwmconfig: строка 474: hwmon2/device: превышен предел рекурсии выражения (error token is "device") Testing is complete. Please verify that all fans have returned to their normal speed. The fancontrol script can automatically respond to temperature changes of your system by changing fanspeeds. Do you want to set up its configuration file now (y)? What should be the path to your fancontrol config file (/etc/fancontrol)? Loading configuration from /etc/fancontrol ... Select fan output to configure, or other action: 1) hwmon2/device/pwm1 3) Just quit 5) Show configuration 2) Change INTERVAL 4) Save and quit select (1-n): 1 Devices: hwmon0 is atk0110 hwmon1/device is k10temp hwmon2/device is it8712 Current temperature readings are as follows: hwmon0/temp1_input 37 hwmon0/temp2_input 36 hwmon1/device/temp1_input 22 hwmon2/device/temp1_input 37 hwmon2/device/temp2_input 36 hwmon2/device/temp3_input -128 Select a temperature sensor as source for hwmon2/device/pwm1: 1) hwmon0/temp1_input 2) hwmon0/temp2_input 3) hwmon1/device/temp1_input 4) hwmon2/device/temp1_input 5) hwmon2/device/temp2_input 6) hwmon2/device/temp3_input 7) None (Do not affect this PWM output) select (1-n): 1 Enter the low temperature (degree C) below which the fan should spin at minimum speed (20): 40 Enter the high temperature (degree C) over which the fan should spin at maximum speed (60): Enter the PWM value (0-255) to use when the temperature is over the high temperature limit (255): Select fan output to configure, or other action: 1) hwmon2/device/pwm1 3) Just quit 5) Show configuration 2) Change INTERVAL 4) Save and quit select (1-n): 5 Common Settings: INTERVAL=10 Settings of hwmon2/device/pwm1: Depends on hwmon0/temp1_input Controls hwmon0/fan1_input MINTEMP=40 MAXTEMP=60 MINSTART=150 MINSTOP=0 Select fan output to configure, or other action: 1) hwmon2/device/pwm1 3) Just quit 5) Show configuration 2) Change INTERVAL 4) Save and quit select (1-n): 4 Saving configuration to /etc/fancontrol... Configuration saved
Смотрим конфиг файл, который получился
leon@Berta:~$ cat /etc/fancontrol # Configuration file generated by pwmconfig, changes will be lost INTERVAL=10 DEVPATH=hwmon0=devices/LNXSYSTM:00/device:00/PNP0A03:00/device:12/ATK0110:00 hwmon2=devices/platform/it87.656 DEVNAME=hwmon0=atk0110 hwmon2=it8712 FCTEMPS=hwmon2/device/pwm1=hwmon0/temp1_input FCFANS= hwmon2/device/pwm1=hwmon0/fan1_input MINTEMP=hwmon2/device/pwm1=40 MAXTEMP=hwmon2/device/pwm1=60 MINSTART=hwmon2/device/pwm1=150 MINSTOP=hwmon2/device/pwm1=0
Запускаем службу управления вентиляторами
leon@Berta:~$ sudo /etc/init.d/fancontrol start * Starting fan speed regulator fancontrol
В итоге имеем вместо > 2500 оборотов, скромные 1025 и это при обычном режиме работы (netbeans, skype, pidgin, firefox)
среда, 16 ноября 2011 г.
CSS. Один блок поверх другого.
<div style='position: relative; width: 100px; height: 100px; z-index: 1;' >div1</div> <div style='top: -100px; position: relative; width: 100px; height: 100px; z-index: 2;'>div2</div>
CSS. Затемнение экрана.
<div id='mydiv' style="position: fixed; top: 0px; left: 0px; margin: 0px; padding: 0px; width: 100%; height: 100%; background: black; opacity: 0.5; z-index: 100; "></div>
воскресенье, 13 ноября 2011 г.
Ubuntu. KVM-свитч и разрешение.
Поставил себе kvm - d-link 121 разрешение в ubuntu стало доступно в режиме CRT. Максимум 1600x1600.
Смотрим xrandr
Генерируем нужный modeline
Добавляем новый режим
Выставлять режим с помощью xrandr бессмысленно. Мне помог AMD Catalyst Control Center.
Там удалось выбрать необходимый режим и после перезагрузки все заработало.
Смотрим xrandr
leon@Berta:~$ xrandr Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 1920 x 1920 DFP1 disconnected (normal left inverted right x axis y axis) CRT1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm 1600x1200 60.0 1400x1050 60.0 1280x1024 60.0 47.0 43.0 1440x900 59.9 1280x960 60.0 1366x768 59.9 1360x768 60.0 1280x800 60.0 1152x864 60.0 47.0 43.0 1280x768 59.9 56.0 1280x720 60.0 50.0 1024x768 60.0 43.5 800x600 60.3 56.2 47.0 720x480 60.0 640x480 60.0
Генерируем нужный modeline
leon@Berta:~$ cvt 1920 1080 # 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
Добавляем новый режим
leon@Berta:~$ xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync leon@Berta:~$ xrandr --addmode CRT1 --mode 1920x1080_60.00
Выставлять режим с помощью xrandr бессмысленно. Мне помог AMD Catalyst Control Center.
Там удалось выбрать необходимый режим и после перезагрузки все заработало.
вторник, 8 ноября 2011 г.
ibook. OSX Leopard необходимый софт.
XAMPP для OSX
http://www.apachefriends.org/en/xampp-macosx.html
Netbeans 6.5.1 работает довольно шустро на ppc 1.42 GHZ, 1.5G RAM
http://netbeans.org/downloads/6.5.1/index.html
iTerm2 замена стандартного терминала, есть вкладки
http://www.iterm2.com/#/section/home
http://www.apachefriends.org/en/xampp-macosx.html
Netbeans 6.5.1 работает довольно шустро на ppc 1.42 GHZ, 1.5G RAM
http://netbeans.org/downloads/6.5.1/index.html
iTerm2 замена стандартного терминала, есть вкладки
http://www.iterm2.com/#/section/home
пятница, 4 ноября 2011 г.
ibook. Debian Squeeze настройка wifi.
ibook имеет вот такую карту wifi
Добавляем в /etc/apt/sources.list
Ставим, если надо
Обновляем списки apt
Ставим firmaware
Если модуль ядра не загрузился, делаем ручками
Проверяем доступный интерфейс
Открываем конфигурацию сетевых интерфейсов
У меня wpa2 c DHCP
Подключаемся
# lspci | grep Broadcom Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g
Добавляем в /etc/apt/sources.list
deb http://ftp.us.debian.org/debian squeeze main contrib non-free
Ставим, если надо
# apt-get install wireless-tools # apt-get install wpasupplicant
Обновляем списки apt
# apt-get update
Ставим firmaware
# apt-get install firmware-b43-installer
Если модуль ядра не загрузился, делаем ручками
# modprobe b43
Проверяем доступный интерфейс
# iwconfig
Открываем конфигурацию сетевых интерфейсов
# nano /etc/network/interfaces
У меня wpa2 c DHCP
auto wlan0 iface wlan0 inet dhcp wpa-ssid mynetworkname wpa-psk mysecretpassphrase
Подключаемся
# ifup wlan0
среда, 2 ноября 2011 г.
ibook. Debian 6 эмуляция клавиш мыши.
ibook имеет тот самый однокнопочный трекпад.
Делаем так, что
fn + ctrl = средняя кнопка мыши
fn + alt = левая кнопка мыши
Открываем /etc/sysctl.conf, и добавляем строки:
Делаем так, что
fn + ctrl = средняя кнопка мыши
fn + alt = левая кнопка мыши
Открываем /etc/sysctl.conf, и добавляем строки:
dev.mac_hid.mouse_button_emulation = 1 dev.mac_hid.mouse_button2_keycode = 97 dev.mac_hid.mouse_button3_keycode = 100
jQuery. Установка значения radio.
var myradio = $('input:radio[name=myradio]'); myradio.filter('[value=myval]').attr('checked', true);
jQuery. Сброс значений формы.
$(':text, :password, :file, SELECT', '#myform').val(''); $(':input', '#myform').removeAttr('checked').removeAttr('selected')
Подписаться на:
Сообщения (Atom)