This time on the show, optimizing your Linux install for better battery life - Darren reports. Then, Encrypt all the things! I'm setting up local encryption volumes that play well with cloud sync services like spideroak and dropbox. Plus, RSS podcasts from YouTube - is it possible? All that and more, this time on Hak5!


Download HD | Download MP4


Linux Laptop Battery Optimizations

#Upgrade to SSD and Optimize
make a backup of your fstab
sudo cp /etc/fstab{,.bak}disable writing last access time and enable TRIM by adding "noatime,nodirtime,discard" to drive options in /etc/fstab
#Don't use swap until physical memory is full.
sudo cat /proc/sys/vm/swappiness
sudo echo 0 > /proc/sys/vm/swappiness
#add to rc.local and check free memory
#Create RAM disk for temp filesystem
df -h
#Find avail for tempfs, now edit /etc/fstab and add
tmpfs /tmp tmpfs defaults,noatime,size=512M,mode=1777 0 0
tmpfs /var/spool tmpfs defaults,noatime,size=512M,mode=1777 0 0
tmpfs /var/tmp tmpfs defaults,noatime,size=512M,mode=1777 0 0
# If you don't care about log files after reboots
tmpfs /var/log tmpfs defaults,noatime,size=512M,mode=0755 0 0
# the mode is the file permission. this is a single user system
# size=512M - size isn't allocated immediately, used as needed

sudo apt-get install -y powertop; sudo powertop
Prevents HDD from spinning up constantly - allows it to sleep by buffering write in memory
#Configured by laptop-mode-tools
sudo apt-get install laptop-mode-tools
Configured by /etc/laptop-mode/laptop-mode.conf

I have a solid-state disk (SSD) in my machine. Should I enable any of the disk-related parts of laptop-mode-tools, or are they irrelevant?
They may be relevant, because (a) laptop mode will reduce the number of writes, which improves the lifetime of an SSD, and (b) laptop mode makes writes bursty, which enables power saving mechanisms like ALPM to kick in. However, your mileage may vary depending on the specific hardware involved. For some hardware you will get no gain at all, for some the gain may be substantial.

#LMT is not just for the storage device. It covers almost all I/O Controller devices on your box.
And for SSDs, yes, there’s no need to spin down. But for long, LMT has had the ability to detect a SSD device and just skip it.
Verify that its enabled
sudo cat /proc/sys/vm/laptop_mode

#enable latop-mode with:
sudo update-rc.d laptop-mode defaults

#CPU Frequency
The CPU frequency scaling indicator shows you the current speed of your CPU and lets you control its policy – for example, you can force a certain CPU speed, enable power-saving mode, or enable high-performance mode.
sudo apt-get install indicator-cpufreq
#Launch the indicator by running the following command after installing it:
#Fan Speed
#This is specific to the Thinkpad T430 though thinkfan may work for your machine
cat /proc/acpi/ibm/fan
cat /sys/devices/virtual/thermal/thermal_zone0/temp
sudo apt-get install thinkfan
sudo touch /etc/modprobe.d/thinkfan.conf
sudo nano /etc/modprobe.d/thinkfan.conf

#add the following
options thinkpad_acpi fan_control=1
#edit the /etc/thinkfan.conf file
sudo nano /etc/thinkfan.conf
echo 'OFF' > /sys/kernel/debug/vgaswitcheroo/switch
# Disables discrete graphics

#Lightweight Desktop Environment
#Low Power OS
WattOS -

Encrypt Cloud Storage with EncFS

Trust No One Approach
TrueCrypt container - good, complicated, reuploads the whole container if there is a change.
EncFS - creates an encrypted file for each file that you upload. Only reuploads that one file for a change.
Install on Ubuntu with: sudo apt-get install encfs
To create a new encrypted volume: encfs ~/Dropbox/encrypted ~/Private - this creates the encrypted folder in dropbox, and the private folder where you will be able to access decrypted files.
Choose paranoia mode or expert mode upon setup.
Create a password that you will always remember.
To Use:
Place files in the Private folder. Dropbox will sync an encrypted version in the dropbox/encrypted folder. You can use the encfs command on multiple comps to use encrypted files on each comp.
Ignore the encrypted folder- don't place files in there- else they won't be encrypted. Don't delete or lose the encfs.xml file- this is your key to acces encrypted files.
Run encfs command upon restart or next log in- this ensures others cant access files unless they have your pw for encfs. If Private looks empty, encfs isn't mounted.
Use gnome-encfs to automatically mount encfs for each log in."


Nathan says: I've been watching hak5 for over a year now, and love the show. Today, I noticed that while using Comodo's 'secure DNS' I got a warning page, that prevented me from getting to Needless to say, I changed the DNS settings on my computer. (just had them for testing in the first place..)

Yoram says: I usually download Hak5 episodes via iTunes, and watch them offline. Is there a way to load ThreatWire episodes via iTunes (I.e. - is there an RSS)? If not - I there a way hack something? Looking forward to following another great show of yours.

Leave a Reply

Your email address will not be published. Required fields are marked *



  • Yo guys love the show! For better battery performance could you not actually have no hard disk at all and just run the optimised OS off of a USB? Surely this would save a couple of Watts as the USB is usually running over the south-bridge right? (This may vary depending on the architecture of the machine though I guess). Also, if you have any optical drives, removing them could save some Watts. :)

  • Mnemonic 3 years ago is what I like to use for saving clips.

  • Brent 3 years ago

    Just an FYI there is a typo in the show notes:
    “nodirtime” should be “nodiratime”

  • There is nice gui for encfs on linux also, cryptkeeper, founds on ubuntu repository.

  • For power management on the finger tips on my laptop I use an app called jupiter. you can find it on Ubuntu reps.
    I am using Mint 14 on an ACER5830GT, and after doing all the stuff from this episode, plus using jupiter and bumblebee to manage the second video card (NVIDIA GT520M), I got to 13W, but I have 2 drives one SDD for the OS’s and one HDD for data.
    Another tip is keep the brightness low, this saves me 1.5 W. The wireless is still the vilan with around 2 to 3 watts.
    Keep up the good work.

  • This is exactly what I’ve been looking for. Switched to Linux Full time and the power management was driving me A little crazy.

  • EazyVG 2 years ago

    A very good video and overview with tips.

    FYI: I am currently running kernel 3.4.28 (openSUSE 12.2) and my battery consumption is quite good (tip: #powertop tunables=good), idling at around 7-8W with screen @60% and Wireless=On.
    Apart from powertop tunables, no other tweaks.

  • James 2 years ago

    Was reading up on fsab and found that the noatime option in fstab will enable nodiratime function as well. Putting in both is redundant.

    nodiratime = disables writes on directories but not files.
    noatime = disables writes for both files and directories.


  • rakudave 2 years ago

    Warning: When using a tmpfs for /var/spool your crontab will disappear every time you reboot. Took me some time to realize why my crontab was misteriously vanishing from time to time (they are stored in /var/spool/cron/crontabs/, at least in *buntu).

  • Hello there, just became alert to your blog through Google, and found that it is truly informative.
    I am gonna watch out for brussels. I’ll be grateful if you continue
    this in future. Lots of people will be benefited from your writing.

  • This site was… how do I say it? Relevant!!
    Finally I’ve found something which helped me.
    Appreciate it!

  • ?h?t’s up, I want to subscribe f?r this web site to
    ?et late?t updates, th?refore ?here can ? d? it please assist.

  • In nevertheless, you may possess some options for financing a car or truck even if you already
    went through bankruptcy cna salary ri your credit history score plays an crucial role in procuring
    any loan.

  • Powerful feelings release powerful energy fields
    some of which can linger for a long time unless they’re cleared
    Married NYC Offers if you’re saying, “i have poor credit and debt,” loans
    for a bad credit score borrowers could be your very best bet.

  • Great article, just what I wanted to find.

  • Hi there! Quick question that’s totally off
    topic. Do you know how to make your site mobile
    friendly? My website looks weird when browsing from my
    iphone4. I’m trying to find a template or plugin that might be able to correct this problem.
    If you have any suggestions, please share. Thank

  • With Internet Banking, you are able to view your money and Credit Card historyof earlier times 1 year Myrtis
    Vandell this might help you obtain the money you will
    need because you happen to be dealing with real people instead of the company.