Linux Laptop Battery Optimization And Using Encryption With Dropbox

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!

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 free #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

#Powertop sudo apt-get install -y powertop; sudo powertop #Laptop-Mode 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 #ENABLE_AUTO_MODULES=1 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: indicator-cpufreq& #Fan Speed http://blog.burntsushi.net/lenovo-thinkpad-t430-archlinux #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 *VGASwitcheroo /etc/rc.local: echo 'OFF' > /sys/kernel/debug/vgaswitcheroo/switch # Disables discrete graphics

#Lightweight Desktop Environment i3 http://i3wm.org/ LXDE http://lxde.org/ #Low Power OS WattOS - http://www.planetwatt.com/blogs/1/15/watt-os-r6-new-release-info

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." Feedback

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 hak5.org 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.