Nxl67002 - AndLinux - Files: Difference between revisions

From miki
Jump to navigation Jump to search
Line 22: Line 22:


== AndLinux files ==
== AndLinux files ==
<small>Last generated on '''Thu Nov 19 09:47:17 CET 2009''' with script '''bin/generate_wiki_config_file_page.sh''' on host '''andLinux'''</small>


=== Directory /etc ===
=== Directory /etc ===
Line 766: Line 765:
'''config-home-nxp_direct''' - symlinked to <tt>config-default</tt>
'''config-home-nxp_direct''' - symlinked to <tt>config-default</tt>


=== Directory /home/beq06659/etc ===
'''backup_definition'''
{{pl2|{{hiddenSourceFile|/home/beq06659/etc/|backup_definition|<source lang=text class="backup_definition">
BACKUPPREFIX=wiki
BACKUPID=www.noekeon.org_miki
BACKUPEXT=sql.gz
BACKUPCMD="ssh noekeon '~daemenj/private/backup_wiki ~daemenj/kiwi.noekeon.org/miki/LocalSettings.php'"

BACKUPPREFIX=wiki
BACKUPID=www.noekeon.org_miki
BACKUPEXT=tar.gz
BACKUPCMD="ssh noekeon 'cd ~daemenj/kiwi.noekeon.org; /usr/bin/nice -n 19 tar -cz miki/'"

BACKUPPREFIX=wiki
BACKUPID=www.noekeon.org_crypto
BACKUPEXT=sql.gz
BACKUPCMD="ssh noekeon '~daemenj/private/backup_wiki ~daemenj/kiwi.noekeon.org/crypto/LocalSettings.php'"

BACKUPPREFIX=wiki
BACKUPID=www.noekeon.org_crypto
BACKUPEXT=tar.gz
BACKUPCMD="ssh noekeon 'cd ~daemenj/kiwi.noekeon.org; /usr/bin/nice -n 19 tar -cz crypto/'"

</source>
}} }}
'''crontab''' - Install this file with
:<code>crontab -u beq06659 ~/etc/crontab</code>
{{pl2|{{hiddenSourceFile|/home/beq06659/etc/|crontab|<source lang=bash class="crontab">
# Crontab for user beq06659
#
# Install this crontab with
#
# crontab -u beq06659 crontab
#
# Use /bin/bash to run commands, instead of the default /bin/sh
SHELL=/bin/bash
# Define variable USER because we need it in our job scripts
USER=beq06659
# Mail any output to 'beq06659', no matter whose crontab this is
MAILTO=beq06659
#
#
# m h dom mon dow command (dow=0|7 is sunday)
37 * * * * ~beq06659/bin/backup_main ~beq06659/etc/backup_definition

</source>
}} }}
=== Directory /home/beq06659/bin ===
=== Directory /home/beq06659/bin ===
'''backup_main''' - This file must be '''chmod 700'''.
'''backup_main''' - This file must be '''chmod 700'''.
Line 971: Line 923:
fi
fi
done 3< $BACKUP_DEF_FILE
done 3< $BACKUP_DEF_FILE

</source>
}} }}
'''generate_wiki_config_file_page.sh''' - This file must be '''chmod 700'''.
{{pl2|{{hiddenSourceFile|/home/beq06659/bin/|generate_wiki_config_file_page.sh|<source lang=bash class="generate_wiki_config_file_page.sh">
#! /bin/bash

function wikify_directory()
{
DIRECTORY="$1"
cd $DIRECTORY
echo "=== Directory $DIRECTORY ==="
}

function wikify_config_stdin()
{
local FILE="$1"
local TAGTYPE=source
local LANG="$2"
local DESCRIPTION="$3"
if [ -n "$DESCRIPTION" ]; then
echo -e "'''$FILE''' - $DESCRIPTION"
else
echo "'''$FILE'''"
fi
if [ -n "$LANG" ]; then
echo "{{pl2|{{hiddenSourceFile|$DIRECTORY/|$FILE|<$TAGTYPE lang="$LANG" class=\"$FILE\">"
else
echo "{{pl2|{{hiddenSourceFile|$DIRECTORY/|$FILE|<$TAGTYPE class=\"$FILE\">"
fi
cat
echo "</$TAGTYPE>"
echo "}} }}"
}

function wikify_config_file()
{
cat $DIRECTORY/"$1" | wikify_config_stdin "$1" "$2" "$3"
}

echo "== AndLinux files =="
#echo "<small>Last generated on '''$(date)''' with script '''$0''' on host '''$HOSTNAME'''</small>"
echo

wikify_directory /etc
wikify_config_file fstab text



wikify_directory /etc/privoxy
wikify_config_file set-network-config bash "This file must be '''chmod 755'''. Also the following line must be added to <tt>/etc/sudoers</tt>:
:<code> ALL ALL=(ALL) NOPASSWD: /etc/privoxy/set-network-config </code>"
diff -u config.original config-home | wikify_config_stdin config-home.patch diff
diff -u config-home config-nxp | wikify_config_stdin config-nxp.patch diff
echo "'''config-nxp_auth''' - symlinked to <tt>config-nxp</tt>"
echo
diff -u config-nxp config-nxp_direct | wikify_config_stdin config-nxp_direct.patch diff



wikify_directory /usr/local/bin
wikify_config_file be bash "This script would ideally require to add the following line to <tt>/etc/sudoers</tt>:
:<code>ALL ALL=(ALL) NOPASSWD: /bin/loadkeys</code>"
wikify_config_file ssh-agent-refresh.sh bash



wikify_directory ~
wikify_config_file .bashrc bash "Everything before <tt>#### CUSTOMIZATION</tt> is the original file."
wikify_config_file .dircolors.cfg text
wikify_config_file .inputrc bash
wikify_config_file .profile bash
wikify_config_file .vimrc text



wikify_directory ~/.ssh
wikify_config_file config-home text
wikify_config_file config-nxp text
echo "'''config-nxp_auth''' - symlinked to <tt>config-nxp</tt>"
echo
echo "'''config-nxp_direct''' - symlinked to <tt>config-nxp</tt>"
echo
wikify_config_file proxy.conf-default text
echo "'''proxy.conf-home''' - symlinked to <tt>proxy.conf-default</tt>"
echo
echo "'''proxy.conf-nxp''' - symlinked to <tt>proxy.conf-default</tt>"
echo
wikify_config_file proxy.conf-nxp_auth text
echo "'''config-home-nxp_direct''' - symlinked to <tt>config-default</tt>"
echo


wikify_directory ~/bin
wikify_config_file backup_main bash "This file must be '''chmod 700'''."
wikify_config_file generate_wiki_config_file_page.sh bash "This file must be '''chmod 700'''."
wikify_config_file restore_wiki.sh bash "This file must be '''chmod 700'''."
wikify_config_file set-network.sh bash "This file must be '''chmod 700'''."
wikify_config_file sshproxy bash "This file must be '''chmod 700'''."
wikify_config_file startup.sh bash "This file must be '''chmod 700'''."


wikify_directory ~/etc
wikify_config_file backup_definition text
wikify_config_file crontab bash "Install this file with
:<code>crontab -u beq06659 ~/etc/crontab</code>"
</source>
}} }}
'''restore_wiki.sh''' - This file must be '''chmod 700'''.
{{pl2|{{hiddenSourceFile|/home/beq06659/bin/|restore_wiki.sh|<source lang=bash class="restore_wiki.sh">
#! /bin/bash


function restore_wiki()
{
WIKI_DIR=$1

#
# Restore the wiki backup locally - miki
#
HTML_ROOT=/data/www
SQL_BACKUP=$(ls ~/backup/*-www.noekeon.org_$WIKI_DIR.daily.sql.gz | tail -n 1)
TAR_BACKUP=$(ls ~/backup/*-www.noekeon.org_$WIKI_DIR.daily.tar.gz | tail -n 1)
WIKI_SETTINGS_FNAME="$HTML_ROOT/$WIKI_DIR/LocalSettings.php"

[ -a "$SQL_BACKUP" ] || return 1
[ -a "$TAR_BACKUP" ] || return 1

echo "Restoring TAR backup $TAR_BACKUP..."
echo
sudo rm -r "$HTML_ROOT/$WIKI_DIR"
cd "$HTML_ROOT"
sudo tar -xvzf "$TAR_BACKUP" >/dev/null

sudo chown $USER "$HTML_ROOT/$WIKI_DIR"
sudo chown $USER $WIKI_SETTINGS_FNAME
sed -i -r 's/(wgDBserver.*").*(")/\1localhost\2/' $WIKI_SETTINGS_FNAME

wgDBname=$(<"$WIKI_SETTINGS_FNAME" perl -lne 'print for /wgDBname.*"(.*)"/')
wgDBuser=$(<"$WIKI_SETTINGS_FNAME" perl -lne 'print for /wgDBuser.*"(.*)"/')
wgDBpassword=$(<"$WIKI_SETTINGS_FNAME" perl -lne 'print for /wgDBpassword.*"(.*)"/')

echo "Restoring SQL backup $SQL_BACKUP..."
echo
gunzip < "$SQL_BACKUP" | mysql -u "$wgDBuser" -p"$wgDBpassword" "$wgDBname"

sudo chown -R www-data "$WIKI_DIR"
sudo chgrp -R www-data "$WIKI_DIR"
}

restore_wiki miki
restore_wiki crypto


</source>
</source>
Line 1,181: Line 1,287:
#~/bin/sshproxy stop >/dev/null
#~/bin/sshproxy stop >/dev/null
#~/bin/sshproxy start
#~/bin/sshproxy start

</source>
}} }}
=== Directory /home/beq06659/etc ===
'''backup_definition'''
{{pl2|{{hiddenSourceFile|/home/beq06659/etc/|backup_definition|<source lang=text class="backup_definition">
BACKUPPREFIX=wiki
BACKUPID=www.noekeon.org_miki
BACKUPEXT=sql.gz
BACKUPCMD="ssh noekeon '~daemenj/private/backup_wiki ~daemenj/kiwi.noekeon.org/miki/LocalSettings.php'"

BACKUPPREFIX=wiki
BACKUPID=www.noekeon.org_miki
BACKUPEXT=tar.gz
BACKUPCMD="ssh noekeon 'cd ~daemenj/kiwi.noekeon.org; /usr/bin/nice -n 19 tar -cz miki/'"

BACKUPPREFIX=wiki
BACKUPID=www.noekeon.org_crypto
BACKUPEXT=sql.gz
BACKUPCMD="ssh noekeon '~daemenj/private/backup_wiki ~daemenj/kiwi.noekeon.org/crypto/LocalSettings.php'"

BACKUPPREFIX=wiki
BACKUPID=www.noekeon.org_crypto
BACKUPEXT=tar.gz
BACKUPCMD="ssh noekeon 'cd ~daemenj/kiwi.noekeon.org; /usr/bin/nice -n 19 tar -cz crypto/'"

</source>
}} }}
'''crontab''' - Install this file with
:<code>crontab -u beq06659 ~/etc/crontab</code>
{{pl2|{{hiddenSourceFile|/home/beq06659/etc/|crontab|<source lang=bash class="crontab">
# Crontab for user beq06659
#
# Install this crontab with
#
# crontab -u beq06659 crontab
#
# Use /bin/bash to run commands, instead of the default /bin/sh
SHELL=/bin/bash
# Define variable USER because we need it in our job scripts
USER=beq06659
# Mail any output to 'beq06659', no matter whose crontab this is
MAILTO=beq06659
#
#
# m h dom mon dow command (dow=0|7 is sunday)
37 * * * * ~beq06659/bin/backup_main ~beq06659/etc/backup_definition


</source>
</source>

Revision as of 00:24, 25 November 2009

These are the configuration files on Configuration NXP Dell Latitude D620 - AndLinux.

Windows Host files

settings.txt

AndLinux files

Directory /etc

fstab

Directory /etc/privoxy

set-network-config - This file must be chmod 755. Also the following line must be added to /etc/sudoers:

ALL ALL=(ALL) NOPASSWD: /etc/privoxy/set-network-config

config-home.patch

config-nxp.patch

config-nxp_auth - symlinked to config-nxp

config-nxp_direct.patch

Directory /usr/local/bin

be - This script would ideally require to add the following line to /etc/sudoers:

ALL ALL=(ALL) NOPASSWD: /bin/loadkeys

ssh-agent-refresh.sh

Directory /home/beq06659

.bashrc - Everything before #### CUSTOMIZATION is the original file.

.dircolors.cfg

.inputrc

.profile

.vimrc

Directory /home/beq06659/.ssh

config-home

config-nxp

config-nxp_auth - symlinked to config-nxp

config-nxp_direct - symlinked to config-nxp

proxy.conf-default

proxy.conf-home - symlinked to proxy.conf-default

proxy.conf-nxp - symlinked to proxy.conf-default

proxy.conf-nxp_auth

config-home-nxp_direct - symlinked to config-default

Directory /home/beq06659/bin

backup_main - This file must be chmod 700.

generate_wiki_config_file_page.sh - This file must be chmod 700.

restore_wiki.sh - This file must be chmod 700.

set-network.sh - This file must be chmod 700.

sshproxy - This file must be chmod 700.

startup.sh - This file must be chmod 700.

Directory /home/beq06659/etc

backup_definition

crontab - Install this file with

crontab -u beq06659 ~/etc/crontab