<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Bash on falkp.no/blog</title>
    <link>/blog/tags/bash/</link>
    <description>falkp.no/blog (Bash)</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    
      

      
    

    
    <lastBuildDate>Tue, 31 May 2016 00:00:00 +0000</lastBuildDate>
    
    <atom:link href="/blog/tags/bash/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Using finger service the wrong way</title>
      <link>/blog/posts/using_finger_service_the_wrong_way/</link>
      <pubDate>Tue, 31 May 2016 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/using_finger_service_the_wrong_way/</guid>
      <description>&lt;h2 id=&#34;overview&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#overview&#34;&gt;
        #
    &lt;/a&gt;
    Overview
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;If you&amp;rsquo;re doing this, you&amp;rsquo;re doing it wrong&amp;hellip;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;2016-05-31 10:19:45.493314 Client 92.x.x.192 hamburg, germany/hamburg/hamburg
2016-05-31 10:19:48.443380 Client 74.x.x.189 greensboro, united_states/north_carolina/greensboro
2016-05-31 10:19:56.733260 Client 50.x.x.50 beaverton, united_states/oregon/beaverton
2016-05-31 10:19:56.745653 Client 50.x.x.50 beaverton, united_states/oregon/beaverton
2016-05-31 10:19:56.759656 Client 50.x.x.50 beaverton, united_states/oregon/beaverton
2016-05-31 10:19:56.819283 Client 50.x.x.50 beaverton, united_states/oregon/beaverton
2016-05-31 10:20:16.287744 Client 5.x.x.13 kaiserslautern, germany/rhineland-palatinate/kaiserslautern
2016-05-31 10:20:35.182942 Client 85.x.x.140 katowice, poland/silesia/katowice
2016-05-31 10:20:47.029550 Client 193.x.x.226 oslo, norway/oslo/oslo/oslo
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Lots of people use the finger service &lt;strong&gt;@graph.no&lt;/strong&gt; in an automated way. That&amp;rsquo;s quite alright, it&amp;rsquo;s what it&amp;rsquo;s there for. As an example:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;sd_full.jpg&#34; alt=&#34;@graph.no used in an automated way at the Computer Science department at the KIT Karlsruhe&#34;&gt;&lt;/p&gt;
&lt;p&gt;But if you&amp;rsquo;re asking for the same data five times a second (until you get blocked by my firewall for a minute), you have to check your code. The data is at best changing every ~30 minutes.&lt;/p&gt;
&lt;p&gt;A likely scenario is putting it in &lt;strong&gt;screen&lt;/strong&gt;/&lt;strong&gt;tmux&lt;/strong&gt; status line. If you do that, you need to change how often your terminal multiplexer is updating the status line. A better way is to have a cron script fetching the data, and storing it in i.e. &lt;code&gt;/tmp/weather&lt;/code&gt; every 30-60 minutes, and then have your status line read from that.&lt;/p&gt;
&lt;p&gt;Another scenario could be people running it in &lt;strong&gt;watch&lt;/strong&gt;, which by default updates every two seconds. Also wrong. Please use -n 600 more.&lt;/p&gt;
&lt;p&gt;If you fetch the data, and &lt;strong&gt;grep&lt;/strong&gt; out what you need, then fetch the data once, and &lt;strong&gt;grep&lt;/strong&gt; all you like. Don&amp;rsquo;t fetch for each &lt;strong&gt;grep&lt;/strong&gt;. An example of this can be seen in the client &lt;a href=&#34;https://github.com/ways/pyyrascii/blob/master/graph.sh&#34;&gt;graph.sh&lt;/a&gt;, which fetches the data, &lt;strong&gt;sed&lt;/strong&gt; a lot and present it using unicode weather symbols and colors.&lt;/p&gt;
&lt;p&gt;Feel free to contact me if you need scripts/examples or have questions.&lt;/p&gt;
&lt;p&gt;Also, don&amp;rsquo;t feel ashamed, beaverton, you&amp;rsquo;re not alone in hammering me. I just don&amp;rsquo;t have any way to contact users. I still love you all. =)&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>photOS 2.0 - a better photo frame</title>
      <link>/blog/posts/photos2/</link>
      <pubDate>Mon, 17 Feb 2014 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/photos2/</guid>
      <description>&lt;h2 id=&#34;overview&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#overview&#34;&gt;
        #
    &lt;/a&gt;
    Overview
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;This is about improving photOS, mentioned in &lt;a href=&#34;http://0p.no/2014/02/14/photos1.html&#34;&gt;http://0p.no/2014/02/14/photos1.html&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When building this, price wasn&amp;rsquo;t a factor. If you want something cheap, you can still use this software with an old laptop or other recycled hardware.&lt;/p&gt;
&lt;p&gt;The display from Chalkboard Electronics is beautiful. Good resolution (not extreme resolution, though), good contrast, nice colors. And it supplies power for the RPi. Unfortunately it&amp;rsquo;s hard to attach stuff to it. There are nothing but smooth surfaces.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;backside.jpg&#34; alt=&#34;Backside of screen.&#34;&gt;&lt;/p&gt;
&lt;p&gt;All taped up to hide backlight. What you see is a rpi, a 4-port usb hub, a thumb drive (for keeping photos on) and the power board for the display.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;top.jpg&#34; alt=&#34;From above.&#34;&gt;&lt;/p&gt;
&lt;p&gt;Using some cardboard to keep everything together. Also makes for a decent foot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;done.jpg&#34; alt=&#34;Finished product.&#34;&gt;&lt;/p&gt;
&lt;p&gt;Done and placed on the table. The photo doesn&amp;rsquo;t do the screen justice.&lt;/p&gt;
&lt;h2 id=&#34;hardware&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#hardware&#34;&gt;
        #
    &lt;/a&gt;
    Hardware
&lt;/div&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://raspberrypi.org&#34;&gt;Raspberry Pi&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.chalk-elec.com/?page_id=1280#!/~/product/category=3094861&amp;amp;id=14647624&#34;&gt;10&amp;quot; Touch screen&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Cover made of cardboard and tape.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;software&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#software&#34;&gt;
        #
    &lt;/a&gt;
    Software
&lt;/div&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/ways/photOS&#34;&gt;photOS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;features&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#features&#34;&gt;
        #
    &lt;/a&gt;
    Features
&lt;/div&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Sync files from &lt;a href=&#34;http://owncloud.org&#34;&gt;ownCloud&lt;/a&gt;, a free, selfhosted alternative to Dropbox.&lt;/li&gt;
&lt;li&gt;Display local images in a slideshow.&lt;/li&gt;
&lt;li&gt;Display images from web. I.e. webcams, weather reports, RSS feeds.&lt;/li&gt;
&lt;li&gt;Display images from reddit, i.e. lates from r/newsporn, r/wallpapers, etc.&lt;/li&gt;
&lt;li&gt;Stream video, i.e. from baby monitor, live webcams.&lt;/li&gt;
&lt;li&gt;Display websites, i.e. news.&lt;/li&gt;
&lt;li&gt;Display recent images (from ownCloud), by looking at date in Exif.&lt;/li&gt;
&lt;li&gt;Turn off LCD at night.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is my current crontab, to show how I&amp;rsquo;m using it:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;MAILTO=****
# m h  dom mon dow   command

PHOTOS=/home/pi/photOS

#Sync owncloud
#27 7-18 * * *  ${PHOTOS}/helpers/sync-owncloud.sh

#Morning
0 6 * * *       ${PHOTOS}/helpers/powersave.sh 1; ${PHOTOS}/web/weather.sh
0 7    * * *    ${PHOTOS}/web/website.sh &amp;#34;http://nrk.no/tekst-tv/100/&amp;#34;

#Normal photo display
0  9-16 * * *   ${PHOTOS}/helpers/kill.sh; ${PHOTOS}/photos/slideshow.sh

#Display weird images from the net
0 17 * * *      ${PHOTOS}/helpers/kill.sh; ${PHOTOS}/photos/slideshow.sh $( ${PHOTOS}/web/rss-images.sh 50 )

#Baby monitor streaming
0 19,21 * * *   ${PHOTOS}/helpers/kill.sh; $PHOTOS/streams/cvlc.sh http://192.168.1.84:8081

#Night
0 1 * * *       ${PHOTOS}/helpers/powersave.sh 0; ${PHOTOS}/helpers/kill.sh;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;challenges&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#challenges&#34;&gt;
        #
    &lt;/a&gt;
    Challenges
&lt;/div&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The screen has no attachments. I&amp;rsquo;ve currently just taped the RPi to the back, which works but isn&amp;rsquo;t very beautiful and will break down. See &amp;ldquo;Plans&amp;rdquo;.&lt;/li&gt;
&lt;li&gt;LXDE, the default window manager on Raspbian, has no multitouch support. The image viewer, feh, has no gesture support. I&amp;rsquo;ve looked at a few ways to use touch, but hasn&amp;rsquo;t decided on anything yet. See this &lt;a href=&#34;http://www.reddit.com/r/raspberry_pi/comments/1wzeku/how_to_use_touch_capabilities/&#34;&gt;Reddit post&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Feh is somewhat lacking in rotating photos correctly.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;plans&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#plans&#34;&gt;
        #
    &lt;/a&gt;
    Plans
&lt;/div&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Use touch capabilities.&lt;/li&gt;
&lt;li&gt;3d printed or CNCed enclosure.&lt;/li&gt;
&lt;li&gt;Display photos related to this date. I.e. if christmas, display photos from past christmases.&lt;/li&gt;
&lt;li&gt;Look for better image viewer.&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
  </channel>
</rss>
