Showing posts with label configuration. Show all posts
Showing posts with label configuration. Show all posts

Friday, November 8, 2013

Use SSH Keys (public key cryptography) to connect on your LAN

Learning by example: (and borrowing from the Arch wiki)

I want to connect to my desktop from my htpc.
Assuming that openssh is installed and the daemon is running, and that /etc/ssh/sshd_config is configured to your satisfaction.

Issue the following command to create a 521 bit long public/private ECDSA key pair with an extended comment on the HTCP.

htpc $ ssh-keygen -t ecdsa -b 521 -C "$(whoami)@$(hostname)-$(date -I)"

Authorized_keys file

In order to connect from the htpc, the desktop must have a copy of the htpc's public key in its ~/.ssh/authorized_key file. Use whatever method you have available to get a copy of the id_ecdsa.pub to the desktop.

desktop $ scp david@htpc:/home/david/.ssh/id_ecdsa.pub /home/david/tmp

Then import this public key into the ~/.ssh/authorized_keys file.

desktop $ cat ~/tmp/id_ecdsa.pub >> ~/.ssh/authorized_keys
desktop $ rm ~/tmp/id_ecdsa.pub


Known_hosts

Upon your first connection to the desktop, you will see the following

htpc $ ssh david@desktop
The authenticity of host 'desktop (192.168.1.110)' can't be established.
ECDSA key fingerprint is 61:3e:e6:40:29:d7:d8:dc:db:f8:0b:d9:74:c5:d6:6f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'desktop,192.168.1.110' (ECDSA) to the list of known hosts.
Enter passphrase for key '/home/david/.ssh/id_ecdsa':

This creates an entry in /home/david/.ssh/known_hosts which will allow connections to desktop.

Saturday, October 26, 2013

Shepherd cron job for MythTV

This cron job is run as my regular user, the same one who uses MythFrontend

$ crontab -l
36 * * * * nice ~/.shepherd/shepherd --daily --quiet && nice /usr/bin/mythfilldatabase --update --file --sourceid 1 --xmlfile ~/.shepherd/output.xmltv --quiet 2>&1> /dev/null

Monday, September 23, 2013

my .conkyrc file

# Conky, a system monitor, based on torsmo
#
# Any original torsmo code is licensed under the BSD license
#
# All code written since the fork of torsmo is licensed under the GPL
#
# Please see COPYING for details
#
# Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
# Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

background yes
use_xft yes
xftfont HandelGotD:size=8
xftalpha 0.2
update_interval 5
total_run_times 0
own_window yes
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_argb_visual true
double_buffer yes
#minimum_size 275 5
#maximum_width 275
minimum_size 320 800
maximum_width 320
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color green
alignment top_right
gap_x 10
gap_y 40
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale yes
use_spacer right

TEXT




${alignc}${time %a, %b %d %Y}
${offset 30}${font Dejavu Serif:size=20}${time %I:%M %p}${font}


CPU:1  ${cpu cpu1}% ${cpubar cpu1}
CPU:2  ${cpu cpu2}% ${cpubar cpu2}


${color white}RAM ${color} $alignr $mem / $memmax
$membar
${color white}SWAP ${color} $alignr $swap / $swapmax
$swapbar


${color white}/ ${color} $alignr ${fs_used /} / ${fs_size /}
${fs_bar /}
${color white}Home ${color} $alignr ${fs_used /home/david} / ${fs_size /home/david}
${fs_bar /home/david}
${color white}Movies ${color} $alignr ${fs_used /home/david/Movies} / ${fs_size /home/david/Movies}
${fs_bar /home/david/Movies}
${color white}Music ${color} $alignr ${fs_used /home/david/Music} / ${fs_size /home/david/Music}
${fs_bar /home/david/Music}
${color white}MythTV ${color} $alignr ${fs_used /MythTV} / ${fs_size /MythTV}
${fs_bar /MythTV}
${color white}TV Series ${color} $alignr ${fs_used /home/david/TVseries} / ${fs_size /home/david/TVseries}
${fs_bar /home/david/TVseries}

${color white}Processes: Total | Running
${color white}Processes:$color $processes  | $running_processes

Top Processes

CPU $alignr CPU%
${top name 1}$alignr${top cpu 1}
${top name 2}$alignr${top cpu 2}
${top name 3}$alignr${top cpu 3}
${top name 4}$alignr${top cpu 4}

MEM $alignr MEM%
${top_mem name 1}$alignr${top_mem mem 1}
${top_mem name 2}$alignr${top_mem mem 2}
${top_mem name 3}$alignr${top_mem mem 3}
${top_mem name 4}$alignr${top_mem mem 4}


IP on eth0 $alignr ${addr eth0}

Down $alignr ${downspeed eth0}/s
${color green}${downspeedgraph eth0}${color}
Up $alignr ${upspeed eth0}/s
#${color green}${upspeedgraph eth0 16,200}${color}
${color green}${upspeedgraph eth0}${color}

# Arch RSS feed
#${rss https://planet.archlinux.org/rss20.xml 1 item_titles 10 }

Tuesday, July 16, 2013

Adding bittorrent ports to my iptables

I accessed my router and did the port forwarding necessary to allow my bittorrent client (transmission) to seed properly, but I also needed to add a rule to my iptables to allow the traffic through.

My setup is

Internet     ->     Hardware Router        ->     Linux Desktop
                    with port forwarding          Client
                    enabled


I began by backing up my current iptables file

$ sudo cp /etc/iptables/iptables.rules /etc/iptables/iptables.rules.20130716


I am using Arch Linux Simple Stateful Firewall along with Transmission bittorrent client. The default port is 51413, so I needed to perform the following commands:

$ sudo iptables -A TCP -p tcp --dport 51413 -j ACCEPT
$ sudo iptables -A TCP -p tcp --sport 51413 -j ACCEPT
$ su -c "iptables-save > /etc/iptables/iptables.rules"
Password:
$ sudo systemctl restart iptables.service

If I want to revert back to my old rules (which block port 51413) I can issue the command

$ sudo iptables-restore < /etc/iptables/iptables.rules.20130716
$ su -c "iptables-save > /etc/iptables/iptables.rules"
Password:
$ sudo systemctl restart iptables.service

Saturday, May 18, 2013

Samba blocked - smbclient returns Error for a configured user

I was getting two errors,

$ smbclient -L hostname -U%
params.c:OpenConfFile() - Unable to open configuration file "/etc/samba/smb.conf":
    No such file or directory
smbclient: Can't load /etc/samba/smb.conf - run testparm to debug it
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.0.5]
tree connect failed: NT_STATUS_ACCESS_DENIED


and

$ smbclient -L hostname --user username
params.c:OpenConfFile() - Unable to open configuration file "/etc/samba/smb.conf":
    No such file or directory
smbclient: Can't load /etc/samba/smb.conf - run testparm to debug it
Connection to hostname failed (Error NT_STATUS_CONNECTION_REFUSED)


The first error was due to samba not being public and therefore i needed to specify a samba username (who must also be a system user, see here) who was granted samba permissions.

The second error I was receiving simply because I had my firewall set using iptables, and had not opened the correct ports for samba!

I performed the following commands and corrected it.
  1. sudo iptables -A TCP -p tcp --dport 139 -j ACCEPT
  2. sudo iptables -A TCP -p tcp --dport 445 -j ACCEPT
  3. sudo iptables -A UDP -p udp --sport 137 -j ACCEPT
  4. sudo iptables -A UDP -p udp --dport 137 -j ACCEPT 
  5. sudo iptables -A UDP -p udp --dport 138 -j ACCEPT 
  6. su -c 'iptables-save > /etc/iptables/iptables.rules'
This opens the samba ports and then saves the rules to the iptables config file. Finally, restart the iptables service. For Arch, this is
  • sudo systemctl restart iptables.service
Done. Now my correctly configured /etc/samba/smb.conf file is enough to grant me access to my shares.

Saturday, May 12, 2012

Slackware lirc with mceusb

For my older installation (Slackware 12.2) I made this post to get lirc working.

Woodsman has posted this post and this post about starting lirc, which may help.

On Arch, where lirc is currently working, I have the following output
$ lsmod | grep lirc
ir_lirc_codec           4027  3 
lirc_dev                9359  1 ir_lirc_codec
rc_core                13280  14 mceusb,ir_nec_decoder,ir_rc5_decoder,ir_rc6_decoder,ir_jvc_decoder,rc_rc6_mce,ir_sony_decoder,ir_sanyo_decoder,ir_mce_kbd_decoder,ir_lirc_codec,cx88xx,rc_winfast

However, I did the following for my Slackware 13.37:
  1. I firstly installed lirc from Slackbuilds.
  2. I tried to start lircd but had to create a folder to prevent the following error:
    • lircd: can't open or create /var/run/lirc/lircd.pid
      lircd: No such file or directory
    • Simple solution, use the following command (as root):
      # mkdir -p /var/run/lirc
  3. Start lircd with this command (as root)
    # lircd -d /dev/lirc/0

Monday, May 7, 2012

XBMC Keymaps

XBMC keymaps

keyboard_david-htpc.xml
********************************************************************************
<!-- This file contains the mapping of keys (gamepad, remote, and keyboard) to actions within XBMC -->
<!-- The <global> section is a fall through - they will only be used if the button is not          -->
<!-- used in the current window's section.  Note that there is only handling                       -->
<!-- for a single action per button at this stage.                                                 -->
<!-- For joystick/gamepad configuration under linux/win32, see below as it differs from xbox       -->
<!-- gamepads.                                                                                     -->

<!-- The format is:                      -->
<!--    <device>                         -->
<!--      <button>action</button>        -->
<!--    </device>                        -->

<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
<!-- You set it up by adding a <universalremote> block to the window or <global> section:       -->
<!--    <universalremote>             -->
<!--       <obc45>Stop</obc45>         -->
<!--    </universalremote>            -->

<!-- Note that the action can be a built-in function.                 -->
<!--  eg <B>XBMC.ActivateWindow(MyMusic)</B>                         -->
<!-- would automatically go to My Music on the press of the B button. -->

<!-- Joysticks / Gamepads:                                                                    -->
<!--   See the sample PS3 controller configuration below for the format.                      -->
<!--                                                                                          -->
<!--  Joystick Name:                                                                          -->
<!--   Do 'cat /proc/bus/input/devices' or see your xbmc log file  to find the names of       -->
<!--   detected joysticks. The name used in the configuration should match the detected name. -->
<!--                                                                                          -->
<!--  Button Ids:                                                                             -->
<!--   'id' is the button ID used by SDL. Joystick button ids of connected joysticks appear   -->
<!--   in xbmc.log when they are pressed. Use your log to map custom buttons to actions.      -->
<!--                                                                                          -->
<!--  Axis Ids / Analog Controls                                                              -->
<!--   Coming soon.                                                                           -->
<keymap>
  <global>
    <keyboard>
      <p>Play</p>
      <q>Queue</q>
      <f>FastForward</f>
      <r>Rewind</r>
      <left>Left</left>
      <right>Right</right>
      <up>Up</up>
      <down>Down</down>
      <pageup>PageUp</pageup>
      <pagedown>PageDown</pagedown>
      <return>Select</return>
      <enter>Select</enter>
      <backspace>ParentDir</backspace>
      <m>ActivateWindow(PlayerControls)</m>
      <s>ActivateWindow(shutdownmenu)</s>
      <escape>PreviousMenu</escape>
      <i>Info</i>
      <menu>ContextMenu</menu>
      <c>ContextMenu</c>
      <space>Pause</space>
      <x>Stop</x>
      <period>SkipNext</period>
      <comma>SkipPrevious</comma>
      <tab>FullScreen</tab>
      <printscreen>Screenshot</printscreen>
      <s mod="ctrl">Screenshot</s>
      <minus>VolumeDown</minus>
      <plus>VolumeUp</plus>
      <zero>Number0</zero>
      <one>Number1</one>
      <two>Number2</two>
      <three>Number3</three>
      <four>Number4</four>
      <five>Number5</five>
      <six>Number6</six>
      <seven>Number7</seven>
      <eight>Number8</eight>
      <nine>Number9</nine>
      <backslash>ToggleFullScreen</backslash>
      <browser_home>XBMC.ActivateWindow(Home)</browser_home>
      <browser_favorites>ActivateWindow(Favourites)</browser_favorites>
      <browser_refresh/>
      <browser_search/>
      <launch_app1_pc_icon>ActivateWindow(MyPrograms)</launch_app1_pc_icon>
      <launch_media_select>XBMC.ActivateWindow(MyMusic)</launch_media_select>
      <play_pause>Pause</play_pause>
      <stop>Stop</stop>
      <volume_up>VolumeUp</volume_up>
      <volume_mute>Mute</volume_mute>
      <volume_down>VolumeDown</volume_down>
      <next_track>SkipNext</next_track>
      <prev_track>SkipPrevious</prev_track>
      <launch_mail></launch_mail>
      <key id='61620'></key>      <!-- same as above, launch_mail, but using button code (based on vkey id) -->
      <home>FirstPage</home>
      <end>LastPage</end>
      <key id='65446'>ParentDir</key>
      <key id='65459'>Play</key>
      <!-- ****************************************************** -->
      <!-- MS Media Center keyboard shortcuts sent by MCE remotes -->
      <!-- See http://msdn.microsoft.com/en-us/library/bb189249.aspx -->
      <p mod="ctrl,shift">Play</p>        <!-- Play -->
      <s mod="ctrl,shift">Stop</s>        <!-- Stop -->
      <p mod="ctrl">Pause</p>             <!-- Pause -->
      <f mod="ctrl,shift">FastForward</f> <!-- Fwd -->
      <b mod="ctrl,shift">Rewind</b>      <!-- Rew -->
      <f mod="ctrl">SkipNext</f>          <!-- Skip -->
      <b mod="ctrl">SkipPrevious</b>      <!-- Replay -->
      <d mod="ctrl">Info</d>              <!-- MCE Details -->
      <f10>VolumeUp</f10>                 <!-- MCE Vol up -->
      <f9>VolumeDown</f9>                 <!-- MCE Vol down -->
      <f8>Mute</f8>                       <!-- MCE mute -->
      <g mod="ctrl">OSD</g>               <!-- MCE Guide -->
      <m mod="ctrl">ActivateWindow(music)</m>    <!-- MCE My music -->
      <i mod="ctrl">ActivateWindow(pictures)</i> <!-- MCE My pictures -->
      <e mod="ctrl">ActivateWindow(video)</e>    <!-- MCE videos -->
      <!-- MCE keypresses without an obvious use in XBMC -->
      <o mod="ctrl">Notification(MCEKeypress, Recorded TV, 3)</o>
      <t mod="ctrl">Notification(MCEKeypress, Live TV, 3)</t>
      <t mod="ctrl,shift">Notification(MCEKeypress, My TV, 3)</t>
      <a mod="ctrl">Notification(MCEKeypress, Radio, 3)</a>
      <m mod="ctrl,shift">Notification(MCEKeypress, DVD menu, 3)</m>
      <u mod="ctrl">Notification(MCEKeypress, DVD subtitle, 3)</u>
      <a mod="ctrl,shift">Notification(MCEKeypress, DVD audio, 3)</a>
    </keyboard>
  </global>
  <LoginScreen>
    <keyboard>
      <end>XBMC.ShutDown()</end>
    </keyboard>
  </LoginScreen>
  <Home>
    <keyboard>
      <i>info</i>
      <end>XBMC.ShutDown()</end>
      <backspace>XBMC.ActivateWindow(shutdownmenu)</backspace>
    </keyboard>
  </Home>
  <VirtualKeyboard>
    <keyboard>
      <backspace>Backspace</backspace>
    </keyboard>
  </VirtualKeyboard>
  <MyFiles>
    <keyboard>
      <space>Highlight</space>
      <delete>Delete</delete>
      <m>Move</m>
      <r>Rename</r>
    </keyboard>
  </MyFiles>
  <MyMusicPlaylist>
    <keyboard>
      <space>Playlist</space>      <!-- Close playlist -->
      <delete>Delete</delete>
      <c>Playlist.Clear</c>
      <u>MoveItemUp</u>
      <d>MoveItemDown</d>
      <backspace>Playlist</backspace>      <!-- Close playlist -->
    </keyboard>
  </MyMusicPlaylist>
  <MyMusicPlaylistEditor>
    <keyboard>
      <u>MoveItemUp</u>
      <d>MoveItemDown</d>
      <delete>Delete</delete>
    </keyboard>
  </MyMusicPlaylistEditor>
  <MyMusicFiles>
    <keyboard>
      <space>Playlist</space>
      <q>Queue</q>
    </keyboard>
  </MyMusicFiles>
  <MyMusicLibrary>
    <keyboard>
      <space>Playlist</space>
      <q>Queue</q>
    </keyboard>
  </MyMusicLibrary>
  <FullscreenVideo>
    <keyboard>
      <f>FastForward</f>
      <r>Rewind</r>
      <period>StepForward</period>
      <comma>StepBack</comma>
      <backspace>Fullscreen</backspace>
      <quote>SmallStepBack</quote>
      <opensquarebracket>BigStepForward</opensquarebracket>
      <closesquarebracket>BigStepBack</closesquarebracket>
      <return>OSD</return>
      <enter>OSD</enter>
      <m>OSD</m>
      <i>Info</i>
      <o>CodecInfo</o>
      <z>AspectRatio</z>
      <t>ShowSubtitles</t>
      <l>NextSubtitle</l>
      <left>StepBack</left>
      <right>StepForward</right>
      <up>BigStepForward</up>
      <down>BigStepBack</down>
      <a>AudioDelay</a>
      <!--<escape>Fullscreen</escape>-->
<escape>Stop</escape>
      <v>XBMC.ActivateWindow(Teletext)</v>
    </keyboard>
  </FullscreenVideo>
  <VideoTimeSeek>
    <keyboard>
      <return>Select</return>
      <enter>Select</enter>
    </keyboard>
  </VideoTimeSeek>
  <FullscreenInfo>
    <keyboard>
      <f>FastForward</f>
      <r>Rewind</r>
      <period>StepForward</period>
      <backspace>Close</backspace>
      <o>CodecInfo</o>
      <i>Close</i>
      <d mod="ctrl">Close</d>
      <m>OSD</m>
    </keyboard>
  </FullscreenInfo>
  <PlayerControls>
    <keyboard>
      <escape>Close</escape>
      <m>close</m>
    </keyboard>
  </PlayerControls>
  <Visualisation>
    <keyboard>
      <f>FastForward</f>
      <r>Rewind</r>
      <period>SkipNext</period>
      <comma>SkipPrevious</comma>
      <return>ActivateWindow(MusicOSD)</return>
      <enter>ActivateWindow(MusicOSD)</enter>
      <m>ActivateWindow(MusicOSD)</m>
      <i>Info</i>
      <p>ActivateWindow(VisualisationPresetList)</p>
      <v>ActivateWindow(VisualisationSettings)</v>
      <n>ActivateWindow(MusicPlaylist)</n>
      <left>SkipPrevious</left>
      <right>SkipNext</right>
      <up>IncreaseRating</up>
      <down>DecreaseRating</down>      <!--<back>NextPreset</back>!-->
      <o>CodecInfo</o>
      <l>LockPreset</l>
      <escape>FullScreen</escape>
    </keyboard>
  </Visualisation>
  <MusicOSD>
    <keyboard>
      <escape>Close</escape>
      <f>FastForward</f>
      <r>Rewind</r>
      <period>SkipNext</period>
      <comma>SkipPrevious</comma>
      <right mod="ctrl">SkipNext</right>          <!-- Skip -->
      <left mod="ctrl">SkipPrevious</left>      <!-- Replay -->
      <right mod="alt">SkipNext</right>          <!-- Skip -->
      <left mod="alt">SkipPrevious</left>      <!-- Replay -->
      <m>Close</m>
      <i>Info</i>
      <o>CodecInfo</o>
      <p>ActivateWindow(VisualisationPresetList)</p>
      <v>ActivateWindow(VisualisationSettings)</v>
      <n>ActivateWindow(MusicPlaylist)</n>
    </keyboard>
  </MusicOSD>
  <VisualisationSettings>
    <keyboard>
      <escape>Close</escape>
      <f>FastForward</f>
      <r>Rewind</r>
      <period>SkipNext</period>
      <comma>SkipPrevious</comma>
      <m>Close</m>
      <i>Info</i>
      <o>CodecInfo</o>
      <p>ActivateWindow(VisualisationPresetList)</p>
      <v>Close</v>
      <n>ActivateWindow(MusicPlaylist)</n>
    </keyboard>
  </VisualisationSettings>
  <VisualisationPresetList>
    <keyboard>
      <escape>Close</escape>
      <f>FastForward</f>
      <r>Rewind</r>
      <period>SkipNext</period>
      <comma>SkipPrevious</comma>
      <m>Close</m>
      <i>Info</i>
      <o>CodecInfo</o>
      <p>Close</p>
      <v>Close</v>
      <n>ActivateWindow(MusicPlaylist)</n>
    </keyboard>
  </VisualisationPresetList>
  <SlideShow>
    <keyboard>
      <zero>ZoomNormal</zero>
      <one>ZoomLevel1</one>
      <two>ZoomLevel2</two>
      <three>ZoomLevel3</three>
      <four>ZoomLevel4</four>
      <five>ZoomLevel5</five>
      <six>ZoomLevel6</six>
      <seven>ZoomLevel7</seven>
      <eight>ZoomLevel8</eight>
      <nine>ZoomLevel9</nine>
      <i>Info</i>
      <o>CodecInfo</o>
      <period>NextPicture</period>
      <comma>PreviousPicture</comma>
      <plus>ZoomIn</plus>
      <minus>ZoomOut</minus>
      <r>Rotate</r>
      <backspace>PreviousMenu</backspace>
    </keyboard>
  </SlideShow>
  <ScreenCalibration>
    <keyboard>
      <return>NextCalibration</return>
      <enter>NextCalibration</enter>
      <d>ResetCalibration</d>
      <r>NextResolution</r>
    </keyboard>
  </ScreenCalibration>
  <GUICalibration>
    <keyboard>
      <return>NextCalibration</return>
      <enter>NextCalibration</enter>
      <d>ResetCalibration</d>
    </keyboard>
  </GUICalibration>
  <SelectDialog>
    <keyboard>
      <backspace>Close</backspace>
      <escape>Close</escape>
    </keyboard>
  </SelectDialog>
  <VideoOSD>
    <keyboard>
      <backspace>Close</backspace>
      <escape>Close</escape>
      <m>Close</m>
      <g mod="ctrl">close</g> <!-- MCE Guide button -->
      <i>Info</i>
      <o>CodecInfo</o>
    </keyboard>
  </VideoOSD>
  <VideoMenu>
    <keyboard>
      <opensquarebracket>BigStepForward</opensquarebracket>
      <closesquarebracket>BigStepBack</closesquarebracket>
      <m>OSD</m>
      <i>Info</i>
      <o>CodecInfo</o>
      <z>AspectRatio</z>
      <t>ShowSubtitles</t>
      <l>NextSubtitle</l>
      <a>AudioDelay</a>
      <escape>Fullscreen</escape>
      <return>Select</return>
      <enter>Select</enter>      <!-- backspace>Fullscreen</backspace -->
      <backspace>PreviousMenu</backspace>
    </keyboard>
  </VideoMenu>
  <OSDVideoSettings>
    <keyboard>
      <backspace>Close</backspace>
      <escape>Close</escape>
      <i>Info</i>
      <o>CodecInfo</o>
    </keyboard>
  </OSDVideoSettings>
  <OSDAudioSettings>
    <keyboard>
      <backspace>Close</backspace>
      <escape>Close</escape>
      <i>Info</i>
      <o>CodecInfo</o>
    </keyboard>
  </OSDAudioSettings>
  <VideoBookmarks>
    <keyboard>
      <backspace>Close</backspace>
      <escape>Close</escape>
    </keyboard>
  </VideoBookmarks>
  <MyVideoLibrary>
    <keyboard>
      <delete>Delete</delete>
      <space>Playlist</space>
      <w>ToggleWatched</w>
    </keyboard>
  </MyVideoLibrary>
  <MyVideoFiles>
    <keyboard>
      <space>Playlist</space>
      <q>Queue</q>
      <w>ToggleWatched</w>
    </keyboard>
  </MyVideoFiles>
  <MyVideoPlaylist>
    <keyboard>
      <backspace>Playlist</backspace>      <!-- Close playlist -->
      <space>Playlist</space>      <!-- Close playlist -->
      <delete>Delete</delete>
      <u>MoveItemUp</u>
      <d>MoveItemDown</d>
    </keyboard>
  </MyVideoPlaylist>
  <ContextMenu>
    <keyboard>
      <c>Close</c>
      <menu>Close</menu>
      <backspace>Close</backspace>
    </keyboard>
  </ContextMenu>
  <FileStackingDialog>
    <keyboard>
      <backspace>Close</backspace>
    </keyboard>
  </FileStackingDialog>
  <Scripts>
    <keyboard>
      <i>info</i>
    </keyboard>
  </Scripts>
  <Weather>
    <keyboard>
      <backspace>PreviousMenu</backspace>
      <key id='65446'>PreviousMenu</key>
    </keyboard>
  </Weather>
  <Settings>
    <keyboard>
      <backspace>PreviousMenu</backspace>
    </keyboard>
  </Settings>
  <MyPicturesSettings>
    <keyboard>
      <backspace>PreviousMenu</backspace>
    </keyboard>
  </MyPicturesSettings>
  <MyProgramsSettings>
    <keyboard>
      <backspace>PreviousMenu</backspace>
    </keyboard>
  </MyProgramsSettings>
  <MyWeatherSettings>
    <keyboard>
      <backspace>PreviousMenu</backspace>
    </keyboard>
  </MyWeatherSettings>
  <MyMusicSettings>
    <keyboard>
      <backspace>PreviousMenu</backspace>
    </keyboard>
  </MyMusicSettings>
  <SystemSettings>
    <keyboard>
      <backspace>PreviousMenu</backspace>
    </keyboard>
  </SystemSettings>
  <MyVideosSettings>
    <keyboard>
      <backspace>PreviousMenu</backspace>
    </keyboard>
  </MyVideosSettings>
  <NetworkSettings>
    <keyboard>
      <backspace>PreviousMenu</backspace>
    </keyboard>
  </NetworkSettings>
  <AppearanceSettings>
    <keyboard>
      <backspace>PreviousMenu</backspace>
    </keyboard>
  </AppearanceSettings>
  <Profiles>
    <keyboard>
      <backspace>PreviousMenu</backspace>
    </keyboard>
  </Profiles>
  <systeminfo>
    <keyboard>
      <backspace>PreviousMenu</backspace>
    </keyboard>
  </systeminfo>
  <shutdownmenu>
    <keyboard>
      <backspace>PreviousMenu</backspace>
      <s>Close</s>  
    </keyboard>
  </shutdownmenu>
  <submenu>
    <keyboard>
      <backspace>PreviousMenu</backspace>
    </keyboard>
  </submenu>
  <MusicInformation>
    <keyboard>
      <backspace>Close</backspace>
      <key id='65446'>Close</key>
    </keyboard>
  </MusicInformation>
  <MovieInformation>
    <keyboard>
      <backspace>Close</backspace>
      <i>Close</i>
      <d mod="ctrl">Close</d>
      <key id='65446'>Close</key>
    </keyboard>
  </MovieInformation>
  <AddonInformation>
    <keyboard>
      <backspace>Close</backspace>
    </keyboard>
  </AddonInformation>
  <AddonSettings>
    <keyboard>
      <backspace>Close</backspace>
    </keyboard>
  </AddonSettings>
  <TextViewer>
    <keyboard>
      <backspace>Close</backspace>
    </keyboard>
  </TextViewer>
  <LockSettings>
    <keyboard>
      <escape>Close</escape>
      <backspace>PreviousMenu</backspace>
    </keyboard>
  </LockSettings>
  <ProfileSettings>
    <keyboard>
      <escape>Close</escape>
      <backspace>PreviousMenu</backspace>
    </keyboard>
  </ProfileSettings>
  <PictureInfo>
    <keyboard>
      <period>NextPicture</period>
      <comma>PreviousPicture</comma>
      <i>Close</i>
      <d mod="ctrl">Close</d>
      <o>Close</o>
      <backspace>Close</backspace>
      <space>Pause</space>
    </keyboard>
  </PictureInfo>
  <Teletext>
    <keyboard>
      <backspace>Close</backspace>
      <escape>Close</escape>
      <v>Close</v>
    </keyboard>
  </Teletext>
  <Favourites>
    <keyboard>
      <backspace>Close</backspace>
    </keyboard>
  </Favourites>
  <NumericInput>
    <keyboard>
      <backspace>Close</backspace>
    </keyboard>
  </NumericInput>
</keymap>

********************************************************************************

remote_logitech525.xml

<!-- This file contains the mapping of keys (gamepad, remote, and keyboard) to actions within XBMC -->
<!-- The <global> section is a fall through - they will only be used if the button is not          -->
<!-- used in the current window's section.  Note that there is only handling                       -->
<!-- for a single action per button at this stage.                                                 -->
<!-- For joystick/gamepad configuration under linux/win32, see below as it differs from xbox       -->
<!-- gamepads.                                                                                     -->

<!-- The format is:                      -->
<!--    <device>                         -->
<!--      <button>action</button>        -->
<!--    </device>                        -->

<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
<!-- You set it up by adding a <universalremote> block to the window or <global> section:       -->
<!--    <universalremote>             -->
<!--       <obc45>Stop</obc45>         -->
<!--    </universalremote>            -->

<!-- Note that the action can be a built-in function.                 -->
<!--  eg <B>XBMC.ActivateWindow(MyMusic)</B>                         -->
<!-- would automatically go to My Music on the press of the B button. -->

<!-- Joysticks / Gamepads:                                                                    -->
<!--   See the sample PS3 controller configuration below for the format.                      -->
<!--                                                                                          -->
<!--  Joystick Name:                                                                          -->
<!--   Do 'cat /proc/bus/input/devices' or see your xbmc log file  to find the names of       -->
<!--   detected joysticks. The name used in the configuration should match the detected name. -->
<!--                                                                                          -->
<!--  Button Ids:                                                                             -->
<!--   'id' is the button ID used by SDL. Joystick button ids of connected joysticks appear   -->
<!--   in xbmc.log when they are pressed. Use your log to map custom buttons to actions.      -->
<!--                                                                                          -->
<!--  Axis Ids / Analog Controls                                                              -->
<!--   Coming soon.                                                                           -->
<!--  This File is a modified version of the default remote.xml within XBMC.                  -->
<!--   It is set for a Logitech Harmony 525 which is mimicking a MCE USB remote.              -->
<keymap>
  <global>
    <remote>
      <play>Play</play>
      <pause>Pause</pause>
      <stop>Stop</stop>
      <forward>FastForward</forward>
      <reverse>Rewind</reverse>
      <left>Left</left>
      <right>Right</right>
      <up>Up</up>
      <down>Down</down>
      <select>Select</select>
      <enter>PreviousMenu</enter> 
      <pageplus>PageUp</pageplus>
      <pageminus>PageDown</pageminus>
      <back>ParentDir</back>
      <menu>ContextMenu</menu>
      <title>ContextMenu</title>
      <info>Info</info>
      <skipplus>SkipNext</skipplus>
      <skipminus>SkipPrevious</skipminus>
      <display>FullScreen</display>
      <start>PreviousMenu</start>
      <record>Queue</record>
      <volumeplus>VolumeUp</volumeplus>
      <volumeminus>VolumeDown</volumeminus>
      <channelminus>PageDown</channelminus>
      <channelplus>PageUp</channelplus>
      <mute>Mute</mute>
      <power>XBMC.ShutDown()</power>
      <myvideo>XBMC.ActivateWindow(MyVideos)</myvideo>
      <mymusic>XBMC.ActivateWindow(MyMusic)</mymusic>
      <mypictures>XBMC.ActivateWindow(MyPictures)</mypictures>
      <mytv>XBMC.ActivateWindow(VideoLibrary,TvShows)</mytv>
      <green>Queue</green>
      <yellow>XBMC.ActivateWindow(Music,Playlists)</yellow>
      <blue>Playlist</blue>
      <clear>Playlist.Clear</clear>
      <hash>XBMC.ActivateWindow(Music,Playlists)</hash>
      <zero>XBMC.Quit</zero>
      <one>Number1</one>
      <two>JumpSMS2</two>
      <three>JumpSMS3</three>
      <four>JumpSMS4</four>
      <five>JumpSMS5</five>
      <six>JumpSMS6</six>
      <seven>JumpSMS7</seven>
      <eight>JumpSMS8</eight>
      <nine>JumpSMS9</nine>
    </remote>
  </global>
  <Home>
    <remote>
      <green>XBMC.ActivateWindow(Music,Playlists)</green>
      <play>XBMC.ActivateWindow(Music,Playlists)</play>
      <info>XBMC.ActivateWindow(SystemInfo)</info>
      <back>XBMC.ActivateWindow(shutdownmenu)</back>
    </remote>
  </Home>
  <MyFiles>
    <remote>
      <channelminus>PageDown</channelminus>
      <channelplus>PageUp</channelplus>
      <star>Highlight</star>
    </remote>
  </MyFiles>
  <MyMusicPlaylist>
    <remote>
      <clear>Playlist.Clear</clear>
      <red>Delete</red>
      <yellow>XBMC.PlayerControl(Random)</yellow>
      <channelminus>MoveItemDown</channelminus>
      <channelplus>MoveItemUp</channelplus>      
    </remote>
  </MyMusicPlaylist>
  <MyMusicPlaylistEditor>
    <remote>
      <red>Delete</red>
    </remote>
  </MyMusicPlaylistEditor>
  <MyMusicFiles>
    <remote>
    </remote>
  </MyMusicFiles>
  <MyMusicLibrary>
    <remote>
    </remote>
  </MyMusicLibrary>
  <FullscreenVideo>
    <remote>
      <one>Number1</one>
      <two>Number2</two>
      <three>Number3</three>
      <four>Number4</four>
      <five>Number5</five>
      <six>Number6</six>
      <seven>Number7</seven>
      <eight>Number8</eight>
      <nine>Number9</nine>
      <left>StepBack</left>
      <right>StepForward</right>
      <up>BigStepForward</up>
      <down>BigStepBack</down>
      <back>Stop</back>
      <menu>OSD</menu>
      <start>OSD</start>
      <select>AspectRatio</select>
      <title>CodecInfo</title>
      <info>Info</info>
      <teletext>XBMC.ActivateWindow(Teletext)</teletext>
      <subtitle>NextSubtitle</subtitle>
      <yellow>ShowSubtitles</yellow>
      <language>AudioNextLanguage</language>
      <channelminus>AudioDelayMinus</channelminus>
      <channelplus>AudioDelayPlus</channelplus>
    </remote>
  </FullscreenVideo>
  <VideoTimeSeek>
    <remote>
      <select>Select</select>
      <enter>Select</enter>
    </remote>
  </VideoTimeSeek>
  <FullscreenInfo>
    <remote>
      <title>CodecInfo</title>
      <info>Back</info>
      <menu>OSD</menu>
    </remote>
  </FullscreenInfo>
  <PlayerControls>
    <remote>
      <menu>Back</menu>
      <back>Close</back>
    </remote>
  </PlayerControls>
  <Visualisation>
    <remote>
      <left>PreviousPreset</left>
      <right>NextPreset</right>
      <up>IncreaseRating</up>
      <down>DecreaseRating</down>
      <back>LockPreset</back>
      <title>CodecInfo</title>
      <select>XBMC.ActivateWindow(VisualisationPresetList)</select>
      <menu>XBMC.ActivateWindow(MusicOSD)</menu>
      <start>XBMC.ActivateWindow(MusicOSD)</start>
      <info>Info</info>
    </remote>
  </Visualisation>
  <MusicOSD>
    <remote>
      <menu>Back</menu>
      <back>Close</back>
      <title>Info</title>
      <info>CodecInfo</info>
    </remote>
  </MusicOSD>
  <VisualisationSettings>
    <remote>
      <menu>Back</menu>
      <back>Close</back>
    </remote>
  </VisualisationSettings>
  <VisualisationPresetList>
    <remote>
      <back>Close</back>
      <menu>Back</menu>
    </remote>
  </VisualisationPresetList>
  <SlideShow>
    <remote>
      <one>ZoomLevel1</one>
      <two>ZoomLevel2</two>
      <three>ZoomLevel3</three>
      <four>ZoomLevel4</four>
      <five>ZoomLevel5</five>
      <six>ZoomLevel6</six>
      <seven>ZoomLevel7</seven>
      <eight>ZoomLevel8</eight>
      <nine>ZoomLevel9</nine>
      <info>CodecInfo</info>
      <skipplus>NextPicture</skipplus>
      <skipminus>PreviousPicture</skipminus>
      <title>Info</title>
      <select>Rotate</select>
    </remote>
  </SlideShow>
  <ScreenCalibration>
    <remote>
      <select>NextCalibration</select>
      <display>NextResolution</display>
      <xbox>NextResolution</xbox>
    </remote>
  </ScreenCalibration>
  <GUICalibration>
    <remote>
      <select>NextCalibration</select>
    </remote>
  </GUICalibration>
  <VideoOSD>
    <remote>
      <back>Close</back>
      <menu>Back</menu>
      <start>Back</start>
    </remote>
  </VideoOSD>
  <VideoMenu>
    <remote>
      <menu>OSD</menu>
      <info>Info</info>
      <title>CodecInfo</title>
      <one>Number1</one>
      <two>Number2</two>
      <three>Number3</three>
      <four>Number4</four>
      <five>Number5</five>
      <six>Number6</six>
      <seven>Number7</seven>
      <eight>Number8</eight>
      <nine>Number9</nine>
      <play>Select</play>
    </remote>
  </VideoMenu>
  <OSDVideoSettings>
    <remote>
      <back>Close</back>
      <menu>Back</menu>
      <start>Back</start>
    </remote>
  </OSDVideoSettings>
  <OSDAudioSettings>
    <remote>
      <back>Close</back>
      <menu>Back</menu>
      <start>Back</start>
    </remote>
  </OSDAudioSettings>
  <VideoBookmarks>
    <remote>
      <back>Close</back>
      <menu>Back</menu>
      <start>Back</start>
    </remote>
  </VideoBookmarks>
  <MyVideoLibrary>
    <remote>
    </remote>
  </MyVideoLibrary>
  <MyVideoFiles>
    <remote>
    </remote>
  </MyVideoFiles>
  <MyVideoPlaylist>
    <remote>
      <channelminus>MoveItemDown</channelminus>
      <channelplus>MoveItemUp</channelplus>
    </remote>
  </MyVideoPlaylist>
  <VirtualKeyboard>
    <remote>
      <back>BackSpace</back>
      <star>Shift</star>
      <one>Number1</one>
      <two>Number2</two>
      <three>Number3</three>
      <four>Number4</four>
      <five>Number5</five>
      <six>Number6</six>
      <seven>Number7</seven>
      <eight>Number8</eight>
      <nine>Number9</nine>
      <enter>Enter</enter>
      <pageminus>CursorLeft</pageminus>
      <pageplus>CursorRight</pageplus>
    </remote>
  </VirtualKeyboard>
  <ContextMenu>
    <remote>
      <title>Back</title>
    </remote>
  </ContextMenu>
  <Scripts>
    <remote>
      <info>info</info>
    </remote>
  </Scripts>
  <NumericInput>
    <remote>
      <one>Number1</one>
      <two>Number2</two>
      <three>Number3</three>
      <four>Number4</four>
      <five>Number5</five>
      <six>Number6</six>
      <seven>Number7</seven>
      <eight>Number8</eight>
      <nine>Number9</nine>
      <enter>Enter</enter>
      <back>BackSpace</back>
    </remote>
  </NumericInput>
  <MusicInformation>
    <remote>
      <info>Back</info>
    </remote>
  </MusicInformation>
  <MovieInformation>
    <remote>
      <info>Back</info>
    </remote>
  </MovieInformation>
  <LockSettings>
    <remote>
      <back>Close</back>
      <menu>Back</menu>
    </remote>
  </LockSettings>
  <ProfileSettings>
    <remote>
      <back>Close</back>
      <menu>Back</menu>
    </remote>
  </ProfileSettings>
  <PictureInfo>
    <remote>
      <skipplus>NextPicture</skipplus>
      <skipminus>PreviousPicture</skipminus>
      <info>Back</info>
    </remote>
  </PictureInfo>
  <Teletext>
    <remote>
      <back>Close</back>
      <one>number1</one>
      <two>number2</two>
      <three>number3</three>
      <four>number4</four>
      <five>number5</five>
      <six>number6</six>
      <seven>number7</seven>
      <eight>number8</eight>
      <nine>number9</nine>
      <red>Red</red>
      <green>Green</green>
      <yellow>Yellow</yellow>
      <blue>Blue</blue>
      <info>Info</info>
      <menu>Back</menu>
      <start>Back</start>
      <teletext>Back</teletext>
    </remote>
  </Teletext>
  <AddonSettings>
    <remote>
    </remote>
  </AddonSettings>
</keymap>


Thursday, April 12, 2012

Post about getting MythTV backend to wake for recordings

Thanks, Lester_Burnham for this post!

Simple test to wake the machine 5 minutes from now (if this works, you're pretty much set)

sudo sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm"
sudo sh -c "echo `date '+%s' -d '+ 5 minutes'` > /sys/class/rtc/rtc0/wakealarm"
cat /sys/class/rtc/rtc0/wakealarm
 
Check

cat /proc/driver/rtc
 
This should return a list of parameters. Check the alrm_time is 5 minutes into the future and the alrm_date is today. Shutdown your computer and see if it comes back up in ~5 min.

sudo shutdown -h now
 
If the alarm is set then you should see something like this. If so then shutdown and see if it wakes up at the alarm date/time.

rtc_time : 13:40:26
rtc_date : 2008-12-21
alrm_time : 10:45:00
alrm_date : 2008-12-22
alarm_IRQ : yes
alrm_pending : no
24hr  : yes
periodic_IRQ : no
update_IRQ : no
HPET_emulated : no
DST_enable : no
periodic_freq : 1024
batt_status : okay

Wednesday, April 11, 2012

.lircrc file and .lirc folder

This is the ~/.lircrc file.


#Custom lircrc generated via mythbuntu-lirc-generator
#All application specific lircrc files are within ~/.lirc
include ~/.lirc/mythtv 
include ~/.lirc/irexec
include ~/.lirc/mplayer 
include ~/.lirc/xine 
include ~/.lirc/vlc 
include ~/.lirc/xmame 
include ~/.lirc/xmess 
include ~/.lirc/totem 
include ~/.lirc/elisa 


This is the ~/.lirc/mythtv file



# LIRCRC Auto Generated by Mythbuntu Lirc Generator
# Author(s): Mario Limonciello, Nick Fox
# Created for use with Mythbuntu

begin
    remote = mceusb
    prog = mythtv
    button = RecTV
    config = R
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Guide
    config = S
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Back
    config = Escape
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = OK
    config = Return
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Right
    config = Right
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Left
    config = Left
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Down
    config = Down
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Up
    config = Up
    repeat = 0
    delay = 0 
end


begin
    remote = mceusb
    prog = mythtv
    button = Hash
    config = D
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Clear
    config = Q
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Enter
    config = Z
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Stop
    config = Escape
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Pause
    config = P
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Record
    config = R
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Play
    config = P
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Rewind
    config = <
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Forward
    config = >
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = ChanDown
    config = Down
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = ChanUp
    config = Up
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = VolDown
    config = [
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = VolUp
    config = ]
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = More
    config = I
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Mute
    config = |
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Home
    config = M
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Skip
    config = Right
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Replay
    config = Left
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Nine
    config = 9
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Eight
    config = 8
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Seven
    config = 7
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Six
    config = 6
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Five
    config = 5
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Four
    config = 4
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Three
    config = 3
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Two
    config = 2
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = One
    config = 1
    repeat = 0
    delay = 0
end


begin
    remote = mceusb
    prog = mythtv
    button = Zero
    config = 0
    repeat = 0
    delay = 0
end




The folder (and in fact this file) can be found at this post of Arkays.


A good post from rileyp about making custom ~/.lirc/irexec is located here.


My original forum post on getting mceusb remote (logitech harmony 525) working for MythTV in Arch Linux is here.