PaPer - Paranoies Personals - Blog d'en Sergi Pons Freixes » Debian http://www.cub3.net/blog Pensaments, idees, i altres paranoies que em pasen pel cap. Mon, 20 Jan 2014 09:43:16 +0000 en-US hourly 1 http://wordpress.org/?v=4.2.7 Improving battery life http://www.cub3.net/blog/improving-battery-life/ http://www.cub3.net/blog/improving-battery-life/#comments Sun, 10 Jun 2012 17:20:38 +0000 http://www.cub3.net/blog/?p=835 For sure you have heard or read, at least once, recommendations about how to improve the battery life of a laptop, mobile phone, or whatever gadget.  But I’ve detected that several times that recommendations are wrong, and they do more harm than benefit to a laptops battery. That’s because battery technology has been changing along the years, and the methods of taking care of them also. So, I’ll try to summarize some of the most basic up-to-date tips to increase the life of a laptop’s battery. Before applying them, just check that you battery is of lithium-ion (Li-ion) type.

Li-ion battery

The tips of this post are only applicable to Lithium-ion batteries.

PowerTOP

The easiest and faster way of improving the power efficiency of the laptop, is at software level. With the PowerTOP application we can not only monitor which software is responsible of our CPU cycles and hard disk spinning, but also  (and more important) tune several parameters related with the energy. For example, enable the auto-suspend of an external USB device when not in use, or an energy saving feature of the wireless card.

PowerTOP screenshot

That’s the PowerTOP tunables section on my laptop, with some settings not optimized.

After playing with it, you will probably notice that the settings are not saved, and after rebooting you have to run PowerTOP and set everything again. Solution: if you run PowerTOP with the –html option, it will generate an HTML (surprise!) report with all the command line instructions to set each tunable. So, then you only have to add these commands to an init script (for example, /etc/rc.local on Arch Linux), and you’re done!

Just a last tip: do not enable autosuspend for an external mouse… it’s really annoying.

Charging cycle

If you are like me and usually run your laptop connected to AC, your battery it’s probably almost always charged at 100%. This is not good. But but be optimal, is having it charged at max of ~85%, and then let it discharge by its own until it reaches ~35%.  About “telling” you laptop to follow this charging cycle, I only know how to do it with Thinkpads, which is setting:

echo 40 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
echo 80 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh

 

having Tp smapi installed. Details about how to implement it on a script can be found on the ArchWiki.

Actually, the best way of keeping a battery in an optimum state, when not in use, is having it at 40% of it’s charge and storing it on the fridge. If you try that, please put it on a sealed plastic bag, with some rice to absorb humidity!

 

 

 

 

]]>
http://www.cub3.net/blog/improving-battery-life/feed/ 0
Google services alternatives http://www.cub3.net/blog/google-services-alternatives/ http://www.cub3.net/blog/google-services-alternatives/#comments Wed, 29 Feb 2012 09:52:19 +0000 http://www.cub3.net/blog/?p=564 I’ve been a heavy Google services user. I used on a daily basis Google Search, Gmail, Google Calendar, Picasa, Google Reader and Google Maps. And as I stated before, this dependency is not good, so eventually I got rid of it. On this post I want to explain the alternatives I’m currently using, and how happy I am with them. It could have been a “30 days without Google”, but it has been more than 30 days since I’ve been living with not-so-much-Google-in-my-life and I didn’t a detailed follow-up of the migration process, so it was a bit out for this title.

Alternative to Google Search

There is not much to explain here, as I’ve dedicated a whole post to this topic. The more I use Duck Duck Go, the happier I am with it. Particularly because it is quite easy to change between a world wide search or a local (country) search. I use the former for general queries like programming issues, info about books, etc., and the other when looking for restaurants, leisure activities, etc.

Alternative to Google Maps

This one is a bit tricky. I have to admit that Google Maps offers better search capabilities than its main competitors: Open Street Map, Yahoo! Maps, and Bing Maps. You can misspell the name of a business or just provide some keywords, and it will try to find the best match.

Yahoo! Maps sample

But (there is usually a but), I like quite much the “art” of Open Street Map, because it reminds me paper maps and some bonuses like detailing the exact position of the underground entrances (which Google doesn’t, just the approximate location of the station). So, sometimes I use one, and sometimes the other.

Alternative to Gmail

There was not much sense on switching to Hotmail, Yahoo or any other company if privacy was an issue. More or less they all share the same practices. So, the best solution was having my own mail server. I have a modest VPS on Linode, so I set-up the server as you can see on this guide. Therefore, I have an IMAP server which I can use with Thunderbird or when in roaming with the nice Roundcube webmail.

The only lacking functionality is server-side filtering, which I still have to set-up (if you know a way to extend a day to more than 24 hours, please tell me!). I could live with client-side filtering on Thunderbird, but I also want to enjoy it when using the webmail interface.

Alternative to Google Calendar

Having already a mail server, why do not have a calendar server? I took the same approach, and set-up a calendar server using CalendarServer which I can sync with Thunderbird and my iPhone. For even more functionality, I added a web interface with AgenDAV. This time, there is not any feature missing.

Alternative to Google Reader

I wanted to use my feed aggregator on several computers, so setting up a desktop client on each one and trying to get all of them synced was not a viable option. Therefore, I opted for an in-the-cloud solution with a web interface, as Google Reader is. And again, my server comes to rescue! I liked what I saw on Tiny Tiny RSS webpage, I installed it, and I’m very happy with how if works. Nothing to be jealous from Google Reader. It even have a mobile-optimized interface, so it’s not a hassle to check it from the phone.

Alternative to Picasa

To make it clear, I didn’t check the terms of service of Flickr and other providers. I suppose they’re good enough because they’re used by several artists, but I decided to choose the hard way: build my own web gallery. I found Piwigo, with all the features I was looking for and with enough eye-candy to please me. So, after one afternoon of work, I had it working on my server.

Conclusions

I realize that all the options I’m using are not an option for everybody, because of the simple fact that you need your own server and set it up. This simplify the issue to your priorities. If you want privacy and company-independence, learn how to do it or pay somebody to do it for you. If you don’t care, you can just keep using the free services.

Up to now, and after a heavy use of it, I’m very happy with the decision I’ve taken. It has also been useful to learn some new things, and as learning is fun, it has been a nice leisure activity. Mmm, maybe they’re right when they call me geek :P

]]>
http://www.cub3.net/blog/google-services-alternatives/feed/ 0
Simple virtual user mail system on Debian http://www.cub3.net/blog/simple-virtual-user-mail-system-on-debian/ http://www.cub3.net/blog/simple-virtual-user-mail-system-on-debian/#comments Sun, 05 Feb 2012 20:21:01 +0000 http://www.cub3.net/blog/?p=554 On this post I will explain how to set-up an  e-mail server on Debian using Postfix, Cyrus, Courier, PAM, PostfixAdmin and Roundcube. I’m not going to explain nothing completely new or revolutionary neither reinvent the wheel. To be clear, what I did to implement the server was following this guide: Simple Virtual User Mail System. But, it’s for Arch Linux, so if we want it to work on Debian there are several changes that we have to take into account. So, instead of repeating everything, I will just highlight the changes.

Installation

The packages I installed were:

gamin postfix postfix-mysql courier-imap courier-imap-ssl libsasl2-2 libsasl2-modules php-auth-sasl sasl2-bin libpam-mysql

I think that these are enough (with its dependences) to get a working system. I’m not 100% sure because I documented this part a posteriori, after playing a bit around installing/uninstalling things.

Configuration

Postfix

On /etc/postfix/master.cf I used:

submission inet n - - - - smtpd
 -o smtpd_tls_security_level=encrypt
 -o smtpd_sasl_auth_enable=yes
 -o smtpd_client_restrictions=permit_sasl_authenticated,reject
 -o milter_macro_daemon_name=ORIGINATING

The file /etc/postfix/transport did not exist, so before

postmap /etc/postfix/transport

I did

touch /etc/postfix/transport

Courier

All the references to

/etc/authlib/

and

/etc/courier-imap/

must be changed to

/etc/courier/

On /etc/courier/authdaemonrc, instead of

MYSQL_MAILDIR_FIELD maildir

we must use

MYSQL_MAILDIR_FIELD     concat('/home/vmail/',maildir)

Cyrus

Instead of editing /etc/conf.d/saslauthd we have to edit /etc/default/saslauthd to say:

START=yes
MECHANISMS="pam"
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"

Instead of /usr/lib/sasl2/smtpd.conf we have to edit /etc/postfix/sasl/smtpd.conf to:

pwcheck_method: saslauthd
 mech_list: plain login
 saslauthd_path: /var/run/saslauthd/mux
 log_level: 7

Rouncube

To make the directories writable to the server, we have to use:

chown -R www-admin:www-admin temp logs

rc.conf

There is no rc.conf to control boot services on Debian. All the services installed on this guide are automatically startup at bootup, so nothing to do here.

The end

And that’s all. With that we should have a working mail server, using MySQL to store user’s info, mail storage on the filesystem, PostfixAdmin to manage accounts and aliases and a nice webmail with Roundcube.


 

 

]]>
http://www.cub3.net/blog/simple-virtual-user-mail-system-on-debian/feed/ 0