tag:blogger.com,1999:blog-69266115714082586812024-03-05T14:06:41.481+01:00How to...Anonymoushttp://www.blogger.com/profile/18016422744350935774noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-6926611571408258681.post-85734082142109373742016-06-12T20:56:00.000+02:002016-06-12T20:56:53.932+02:00How to enable performance fan mode on Lenovo Z580If you have <b>Lenovo Z580</b> as me, you can see that you can set only <b>silent</b>, <b>normal</b> and <b>dust cleaning</b> mode for your fan. It's because of incompatibility of current <b>ideapad-laptop</b> module. <b>Enabling performance mode</b> is very easy.<br />
<br />
<a name='more'></a>All you need is my modified <b>ideapad-laptop.c</b>. All the magic is around line 408<br />
<br />
<pre style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7mYjcy2p1YNk2E4v5UGHMaS-mayJFmHq9_yGPtoLwsXbEMfzJEFygUXsV1difXDEBxuLUh2HTQEmqbDJ4-Zx2WSZA4sDoLWsDGF226dF4TpW3PeY92PecU2T6RsKsq9r53bZnf1HBEJFC/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"><code style="color:#000000;word-wrap:normal;">397: static ssize_t store_ideapad_fan(struct device *dev,
398: struct device_attribute *attr,
399: const char *buf, size_t count)
400: {
401: int ret, state;
402: struct ideapad_private *priv = dev_get_drvdata(dev);
403: if (!count)
404: return 0;
405: if (sscanf(buf, "%i", &amp;state) != 1)
406: return -EINVAL;
407: if (state &lt; 0 || state &gt; 4 || state == 3)
408: return -EINVAL;
409: ret = write_ec_cmd(priv-&gt;adev-&gt;handle, VPCCMD_W_FAN, state);
410: if (ret &lt; 0)
411: return -EIO;
412: return count;
413: }
</code></pre>
<br />
In my modified code here:<br />
<br />
<pre style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7mYjcy2p1YNk2E4v5UGHMaS-mayJFmHq9_yGPtoLwsXbEMfzJEFygUXsV1difXDEBxuLUh2HTQEmqbDJ4-Zx2WSZA4sDoLWsDGF226dF4TpW3PeY92PecU2T6RsKsq9r53bZnf1HBEJFC/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"><code style="color:#000000;word-wrap:normal;">397: static ssize_t store_ideapad_fan(struct device *dev,
398: struct device_attribute *attr,
399: const char *buf, size_t count)
400: {
401: int ret, state;
402: struct ideapad_private *priv = dev_get_drvdata(dev);
403: if (!count)
404: return 0;
405: if (sscanf(buf, "%i", &amp;state) != 1)
406: return -EINVAL;
407: if (state != 8)
408: if (state &lt; 0 || state &gt; 4 || state == 3)
409: return -EINVAL;
410: ret = write_ec_cmd(priv-&gt;adev-&gt;handle, VPCCMD_W_FAN, state);
411: if (ret &lt; 0)
412: return -EIO;
413: return count;
414: }
</code></pre>
<br />
is just added option to accept number 8, because our laptops uses different VCI number. You can make our modified ideapad-laptop.c with this Makefile<br />
<br />
<pre style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7mYjcy2p1YNk2E4v5UGHMaS-mayJFmHq9_yGPtoLwsXbEMfzJEFygUXsV1difXDEBxuLUh2HTQEmqbDJ4-Zx2WSZA4sDoLWsDGF226dF4TpW3PeY92PecU2T6RsKsq9r53bZnf1HBEJFC/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"><code style="color:#000000;word-wrap:normal;">1: ifneq ($(KERNELRELEASE),)
2: obj-m := ideapad-laptop.o
3: else
4: KDIR ?= /lib/modules/`uname -r`/build
5: all: ideapad-laptop
6: ideapad-laptop: ideapad-laptop.c
7: $(MAKE) -C $(KDIR) M=$$PWD
8: clean:
9: rm -f *.o *.ko modules.order Module.symvers *.mod.c
10: endif
</code></pre>
<br />
Then you need to compress it and replace original driver with this one.<br />
<br />
<pre style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7mYjcy2p1YNk2E4v5UGHMaS-mayJFmHq9_yGPtoLwsXbEMfzJEFygUXsV1difXDEBxuLUh2HTQEmqbDJ4-Zx2WSZA4sDoLWsDGF226dF4TpW3PeY92PecU2T6RsKsq9r53bZnf1HBEJFC/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"><code style="color:#000000;word-wrap:normal;"> # rm /lib/modules/`uname -r`/kernel/drivers/platform/x86/ideapad-laptop.ko.gz
# cp ideapad-laptop.ko.gz /lib/modules/`uname -r`/kernel/drivers/platform/x86/ideapad-laptop.ko.gz
</code></pre>
<br />
After this, reboot and it should work with<br />
<br />
<pre style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7mYjcy2p1YNk2E4v5UGHMaS-mayJFmHq9_yGPtoLwsXbEMfzJEFygUXsV1difXDEBxuLUh2HTQEmqbDJ4-Zx2WSZA4sDoLWsDGF226dF4TpW3PeY92PecU2T6RsKsq9r53bZnf1HBEJFC/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"><code style="color:#000000;word-wrap:normal;"> # echo 8 > /sys/devices/pci0000:00/0000:00:1f.0/PNP0C09:00/VPC2004:00/fan_mode
</code></pre>
<br />
Or you can use this simple C program to switch different modes
<br />
<pre style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7mYjcy2p1YNk2E4v5UGHMaS-mayJFmHq9_yGPtoLwsXbEMfzJEFygUXsV1difXDEBxuLUh2HTQEmqbDJ4-Zx2WSZA4sDoLWsDGF226dF4TpW3PeY92PecU2T6RsKsq9r53bZnf1HBEJFC/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"><code style="color:#000000;word-wrap:normal;">1: #include <stdio.h>
2: #include <stdlib.h>
3: #include <unistd.h>
4: #include <string.h>
5: int main(int argc, char *argv[])
6: {
7: if (argc == 2)
8: {
9: setuid(0);
10: if (strcmp(argv[1],"normal") == 0)
11: system("echo 2 > /sys/devices/pci0000:00/0000:00:1f.0/PNP0C09:00/VPC2004:00/fan_mode");
12: else if (strcmp(argv[1], "silent") == 0)
13: system("echo 4 > /sys/devices/pci0000:00/0000:00:1f.0/PNP0C09:00/VPC2004:00/fan_mode");
14: else if (strcmp(argv[1], "performance") == 0)
15: system("echo 8 > /sys/devices/pci0000:00/0000:00:1f.0/PNP0C09:00/VPC2004:00/fan_mode");
16: else if (strcmp(argv[1], "dust") == 0)
17: system("echo 1 > /sys/devices/pci0000:00/0000:00:1f.0/PNP0C09:00/VPC2004:00/fan_mode");
18: }
19: return 0;
20: }
</code></pre>
<br />
Compile it and run:
<br />
<pre style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7mYjcy2p1YNk2E4v5UGHMaS-mayJFmHq9_yGPtoLwsXbEMfzJEFygUXsV1difXDEBxuLUh2HTQEmqbDJ4-Zx2WSZA4sDoLWsDGF226dF4TpW3PeY92PecU2T6RsKsq9r53bZnf1HBEJFC/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"><code style="color:#000000;word-wrap:normal;">$ gcc -std=C11 fan-mode.c -o fan-mode
$ sudo mv fan-mode /bin
$ sudo chown root:root /bin/fan-mode
$ sudo chmod +s /bin/fan-mode
$ sudo chmod +x /bin/fan-mode
$ fan-mode performance
</code></pre>
<br />
It has SUID bit of root, because only root has permission to change fan mode and it's placed in bin, so you can use it as regular command.
<br />
Anonymoushttp://www.blogger.com/profile/18016422744350935774noreply@blogger.com1tag:blogger.com,1999:blog-6926611571408258681.post-15663186149316849872016-04-30T13:04:00.001+02:002016-04-30T13:05:31.540+02:00How to get a longer battery life on linux<span style="font-family: inherit;">Main problem of laptops is battery life on Linux. It’s mainly becouse laptop manufacturers didn’t provide linux drivers a power save features. You can almost always experience that Windows operating system will last longer on battery. Sometimes it’s a few minutes, but sometimes it’s few hours. If you are not satisfied with your battery endurance, feel free to take some ideas from this article. It’s written mainly for Arch Linux, but with small changes it can be applied on all modern linux distributions like Ubuntu, Debian, Fedora etc.</span><br />
<span style="font-family: inherit;"></span><br />
<a name='more'></a><span style="font-family: inherit;"><br /></span><br />
<h3>
<span style="font-family: inherit;">1. Powertop</span></h3>
<span style="font-family: inherit;">This little app is grate for monitoring your power consumption. When on battery, it can calculate your current power consumption in Watts, so you can monitor it in real-time. <br /><br />It has it’s own power saving features, which is recommend to enable all. You can experiment with enabling and disablign them and watch your power consumption. It’s known that on few systems, enabling PCI power-save feature can lead to bigger consumption, so watch it carefully. <br /><br />It’s good to leave it for at least 10 minutes, to collect data about your battery discharge rate.</span><br />
<h3>
<span style="font-family: inherit;">2. Display settings</span></h3>
<span style="font-family: inherit;">One of the most power hungry part of your system is display. It’s good to run it at lowest possible brightness which is comfortable for you. The realtionship between brightness and power consumption is not linear. Good value is somewhere under 2/3 of your maximum brightness. Also on LCD screens is good to use bright colors and backgrounds, becouse it uses more power to display black color. On OLED displays is perfect black color, becouse it will shut down segments, which are used to display black. Set your screen blanking to some low value, eg. 2 minutes of inactivity.</span><br />
<h3>
<span style="font-family: inherit;">3. Intel i915 power saving features</span></h3>
<span style="font-family: inherit;">With this driver, you can make a few changes, which can grately increase battery life. Intel have written a piece of nice battery save features, but they are mostly disabled, becouse they are not 100% compatible with all laptops. You can try all this tricks and experiment with them. If something goes wrong, you can allways revert back to default setting. We’ll be modifying GRUB kernel parameters, so you can change them during early boot in GRUB.</span><br />
<h4>
<span style="font-family: inherit;">3.1 Intel RC6</span></h4>
<span style="font-family: inherit;">This feature enables deep, low power state of Intel graphics. It can be applied to Sandy bridge and newer CPUs. If you wish to enable this feature, edit:</span><br />
<blockquote class="tr_bq">
<b><span style="font-family: inherit;">/etc/default/grub</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">find line:</span><br />
<blockquote class="tr_bq">
<b><span style="font-family: inherit;">GRUB_CMDLINE_LINUX_DEFAULT="...”</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">and add i915.i915_enable_rc6=1 to the end so it’ll looks like</span><br />
<blockquote class="tr_bq">
<b><span style="font-family: inherit;">GRUB_CMDLINE_LINUX_DEFAULT="… i915.i915_enable_rc6=1”</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;"><br />Save file and regenerate your GRUB file</span><br />
<blockquote class="tr_bq">
<b><span style="font-family: inherit;">$ sudo grub-mkconfig -o /boot/grub/grub.cfg</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;"><br /></span>
<h4>
<span style="font-family: inherit;">3.2 Framebuffer compression</span></h4>
<span style="font-family: inherit;">This option can show some artifacts on non-compatible hardware, but it’s worth of trying. It can save 0.5-1W of energy. It’ll enable compression of framebuffer, so less bandwidth is used. To enable this option, edit</span><br />
<blockquote>
<b><span style="font-family: inherit;">/etc/default/grub</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">and modify line </span><br />
<blockquote>
<b><span style="font-family: inherit;">GRUB_CMDLINE_LINUX_DEFAULT="...”</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">to </span><br />
<blockquote>
<b><span style="font-family: inherit;">GRUB_CMDLINE_LINUX_DEFAULT="… i915.i915_enable_fbc=1”</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;"><br />Save file and regenerate your GRUB file</span><br />
<blockquote>
<b><span style="font-family: inherit;">$ sudo grub-mkconfig -o /boot/grub/grub.cfg</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;"><br /></span>
<h4>
<span style="font-family: inherit;">3.3 LVDS Downclocking</span></h4>
<span style="font-family: inherit;">If you have unsupported hardware, your screen can flicker with this parameter enabled. Basically it’ll downclock refresh rate of LVDS. It’s not a big energy saver, but every piece counts. To enable this option, edit </span><br />
<blockquote>
<b><span style="font-family: inherit;">/etc/default/grub</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">and modify line </span><br />
<blockquote>
<b><span style="font-family: inherit;">GRUB_CMDLINE_LINUX_DEFAULT="...”</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">to </span><br />
<blockquote>
<b><span style="font-family: inherit;">GRUB_CMDLINE_LINUX_DEFAULT="… i915.lvds_downclock=1”</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;"><br />Save file and regenerate your GRUB file</span><br />
<blockquote>
<b><span style="font-family: inherit;">$ sudo grub-mkconfig -o /boot/grub/grub.cfg</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;"><br /></span>
<h4>
<span style="font-family: inherit;">4. Other devices power save features</span></h4>
<span style="font-family: inherit;">Disable all devices which are not used. Disabling bluetooth, WIFI, ethernet, webcam can leads to big power saving. If you don’t have hardware switch for this devices, look in your BIOS settings, or unload all modules for that devices.<br />For webcam use</span><br />
<blockquote>
<b><span style="font-family: inherit;">$ sudo rmmod uvcvideo</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">For bluetooth use</span><br />
<blockquote>
<b><span style="font-family: inherit;">$ sudo rmmod bluetooth</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">If you want to look at your modules, run this command</span><br />
<blockquote>
<b><span style="font-family: inherit;">$ lsmod</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">and investigate, what can be unloaded.</span><br />
<h4>
<span style="font-family: inherit;">4.1 USB autosuspend</span></h4>
<span style="font-family: inherit;">Very good feature is to autosuspend unused USB ports. To do this, edit file</span><br />
<blockquote>
<b><span style="font-family: inherit;">/etc/udev/rules.d/50-usb_power_save.rules</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">and add to it</span><br />
<blockquote>
<b><span style="font-family: inherit;">ACTION=="add", SUBSYSTEM=="usb", TEST=="power/control", ATTR{power/control}="auto"</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">You can specify, how long it will take to suspend your devices in file</span><br />
<blockquote>
<b><span style="font-family: inherit;">/etc/modprobe.d/usb-autosuspend.conf</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">This option will set how many seconds it will wait for inactivity</span><br />
<blockquote>
<b><span style="font-family: inherit;">options usbcore autosuspend=5</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;"><br /></span>
<h4>
<span style="font-family: inherit;">4.2 SATA Active Link Power Management</span></h4>
<span style="font-family: inherit;">If your laptop has SATA ports, you can enable it’s power management.<br />Warning: On some laptops it can leads to data loss.<br />Edit file</span><br />
<blockquote>
<b><span style="font-family: inherit;">/etc/udev/rules.d/hd_power_save.rules</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">and add to it</span><br />
<blockquote>
<b><span style="font-family: inherit;">ACTION=="add", SUBSYSTEM=="scsi_host", KERNEL=="host*", ATTR{link_power_management_policy}="min_power".</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">This setting will add latency when accessing your SATA devices, so it’s good to enable it only on battery.</span><br />
<h4>
<span style="font-family: inherit;">4.3 HDD</span></h4>
<span style="font-family: inherit;">Mechanical hard drives uses a lots of power. You can save power here, but it can shorten lifetime of your HDD. So consider a appropriate values, depending on how often are you gonna access your data on drive. It’s not good to set spindown to low value, if you have a lot’s of disk activity. It’ll be spinning down and up all the time. <br />First setting is Advanced Power Managment. Current value can be shown with</span><br />
<blockquote>
<b><span style="font-family: inherit;"># hdparm -B /dev/sda</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">To set a new value (for example 127), write</span><br />
<blockquote>
<b><span style="font-family: inherit;"># hdparm -B 127 /dev/sda </span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">Values from 1 to 127 permit spin-down, whereas values from 128 to 254 do not. A value of 255 completely disables the feature. <br />Second you can set standby timeout for your drive with -S parameter. The value of 0 disables spindown, the values from 1 to 240 specify multiples of 5 seconds and values from 241 to 251 specify multiples of 30 minutes. For example</span><br />
<blockquote>
<b><span style="font-family: inherit;"># hdparm -S 20 /dev/sda</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;"><br />If you want to save a lot of power, change your HDD for SSD. It has no mechanical parts and it consumes a lot less energy than HDD. Or at least, use SSD for your system and HDD for data.</span><br />
<h4>
<span style="font-family: inherit;">4.4. nVidia Optimus dual graphics</span></h4>
<span style="font-family: inherit;">The biggest power consumer is your dedicated graphic card. If you have nVidia Optimus enabled graphic card, you can disable it, when you are not using it. If you are not using nVidia graphic card at all, try to disabling it in BIOS settings. If you want to still use advantages of more powerfull card, simply install Bumblebee and Bbswitch module. That module will automatically disable dedicated graphic card when not used. On Arch linux you can install it with</span><br />
<blockquote>
<b><span style="font-family: inherit;">$ sudo pacman -S bumblebee bbswitch</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">After this, if you want to run some application with dedicated graphic card, simply put optirun command before your application, eg.</span><br />
<blockquote>
<b><span style="font-family: inherit;">$ optirun glxgears</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<h4>
<span style="font-family: inherit;">4.5 Wake-on-LAN</span></h4>
<span style="font-family: inherit;">This function is used to wake up your computer through network. If you are not using it, disable it becouse it allways waits for magic packet. To do this, create file</span><br />
<blockquote>
<b><span style="font-family: inherit;">/etc/udev/rules.d/70-disable_wol.rules</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">and add to it</span><br />
<blockquote>
<b><span style="font-family: inherit;">ACTION=="add", SUBSYSTEM=="net", KERNEL=="eth*", RUN+="/usr/bin/ethtool -s %k wol d"</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">Also install ethtool to enable this.</span><br />
<h4>
<span style="font-family: inherit;">4.6 Wifi powersave</span></h4>
<span style="font-family: inherit;">To enable powersave on all wireless devices, create file </span><br />
<blockquote>
<b><span style="font-family: inherit;">/etc/udev/rules.d/70-wifi-powersave.rules</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">and add to it</span><br />
<blockquote>
<b><span style="font-family: inherit;">ACTION=="add", SUBSYSTEM=="net", KERNEL=="wlan*", RUN+="/usr/bin/iw dev %k set power_save on"</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;"><br /></span>
<h4>
<span style="font-family: inherit;">4.7 Audio powersave</span></h4>
<span style="font-family: inherit;">You can get a bit of energy by enabling powersave on your sound card. To do this, create file</span><br />
<blockquote>
<b><span style="font-family: inherit;">/etc/modprobe.d/audio_powersave.conf</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">and add to it</span><br />
<blockquote>
<b><span style="font-family: inherit;">options snd_hda_intel power_save=1</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;"><br /></span>
<h4>
<span style="font-family: inherit;">4.8 Disable NMI watchdog</span></h4>
<span style="font-family: inherit;">If you are not going to debug kernel, disable this by editing file</span><br />
<blockquote>
<b><span style="font-family: inherit;">/etc/sysctl.d/disable_watchdog.conf</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">add to it</span><br />
<blockquote>
<b><span style="font-family: inherit;">kernel.nmi_watchdog = 0</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;"><br /></span>
<h4>
<span style="font-family: inherit;">4.9 Writeback time</span></h4>
<span style="font-family: inherit;">This will aggregate disk I/O, so less writes will be performed. Default value for writeback is 5 seconds. Edit file</span><br />
<blockquote>
<b><span style="font-family: inherit;">/etc/sysctl.d/dirty.conf</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">and set your writeback to 60 seconds</span><br />
<blockquote>
<b><span style="font-family: inherit;">vm.dirty_writeback_centisecs = 6000</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;"><br /></span>
<h4>
<span style="font-family: inherit;">4.10 Set laptop mode</span></h4>
<span style="font-family: inherit;">According to Kernel documentation "A sensible value for the knob is 5 seconds.".<br />Edit file</span><br />
<blockquote>
<b><span style="font-family: inherit;">/etc/sysctl.d/laptop.conf</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">and add to it</span><br />
<blockquote>
<b><span style="font-family: inherit;">vm.laptop_mode = 5</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;"><br /></span>
<h3>
<span style="font-family: inherit;">5. Custom powersave features only on battery</span></h3>
<span style="font-family: inherit;">If you have your custom scripts which are intend to turn on this features, you can set udev rule to run it automatically only on battery. To do this, create file</span><br />
<blockquote>
<b><span style="font-family: inherit;">/etc/udev/rules.d/powersave.rules</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;">and add lines to run your custom script</span><br />
<blockquote class="tr_bq">
<b><span style="font-family: inherit;">SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="/path/to/your/script true"</span><br /><span style="font-family: inherit;">SUBSYSTEM=="power_supply", ATTR{online}=="1", RUN+="/path/to/your/script false"</span></b><br />
<span style="font-family: inherit;"></span></blockquote>
<span style="font-family: inherit;"><br />I hope this article will be useful for someone. I’m using this tweaks on all my laptops. I get about 2 hours of more battery energy, so it’s really usefull. If I’ll find some more tweaks, I’ll add them or if you have your own tweaks, feel free to leave them in comments section.<br /></span>Anonymoushttp://www.blogger.com/profile/18016422744350935774noreply@blogger.com0tag:blogger.com,1999:blog-6926611571408258681.post-26489137587195384062014-03-05T23:00:00.002+01:002014-03-06T09:33:32.443+01:00How to overclock GeForce 460GTX Fermi on linux<span style="color: red;">You do all modifications at your own risk. You can easily brick your card. This tutorial is for advanced users!</span> <span style="color: red;">I am not responsible for damage you can do to your card!</span> <span style="color: red;">It can work for other Fermi cards, but it's not guaranted!</span><br />
<br />
Today I am here to tell you, how to <b>overclock</b> your <b>Fermi</b> based GeForce card.This tutorial is written for <b>MSI GeForce N460GTX 1GB OC edition! </b>You can change some values according to your card, but it's a risky. nVidia didn't provide support for <b>overclocking in Linux</b>. The only option is to modify the BIOS of graphic card. I am going to explain this mod on my <b>MSI GeForce N460GTX 1GB OC edition</b>.<br />
<a name='more'></a><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWGFKUuJv3a7XUBeOzmlja5etZIKw1FWvT4KDuVHcJjsigwck_6ZMDBR6aKsXr7kdk8cQ5sSRxnIjENv8xlVzE8MV6wiD_hd6uo74L0qeNpg3c7MTs_wylvzgDJuHJ1_6gdcCwHORhs5w/s1600/nvidia.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWGFKUuJv3a7XUBeOzmlja5etZIKw1FWvT4KDuVHcJjsigwck_6ZMDBR6aKsXr7kdk8cQ5sSRxnIjENv8xlVzE8MV6wiD_hd6uo74L0qeNpg3c7MTs_wylvzgDJuHJ1_6gdcCwHORhs5w/s1600/nvidia.png" height="226" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Stock frequencies</td><td class="tr-caption" style="text-align: center;"><b><br /></b></td></tr>
</tbody></table>
<br />
For this mod you will need these things: <br />
<ul>
<li><a href="http://www.fdos.org/bootdisks/autogen/FDSTD10.zip" target="_blank">10MB big IMG file of FreeDOS</a></li>
<li><a href="http://www.guru3d.com/files_details/nvidia_bios_editor_download_nibitor.html" rel="nofollow" target="_blank">NiBiTor - BIOS editor</a></li>
<li><a href="http://www.techpowerup.com/downloads/2258/nvflash-5-142-for-windows/mirrors" rel="nofollow" target="_blank">nvFlash - flashing your new BIOS</a></li>
</ul>
After downloading necessary tools, you can take FDSTD10.IMG and make bootable USB drive with it. It can be simply achieved with dd:<br />
<br />
<b># dd if=FDSTD10.IMG of=/dev/sdx bs=512<br /># sync</b><br />
<br />
When all is complete, decompress nvFlash utility and copy it's content to the USB drive (IMG is 10MB big to have some extra space for utils). Now you can reboot your system and boot from your USB drive. When command prompt appears, run this command to backup your BIOS:<br />
<br />
<b>C:\> NVFLASH.EXE --save BIOS.rom</b><br />
<br />
Now you can restart your computer and boot your Linux. It's time for modify your BIOS. Make sure you have your BIOS backuped! Run NiBiTor (with wine works perfect) and open your BIOS file.<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD4Myc-7YISj6F-XvXi4eS6dFCfW8doxpsEdCxe4NY9CsJWe0AIjfczjbpNVFwgJz30H-qsiBL83v5vErhgxOp_eBMjfrbUZaMHuYurobuFb4DnMaX1Jr13RlnTI0aQ8nqPXm6PcF7Zro/s1600/1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD4Myc-7YISj6F-XvXi4eS6dFCfW8doxpsEdCxe4NY9CsJWe0AIjfczjbpNVFwgJz30H-qsiBL83v5vErhgxOp_eBMjfrbUZaMHuYurobuFb4DnMaX1Jr13RlnTI0aQ8nqPXm6PcF7Zro/s1600/1.png" height="320" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">NiBiTor 6.06</td></tr>
</tbody></table>
<br />
Integrity <u>MUST</u> be green. That means that your BIOS file is OK. Go to <b>Tools->Fermi Voltage</b>. You should see this:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiqmi-cIjEWL9N8rAUCBgxWyosQdU3oHm5R65abstrAy7O6HgBnEgmXJKcx5aat6JhjBzYn_vPKzuWLN5JG4-T56l8mbw-cMBD932gQFtVtCB-V6cdTY_sD2o9h1AMF8FFB89JqgE6Fa0/s1600/2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiqmi-cIjEWL9N8rAUCBgxWyosQdU3oHm5R65abstrAy7O6HgBnEgmXJKcx5aat6JhjBzYn_vPKzuWLN5JG4-T56l8mbw-cMBD932gQFtVtCB-V6cdTY_sD2o9h1AMF8FFB89JqgE6Fa0/s1600/2.png" height="184" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Fermi Voltage Editor - stock values</td></tr>
</tbody></table>
These are your <b>voltages</b>. We need to rise them a bit, for <b>stability</b>. Look only at <u>Setting 2</u> and <u>Limit</u>. Setting 2 is for <b>high performance 3D</b>. Set these values:<br />
<ul>
<li>Limit: 1.15V</li>
<li>Setting 2, Tab 0: 1.0125V</li>
<li>Setting 2, Tab 1: 1.1V</li>
</ul>
Click apply.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrizcjUQn4ibXMpq-lvogEeZi57Q88CyspBSjN-BqxKa9OWFYUAhSitrc8Wk3HtB9Bax_9qlYrjoraShO2wb10hmS3F0TYm4xug-HB4eU5xC9OUWTZgVg8qHCi4if_bmS2J_60Lbb3D8Q/s1600/3.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrizcjUQn4ibXMpq-lvogEeZi57Q88CyspBSjN-BqxKa9OWFYUAhSitrc8Wk3HtB9Bax_9qlYrjoraShO2wb10hmS3F0TYm4xug-HB4eU5xC9OUWTZgVg8qHCi4if_bmS2J_60Lbb3D8Q/s1600/3.png" height="182" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Modified voltages</td></tr>
</tbody></table>
Now go to <b>Tools->Fermi Clocks</b>. This screen is a bit tricky. This thing works only for <b>GF104, GF110, GF114</b> cores. <b>GF100</b> is a bit different.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGJgmck3MZWToW7ECpN5-AZbdalX30rgTQjKzLVICrbWcwogrKiSVT76ZXY0j0iOujGtOLg1rcHXlOjzDCzrUlyI3yNP-78Rwxr4XFuHT6eLaRpETix9KuQaagxBuK_wofoktP3EWtYCc/s1600/4.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGJgmck3MZWToW7ECpN5-AZbdalX30rgTQjKzLVICrbWcwogrKiSVT76ZXY0j0iOujGtOLg1rcHXlOjzDCzrUlyI3yNP-78Rwxr4XFuHT6eLaRpETix9KuQaagxBuK_wofoktP3EWtYCc/s1600/4.png" height="212" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Fermi Clock Editor - stock values</td></tr>
</tbody></table>
Here is a little explenation:<br />
<ul>
<li>Line 15, Tab 5: Memory frequency, mine is in nVidia reported as 3600MHz, here is 1800. </li>
<li>Line 15, Tab 3: Shader frequnecy.</li>
<li>Line 15, Tab 4: Bumped shader, calculated from Shader frequency.</li>
<li>Line 15, Tab 11: Bumped shader, calculated from Shader frequency</li>
</ul>
Core frequency is set automatically. At first you can set your memory frequency. Just change (remember, it will be times 2):<br />
<ul>
<li>Line 12, Tab 5: 2050MHz</li>
<li>Line 15, Tab 5: 2050MHz</li>
</ul>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6TfPvsSpL59jppljTvZWaAO4bCm3YcTdyXL4w1ZqN1vhzFpAaycHDiImRH8J9fhpaY0BrUSeDlg3rcwBVsrIt1CjsM_SCx_GZjSdsn_LrxVrCZoEwoU8Be4lXHDIlyWvi7EcWMgRKQaM/s1600/a.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6TfPvsSpL59jppljTvZWaAO4bCm3YcTdyXL4w1ZqN1vhzFpAaycHDiImRH8J9fhpaY0BrUSeDlg3rcwBVsrIt1CjsM_SCx_GZjSdsn_LrxVrCZoEwoU8Be4lXHDIlyWvi7EcWMgRKQaM/s1600/a.png" height="217" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Memory frequency changing</td></tr>
</tbody></table>
Now it's time for shader clock. It's a bit different, we need to <b>calculate bump shader</b> as well. At first, we need to decide, which <b>frequency</b> do we want. I want mine running at 1700MHz. As we said, <b>bumped shader</b> is Line 15, Tab 4 and 11, <b>Shader</b> is on Line 15, Tab 3. Here is a simple math, how to calculate <b>bumped shader</b>. At first, we want to know <b>multiplier</b>. It can be calculated as:<br />
<div style="text-align: center;">
<b>(Line 15, Tab 4) divided by (Line 15, Tab 3)</b></div>
<div style="text-align: left;">
In this example, it is as</div>
<div style="text-align: center;">
<b>1538 / 1451 = 1.06</b></div>
<div style="text-align: left;">
Our <b>bumped multiplier</b> is <b><u>1.06</u></b>. Now we can set desired <b>shader frequency </b>(1700 MHz) in Line 15, Tab 3</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn1S3kNXBvJucF5J7hO0RDpvWksDzbiH7KEjtuo8E50bj-dsTziqbsRcD7XX1_B4DFIWZk5VuKHZvWhyphenhyphen5m9OLb5YhHqX8kUWtzSPdgit2dIyV_hEwonCIJrcXlSa7ewwB_lhYHe4B9aOM/s1600/c.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn1S3kNXBvJucF5J7hO0RDpvWksDzbiH7KEjtuo8E50bj-dsTziqbsRcD7XX1_B4DFIWZk5VuKHZvWhyphenhyphen5m9OLb5YhHqX8kUWtzSPdgit2dIyV_hEwonCIJrcXlSa7ewwB_lhYHe4B9aOM/s1600/c.png" height="217" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Shader frequency changing</td></tr>
</tbody></table>
<div style="text-align: left;">
and calculate <b>bumped shader</b> with our formula as:</div>
<div style="text-align: center;">
<b>1700 * 1.06 = 1802</b></div>
<div style="text-align: left;">
Here is used multiplication!!! So now, set Line 15, Tab 4 and 11 as 1802.</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYzj19oTdEczKbUCOAmzveEhMamo7DNsrGRwaC3YAQGJJazkjpa-Q8Q3WuhLNKQJmfynK-nEbx84c7kGiVVoP6L7-uFpJEO7hs4h4GfAN214geDljodorPnqKrOrns8DS8LUbcmqh8ICw/s1600/b.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYzj19oTdEczKbUCOAmzveEhMamo7DNsrGRwaC3YAQGJJazkjpa-Q8Q3WuhLNKQJmfynK-nEbx84c7kGiVVoP6L7-uFpJEO7hs4h4GfAN214geDljodorPnqKrOrns8DS8LUbcmqh8ICw/s1600/b.png" height="217" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Bumped Shader frequency changing</td></tr>
</tbody></table>
Click apply and save your new BIOS file as copy. Don't overwrite it! It can be handy. Now it's time for <b>flashing</b>. Let's say our new BIOS file is called new.rom. Copy new.rom to your USB flash drive and reboot your computer to FreeDOS. After that, run this command to <b>flash</b>:<br />
<br />
<b>C:\> NVFLASH.exe new.rom</b><br />
<br />
<div style="text-align: left;">
When asks, say "y". After all is done, reboot your computer and check your new <b>overclock</b>.</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrVMgBdz15znfsMRBdhm_M4aFeQQq0qeVXw2bvgTsAF6UvA6HXHMe2iGaG-cypQUMU8KX0nEdI8CYB5zHBLUJVA11QpztS6HNRW5kb0pfh5hO7ood8MZn-_aE-XwWObQL-LLAUWZiM7d8/s1600/nvidia2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrVMgBdz15znfsMRBdhm_M4aFeQQq0qeVXw2bvgTsAF6UvA6HXHMe2iGaG-cypQUMU8KX0nEdI8CYB5zHBLUJVA11QpztS6HNRW5kb0pfh5hO7ood8MZn-_aE-XwWObQL-LLAUWZiM7d8/s1600/nvidia2.png" height="224" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Overclocked card</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWGFKUuJv3a7XUBeOzmlja5etZIKw1FWvT4KDuVHcJjsigwck_6ZMDBR6aKsXr7kdk8cQ5sSRxnIjENv8xlVzE8MV6wiD_hd6uo74L0qeNpg3c7MTs_wylvzgDJuHJ1_6gdcCwHORhs5w/s1600/nvidia.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
If something go wrong, you can try "<b>blind flash</b>". I hope you let your old BIOS file on the USB. Reboot your computer and try to boot FreeDOS. It's hard becouse your propably wont see anything. When you think DOS is running, write command for <b>flashing</b> old BIOS. Something like:<br />
<br />
<b>C:\> NVFLASH.EXE old.rom</b><br />
<br />
Wait about 10 seconds, pres "y" and hit Enter. After 30 seconds, reboot your computer. Your old BIOS should be resotred. If it's not working, take your card to your friend, who has two PCIe slots, plug it in second slot and <b>flash </b>your BIOS using his card for display. Here is my original BIOS file and modified.<br />
<ul>
<li><a href="https://drive.google.com/file/d/0BxZnX9ax8dUOblUyQVROLXVyUG8/edit?usp=sharing" target="_blank">Original BIOS file</a> </li>
<li><a href="https://drive.google.com/file/d/0BxZnX9ax8dUOQWZUVWNsYnREa2c/edit?usp=sharing" target="_blank">Modified BIOS file</a> </li>
</ul>
If you have different <b>Fermi based GeForce</b>, you can experiment with values, but you can make your graphic card unusable if you set your <b>frequencies</b> too high. Try to google first some <b>safe</b> <b>frequencies</b> and <b>always use your brain</b>.<br />
<br />Anonymoushttp://www.blogger.com/profile/18016422744350935774noreply@blogger.com0tag:blogger.com,1999:blog-6926611571408258681.post-60258291971967911492014-02-26T16:00:00.001+01:002014-03-06T09:33:57.953+01:00How to cool your Raspberry PiRecently I've decided to make <b>HTPC</b> from my <b>Raspberry Pi</b>. After few hours of installing RaspBMC and configuring it, I found a huge problem. <b>Temperature</b>. When idling, CPU temperature reaches about 60°C. It's pretty high, mostly becouse I've got my <b>Pi overclocked</b> to 1GHz. I want it running 24/7, so it must be stable.<br />
<a name='more'></a><br />
At first, I bought passive cooler for CPU. It was very cheap (2.24$), from <a href="http://dx.com/p/copper-heat-sink-for-raspberry-pi-motherboard-red-copper-207119#.Uw362WeKwU4" rel="nofollow" target="_blank">DealExtreme</a>.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg86THpaLcA-CN1678QbpMKNwsgQreEZt_Ogbtdy3NJQ0RpsuDIVFpV1sxIiU8t0_EFfE-sZ1CcnYrJKwpma7EUKoynsramsrryIeeKgCzuxtjhvqsvDtOtQg9TK9MvGhl0z3cGkjaRV2Y/s1600/20140226_002.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg86THpaLcA-CN1678QbpMKNwsgQreEZt_Ogbtdy3NJQ0RpsuDIVFpV1sxIiU8t0_EFfE-sZ1CcnYrJKwpma7EUKoynsramsrryIeeKgCzuxtjhvqsvDtOtQg9TK9MvGhl0z3cGkjaRV2Y/s1600/20140226_002.jpg" height="240" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Passive cooler on CPU</td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia_0jYsDM6OsmMJy-cTKqz2YpywL1-0LWC5C6FEpLcx3mPZInpP-sBhfxMKIEH9KDJvEQiKmm2xJDxL4-dX8usuK0G21YYqXYUlxX-FVxKCX8VjKtfWjfxgkKLQ74v4Vq7uYa5hUHulb4/s1600/20140226_006.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<br />
That cheap coller lower the temperature about 8°C. It was pretty good, but not enough for me. I've found an old ArcticCooling fan. At first, I've soldered it with 12V DC power adapter. It was very loud. Everyone want's silent <b>HTPC</b>, not loud like blender. After that bad idea, I've grabed old USB cable and cut the mini USB end. USB port has 5V voltage, so it is really great for powering fan at low speeds. After you cut the cable, you need only red and black wire. Red is +5V and black is 0V. Solder red wire from fan with red wire from USB cable and black with black. Now you have fully working <b>USB fan</b>.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVDUdDyHrzff-hpFPnpZMiGAT6D-v92JohqvRNhXGt2iD0XkwtZ7eqFaY8La6AcGBKIQXHbZ-YXV1L2GsclZ0_4fLegyyAQprUiOCJ4OTg2ysN7SWgxqqJD1O68mLS9HdonCzUzbfNiF8/s1600/20140226_003.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVDUdDyHrzff-hpFPnpZMiGAT6D-v92JohqvRNhXGt2iD0XkwtZ7eqFaY8La6AcGBKIQXHbZ-YXV1L2GsclZ0_4fLegyyAQprUiOCJ4OTg2ysN7SWgxqqJD1O68mLS9HdonCzUzbfNiF8/s1600/20140226_003.jpg" height="240" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">USB fan</td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<br />
<br />
After all that work, I've had only one problem. How to mount it to the <b>Pi</b>. I've grabbed 4 screws (M4) and attached them to the fan. They are high enough for fan to not to touch <b>Pi</b>. I used a duct tape on them for sure, someone can accidently put them on <b>GPIO</b> or something on <b>Pi</b> and you know what can happen.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYgTc4gw0jXOlIR16LbOWl6NiQVcf-O3dB0GBn4n9RCcE1WsrDXivGg0xg2XRNaTJZF7POXGlDxw5No3Y4XC9igxgUC5MEktmlQKC515VTmzcXiJRdwyhLYxqk-9XmiHXSnpEkV8D2tJs/s1600/20140226_004.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYgTc4gw0jXOlIR16LbOWl6NiQVcf-O3dB0GBn4n9RCcE1WsrDXivGg0xg2XRNaTJZF7POXGlDxw5No3Y4XC9igxgUC5MEktmlQKC515VTmzcXiJRdwyhLYxqk-9XmiHXSnpEkV8D2tJs/s1600/20140226_004.jpg" height="240" width="320" /></a></div>
<br />
<br />
Now my <b>Pi</b> is running at 23°C and is absolutely quiet. Next I am going to make my own <b>aluminium case</b> from old <b>FDD holder</b>. Stay tuned.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyUG28umPcnY303jVygF7u8Mdyt9cVNXuWjSGCzwI4TVM0eePydCzL3OxnkP8oA_BXKiALS4mwBbnAojvjafgbgB-oEtluhH8sKPGDsr4Ywdi4BOJj9POEYGDre1znoCZA3T3Qu5v_Mtg/s1600/20140226_006.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyUG28umPcnY303jVygF7u8Mdyt9cVNXuWjSGCzwI4TVM0eePydCzL3OxnkP8oA_BXKiALS4mwBbnAojvjafgbgB-oEtluhH8sKPGDsr4Ywdi4BOJj9POEYGDre1znoCZA3T3Qu5v_Mtg/s1600/20140226_006.jpg" height="240" width="320" /></a></div>
<br />Anonymoushttp://www.blogger.com/profile/18016422744350935774noreply@blogger.com0