<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Notify-Send on Karpoke - Just Another Blog</title><link>http://karpoke.ignaciocano.com/tags/notify-send/</link><description>Recent content in Notify-Send on Karpoke - Just Another Blog</description><generator>Hugo -- 0.159.0</generator><language>es</language><lastBuildDate>Sat, 31 May 2014 13:27:00 +0100</lastBuildDate><atom:link href="http://karpoke.ignaciocano.com/tags/notify-send/index.xml" rel="self" type="application/rss+xml"/><item><title>Enviar y reicibir notificaciones de Telegram desde la línea de comandos</title><link>http://karpoke.ignaciocano.com/2014/05/31/enviar-y-reicibir-notificaciones-de-telegram-desde-la-linea-de-comandos/</link><pubDate>Sat, 31 May 2014 13:27:00 +0100</pubDate><guid>http://karpoke.ignaciocano.com/2014/05/31/enviar-y-reicibir-notificaciones-de-telegram-desde-la-linea-de-comandos/</guid><description>&lt;p&gt;Utilizando &lt;a href="http://github.com/vysheng/tg"&gt;tg&lt;/a&gt;, podemos enviar y recibir mensajes de nuestros
contactos en Telegram, incluyéndonos a nosotros mismos, desde el
terminal.&lt;/p&gt;
&lt;h2 id="envíos-programados"&gt;Envíos programados&lt;/h2&gt;
&lt;p&gt;Combinándolo con &lt;code&gt;expect&lt;/code&gt;, conseguiremos una forma sencilla de programar
notificaciones.&lt;/p&gt;
&lt;p&gt;He aquí un pequeño ejemplo:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;#!/usr/bin/env bash
&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex="0"&gt;&lt;code&gt;function tg {
# First argument, if any, must be the receiver
local to=&amp;#34;$1&amp;#34;
local msg=&amp;#34;&amp;#34;
local cmd=&amp;#34;&amp;#34;
if [ $# -gt 1 ]; then
shift 1
msg=&amp;#34;$@&amp;#34;
else
while read line; do
if [ -z &amp;#34;$msg&amp;#34; ]; then
msg=$line
else
msg=&amp;#34;$msg\n$line&amp;#34;
fi
done
if [ -z &amp;#34;$to&amp;#34; ]; then
to=$(awk &amp;#39;{print $1}&amp;#39; &amp;lt;&amp;lt;&amp;lt; $msg)
msg=$(awk &amp;#39;{$1=&amp;#34;&amp;#34;;print $0}&amp;#39; &amp;lt;&amp;lt;&amp;lt; $msg)
fi
fi
if [[ $msg =~ &amp;#34;\n&amp;#34; ]]; then
file=$(mktemp)
echo -e &amp;#34;$msg&amp;#34; &amp;gt; $file
cmd=&amp;#34;send_text $to $file&amp;#34;
else
cmd=&amp;#34;msg $to $msg&amp;#34;
fi
#echo $cmd
expect -c &amp;#34;
log_user 0
match_max 100000
spawn /path/to/telegram -k /path/to/tg-server.pub
expect \&amp;#34;User \&amp;#34;
send -- \&amp;#34;$cmd\r\&amp;#34;
expect \&amp;#34;Sent\&amp;#34;
send \&amp;#34;quit\&amp;#34;
&amp;#34;
}
tg $@
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Algunos ejemplos de uso:&lt;/p&gt;</description></item><item><title>La batería del portátil</title><link>http://karpoke.ignaciocano.com/2010/09/26/la-bateria-del-portatil/</link><pubDate>Sun, 26 Sep 2010 00:10:00 +0100</pubDate><guid>http://karpoke.ignaciocano.com/2010/09/26/la-bateria-del-portatil/</guid><description>&lt;p&gt;Algunos &lt;a href="http://www.macoteca.com/falsos-mitos-de-las-baterias/90/"&gt;falsos mitos de las baterías del portátil&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Es necesario que se agote la batería para ponerla a cargar,&lt;/li&gt;
&lt;li&gt;no se debe dejar el portátil siempre enchufado a la corriente,&lt;/li&gt;
&lt;li&gt;ni se debe suspender conectado a la corriente.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;También existen técnicas para &lt;a href="http://www.macoteca.com/rejuvenece-la-bateria-de-tu-portatil/94/"&gt;alargar la vida de la batería&lt;/a&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;enchufa el portátil (y enciéndelo, si quieres) hasta que la batería&lt;/li&gt;
&lt;/ol&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;este cargada y déjalo cargando 2 horas más,
&lt;/code&gt;&lt;/pre&gt;&lt;ol start="2"&gt;
&lt;li&gt;desenchufa el portátil y espera a que se gaste la batería e hiberne&lt;/li&gt;
&lt;li&gt;enchufa el portátil sin encenderlo hasta que se cargue la batería&lt;/li&gt;
&lt;li&gt;realizar estas operaciones cada 2 ó 3 meses&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;En principio, las baterías de los portátiles &lt;em&gt;ya&lt;/em&gt; incorporan un
mecanismo que corta la corriente cuando éstas están totalmente cargadas,
evitando así la fatiga por la carga continua.&lt;/p&gt;</description></item></channel></rss>