Reddragon - Ubuntu: Difference between revisions

From miki
Jump to navigation Jump to search
Line 197: Line 197:
<source lang="bash">
<source lang="bash">
find -L /home/mich/Slideshow -type f -print0 | xargs -0 autoln
find -L /home/mich/Slideshow -type f -print0 | xargs -0 autoln
</source>

=== Remote support ===
* <tt>autonoekeon.sh</tt> is run automatically at logon:
<source lang=bash>
#! /bin/bash

autossh -M 0 -f -N -n -q -R 54895:localhost:22 noekeon
</source>
:To connect, first setup port forwarding, then connect via ''localhost'':
<source lang=bash>
autossh -M 0 -f -N -n -q -L 22221:localhost:54895 noekeon
ssh mike@localhost -p 22221
</source>

* Script on desktop to setup vnc remote (<tt>vnctunnelnoekeon<tt>):
<source lang=bash>
#! /bin/bash

# Save current stdout / stderr
exec 3>&1
exec 4>&2

# Redirect stdout / stderr
exec > >(tee /tmp/stdout.tmp)
exec 2> >(tee /tmp/stderr.tmp >&2)

# Deleting current .ssh/known_hosts
echo "Deleting current .ssh/known_hosts"
rm .ssh/known_hosts

# Open a vncserver
echo "Opening a virtual desktop for remote desktop sharing..."
vnc4server :1 -geometry 1440x900 -depth 8 -rfbport 5901

# TRAP EXIT --> Will remove port forwarding and kill the VNC server
trap "upnpc -d 12322 TCP; vnc4server -kill :1; rm /tmp/vnctunnelnoekeon-tail-f.tmp" EXIT

# Tunnel the VNC + local SSH Server connection through noekeon ssh
# ... SSH tunnel will remain open for 5min after which it will be automatically closed if no connection is made
ssh -f -n -R12301:localhost:5901 -R12322:localhost:22 noekeon sleep 300
# Wait a bit so that error message don't mess up my text below...
sleep 2

echo "################################################################################"
IPLOCAL=$(getlocalip.sh)
echo "Local IP address: $IPLOCAL"
IPPUBLIC=$(getpublicip.sh)
echo "Public IP address: $IPPUBLIC"
echo "################################################################################"
echo "Opening port 12322 on UPNP:"
upnpc -a "$IPLOCAL" 22 12322 TCP | tail -n 1
echo "################################################################################"

#Stop tee redirection
exec >&3
exec 2>&4

#Mail the current session to me
MAILSERVER=smtp.scarlet.be
FROM=michel.roch@scarlet.be
TO=michael.peeters@noekeon.org
echo "Sending mail to $TO..."
exec 5<>/dev/tcp/${MAILSERVER}/25
cat <&5 >/dev/null &
sleep 1
echo -e "HELO dummy.domain" >&5
sleep 1
echo -e "MAIL FROM: $FROM" >&5
sleep 1
echo -e "RCPT TO: $TO" >&5
sleep 1
echo -e "DATA" >&5
sleep 1
echo -e "subject: IP Addresses" >&5
echo -e "" >&5
echo -e "LOCAL IP Address: $IPLOCAL" >&5
echo -e "PUBLIC IP Address: $IPPUBLIC" >&5
echo -e >&5
echo -e "Connect with 'ssh -p 12322 username@$IPPUBLIC'" >&5
echo -e >&5
echo -e >&5
echo -e "Content of stdout:" >&5
echo -e "---------------------------------------------------------------------" >&5
cat /tmp/stdout.tmp >&5
echo -e "---------------------------------------------------------------------" >&5
echo -e >&5
echo -e "Content of stderr:" >&5
echo -e "---------------------------------------------------------------------" >&5
cat /tmp/stderr.tmp >&5
echo -e "---------------------------------------------------------------------" >&5
echo -e "." >&5
sleep 1
echo -e "QUIT" >&5
sleep 1
echo '... mail sent (hopefully)!'
echo

# Cleaning...
rm /tmp/stdout.tmp
rm /tmp/stderr.tmp

# kill it when the user press a key
echo "========================================================================"
# tail file to duplicate edit session. Eg:
# 1. Connect to $IPPUBLIC
# 2. tee stderr
# exec 2> >(tee /tmp/vnctunnelnoekeon-tail-f.tmp >&2)
# 3. Redirect stdout
# exec >&2
# 4. From now, current terminal will duplicate login terminal
touch /tmp/vnctunnelnoekeon-tail-f.tmp
tail -f /tmp/vnctunnelnoekeon-tail-f.tmp &
read -p "Press ENTER to close the desktop sharing session..." ignore
# No need to kill VNC / UPNP port forwarding, will be done on EXIT signal trap
# ssh will exit automatically
</source>
</source>



Revision as of 22:25, 28 May 2013

Introduction

This is the configuration page for the Ubuntu partition on RedDragon.

Configuration Files

All configuration files can be found here.

Repositories

Installed Applications

Common Essential:
[2011-11-16] Opera (opera) [2011-11-16] v 11.00.1156
[2011-11-16] etckeeper (etckeeper) Configured to use git as SCM
[2011-11-16] GIT (git git-gui gitk git-doc)
[2011-11-16] Google Chrome (chromium-browser)
[2011-11-16] Midnight Commander (mc) See reference page. Use vi as standard viewer/editor. Installed version from mc official repository to fix file highlighting issue.
[2011-11-16] Vim (vim, exuberant-ctags, vim-gnome) including GVim to enable support of X clipboard
[2011-11-16] Ruby (ruby) ... for Vim plug-in snipMate.vim
[2011-11-16] Vim/Cscope (cscope)
[2011-11-16] Samba (smbclient smbfs)
[2011-11-16] NFS Server (nfs-kernel-server nfs-common portmap) See NFS for more details; Created entries in /etc/exports.
[2011-11-16] AutoFS (autofs) See local config
[2011-11-16] KeePassX (keepassx)
[2011-11-16] apt-file (apt-file)
[2011-11-16] SSH (ssh) Local settings
[2011-11-16] Thunderbird (thunderbird)
[2011-11-16] Meld (meld) Diff tool
[2011-11-16] Color Diff (colordiff)
[2011-11-16] p7zip (p7zip-full p7zip-rar)
[2011-11-16] dlocate (dlocate)
[2011-11-16] MS Truetype core fonts (ttf-msttcorefonts-installer)
[2011-11-16] Ubuntu restricted extras (ubuntu-restricted-extras) shall install automatically libdvdread4
[2011-01-18] libdvdcss2 Installed via sudo /usr/share/doc/libdvdread4/install-css.sh (see also [1])
[2011-11-16] Qiv (qiv)
[2011-11-16] gThumb (gthumb)
[2011-11-16] GPG Agent (gnupg-agent) Added use-agent at end of ~/.gnupg/gpg.conf
[2011-11-16] Rename utils (renameutils)
[2011-11-16] Wine (wine) See Wine page
[2011-11-16] Gnome Terminator (terminator) See Gnome Terminator
[2011-11-16] Flash Plugin 10 (flashplugin-installer) First need to enable Ubuntu partner repository (deb http://archive.canonical.com/ubuntu lucid partner). Next
sudo aptitude autoremove "flashplugin-*"
sudo aptitude install flashplugin-installer
[2011-11-16] MPlayer (mplayer mplayer-doc mplayer-fonts)
[2011-11-16] Quicktime plugin (gnome-mplayer,gecko-mediaplayer) To play Quicktime content in Opera, Firefox
[2011-11-16] Gimp (gimp)
[2011-11-16] Graphical Disk Map (gdmap)
[2011-11-16] gparted (gparted)
Dist-upgrade to Precise Pangolin
[2012-04-18] Bumblebee (bumblebee bumblebee-nvidia)
[2013-05-28] mini upnp (miniupnpc) For remote support script
[2013-05-28] vnc server (vnc4server) For remote support script
Local applications:
[2011-11-16] GNU Go (gnugo)
[2011-11-16] Various Go games (qgo uligo)
[2011-11-16] Quarry (quarry) Board games Go, Amazons, and Reversi
[2011-11-16] XBMC (xbmc xbmc-standalone) See local page
[2011-11-16] fdupes (fdupes)
[2011-11-16] PGP (pgpgpg)
[2011-11-16] Synergy (synergy) [2011-03-04] v1.4.5! See local settings.
[2011-11-16] Perl Audio Converter (pacpl)
[2011-11-16] PowerTop (powertop)
[2011-11-16] Gnome Tweak Tool (gnome-tweak-tool) To change default font size...
[2011-11-16] XScreensaver (xscreensaver xscreensaver-gl-extra xscreensaver-data-extra) First remove gnome screensaver (sudo apt-get remove gnome-screensaver). Then set the screensaver as startup app (xscreensaver -nosplash). Select glslideshow. [2], [3], [4]
Dist-upgrade to Precise Pangolin



Un-installed applications (by uninstall date):

[YYYY-MM-DD] Application (package) [YYYY-MM-DD] uninstalled (reason)

Simple Settings

  • [2009-10-19] - Enabled proprietary video device driver NVIDIA (version 280).
  • [2013-05-18] - Enable audio head-phone (see [5]). Edit file /usr/share/pulseaudio/alsa-mixer/paths/analog-output-headphones.conf as follows:
[Element Speaker]
switch = on
volume = ignore
  • Printer — add Canon network printer (select IPP network printer via DNS-SD for protocol).
    • Set Color Model to CMYK

Detailed System Settings

1st install

  • INSTALL LOG

File System

  • To be completed

Network

  • To be completed

Preferences

  • To be completed

Users

  • Added to group users (for write access to mnemosyne):
    mich

Detailed Application Settings

Screensaver

  • gnome-screensaver does not work anymore. It simply show a black screen
  • Use xscreensaver instead, and select glslideshow for a slideshow.
  • UPDATE ISSUES — viewer used by glslideshow maintains a cache at ~/tmp/.xscreensaver-getimage.cache. Delete that file when updating the set of images in the slideshow.

Using xscreensaver without OpenGL

  • Package chbg does not exist anymore.
  • I could build package xv, but it does nothing under xscreensaver.
  • Use package qiv. Add the following line in .xscreensaver:
  qiv -s -r -S -d 10  -f -u -l -t -i      \
          $HOME/Slideshow               \n\
  • Select qiv as screensaver.

Apparently qiv does not work well with sub-folders. I use the following script (autoln):

#! /bin/bash
#
# Usage: autoln /path/to/file /path/to/second/file [...]
#
#        will create the following symbolic links:
#
#        _path_to_file         --> /path/to/file
#        _path_to_second_file  --> /path/to/second/file

while [ -n "$1" ]; do
    target="$1"
    symlink=${target//\//_}
    ln -ns "$target" "$symlink"
    shift
done

In the command line:

find -L /home/mich/Slideshow -type f -print0  | xargs -0 autoln

Remote support

  • autonoekeon.sh is run automatically at logon:
#! /bin/bash

autossh -M 0 -f -N -n -q -R 54895:localhost:22 noekeon
To connect, first setup port forwarding, then connect via localhost:
autossh -M 0 -f -N -n -q -L 22221:localhost:54895 noekeon
ssh mike@localhost -p 22221
  • Script on desktop to setup vnc remote (vnctunnelnoekeon):
#! /bin/bash

# Save current stdout / stderr
exec 3>&1
exec 4>&2

# Redirect stdout / stderr
exec > >(tee /tmp/stdout.tmp)
exec 2> >(tee /tmp/stderr.tmp >&2)

# Deleting current .ssh/known_hosts
echo "Deleting current .ssh/known_hosts"
rm .ssh/known_hosts

# Open a vncserver
echo "Opening a virtual desktop for remote desktop sharing..."
vnc4server :1 -geometry 1440x900 -depth 8 -rfbport 5901

# TRAP EXIT --> Will remove port forwarding and kill the VNC server
trap "upnpc -d 12322 TCP; vnc4server -kill :1; rm /tmp/vnctunnelnoekeon-tail-f.tmp" EXIT

# Tunnel the VNC + local SSH Server connection through noekeon ssh
# ... SSH tunnel will remain open for 5min after which it will be automatically closed if no connection is made
ssh -f -n -R12301:localhost:5901 -R12322:localhost:22 noekeon sleep 300
# Wait a bit so that error message don't mess up my text below...
sleep 2

echo "################################################################################"
IPLOCAL=$(getlocalip.sh)
echo "Local IP address: $IPLOCAL"
IPPUBLIC=$(getpublicip.sh)
echo "Public IP address: $IPPUBLIC"
echo "################################################################################"
echo "Opening port 12322 on UPNP:"
upnpc -a "$IPLOCAL" 22 12322 TCP | tail -n 1
echo "################################################################################"

#Stop tee redirection
exec >&3
exec 2>&4

#Mail the current session to me
MAILSERVER=smtp.scarlet.be
FROM=michel.roch@scarlet.be
TO=michael.peeters@noekeon.org
echo "Sending mail to $TO..."
exec 5<>/dev/tcp/${MAILSERVER}/25
cat <&5 >/dev/null &
sleep 1
echo -e "HELO dummy.domain" >&5
sleep 1
echo -e "MAIL FROM: $FROM" >&5
sleep 1
echo -e "RCPT TO: $TO" >&5
sleep 1
echo -e "DATA" >&5
sleep 1
echo -e "subject: IP Addresses" >&5
echo -e "" >&5
echo -e "LOCAL IP Address: $IPLOCAL" >&5
echo -e "PUBLIC IP Address: $IPPUBLIC" >&5
echo -e >&5
echo -e "Connect with 'ssh -p 12322 username@$IPPUBLIC'" >&5
echo -e >&5
echo -e >&5
echo -e "Content of stdout:" >&5
echo -e "---------------------------------------------------------------------" >&5
cat /tmp/stdout.tmp >&5
echo -e "---------------------------------------------------------------------" >&5
echo -e >&5
echo -e "Content of stderr:" >&5
echo -e "---------------------------------------------------------------------" >&5
cat /tmp/stderr.tmp >&5
echo -e "---------------------------------------------------------------------" >&5
echo -e "." >&5
sleep 1
echo -e "QUIT" >&5
sleep 1
echo '... mail sent (hopefully)!'
echo

# Cleaning...
rm /tmp/stdout.tmp
rm /tmp/stderr.tmp

# kill it when the user press a key
echo "========================================================================"
# tail file to duplicate edit session. Eg:
# 1. Connect to $IPPUBLIC
# 2. tee stderr
#    exec 2> >(tee /tmp/vnctunnelnoekeon-tail-f.tmp >&2)
# 3. Redirect stdout
#    exec >&2
# 4. From now, current terminal will duplicate login terminal
touch /tmp/vnctunnelnoekeon-tail-f.tmp
tail -f /tmp/vnctunnelnoekeon-tail-f.tmp &
read -p "Press ENTER to close the desktop sharing session..." ignore
# No need to kill VNC / UPNP port forwarding, will be done on EXIT signal trap
# ssh will exit automatically

To Do

Issues

Done & Fixed

  • Fixed — Issue description
    Fix description
  • Done — Description