summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Bobov <abobov@gmail.com>2013-09-25 19:29:06 +0600
committerAnton Bobov <abobov@gmail.com>2013-09-25 20:19:55 +0600
commit30012dbda6ac6fd4e2f11707c93aedd8ef7b86b6 (patch)
tree3359884b0f2d0e7c5be3be2c66fc29912ab37b49
parentb323d38acdae3c2e01408184456289124ea3a59f (diff)
Update.
-rwxr-xr-xbackup-lima6
-rwxr-xr-xf7-script.sh3
-rwxr-xr-xsibsac-vpn9
-rwxr-xr-xskype10
-rwxr-xr-xsmartinfo32
5 files changed, 48 insertions, 12 deletions
diff --git a/backup-lima b/backup-lima
index 0ec7fe3..5bece8b 100755
--- a/backup-lima
+++ b/backup-lima
@@ -2,7 +2,7 @@
set +e
-DEST=diskstation:/volume1/backup/lima
+DEST=anton@bonn:/mnt/mirror/backup/lima
{
echo /bin
@@ -10,10 +10,10 @@ DEST=diskstation:/volume1/backup/lima
echo /dev
echo /home/anton/Music
echo /home/anton/Videos
- echo /home/anton/.miro/Movies
echo /home/anton/.cache
echo /home/anton/.thumbnails
echo /home/anton/.local/share/Trash
+ echo /home/anton/.m2
echo /initrd.img
echo /initrd.img.old
echo /lib
@@ -37,4 +37,4 @@ DEST=diskstation:/volume1/backup/lima
echo /var/lib
echo /vmlinuz
echo /vmlinuz.old
-} | sudo rsync --archive --verbose --compress --progress --human-readable --delete --delete-excluded --delete-after --exclude-from=- -xdev -e ssh / /home "$DEST"
+} | sudo rsync --archive --verbose --compress --progress --human-readable --delete --delete-excluded --exclude-from=- -xdev -e "ssh -i $HOME/.ssh/id_rsa" / /home "$DEST"
diff --git a/f7-script.sh b/f7-script.sh
index ab3178b..6607b0c 100755
--- a/f7-script.sh
+++ b/f7-script.sh
@@ -3,7 +3,7 @@
set -e
INTERNAL=LVDS1
-EXTERNAL=VGA1
+EXTERNAL=HDMI1
show_usage() {
cat <<END
@@ -25,7 +25,6 @@ screen_external() {
xrandr --output "$EXTERNAL" --auto
}
screen_internal() {
- xrandr --output "$EXTERNAL" --off
xrandr --output "$INTERNAL" --auto
}
screen_mirror() {
diff --git a/sibsac-vpn b/sibsac-vpn
index 7fb26bf..d139a42 100755
--- a/sibsac-vpn
+++ b/sibsac-vpn
@@ -2,20 +2,15 @@
set -e
-if [[ $(/usr/bin/id -u) -ne 0 ]] ; then
- echo Not running as root
- exit
-fi
-
echo Connection to the VPN
-vpnc sibsac
+sudo /usr/sbin/vpnc sibsac
echo Press any key to disconnect ...
read $disconnect
echo Disconnection from the VPN
-vpnc-disconnect
+sudo /usr/sbin/vpnc-disconnect
echo VPN should now be disconnected
diff --git a/skype b/skype
new file mode 100755
index 0000000..30890e0
--- /dev/null
+++ b/skype
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+SCR="/usr/local/bin/skype-call-recorder"
+
+if [ -f "$SCR" ] ; then
+ if !(pgrep skype-call-reco >/dev/null 2>&1) ; then
+ "$SCR" &
+ fi
+fi
+PULSE_LATENCY_MSEC=30 exec /usr/bin/skype $*
diff --git a/smartinfo b/smartinfo
new file mode 100755
index 0000000..a98c0cc
--- /dev/null
+++ b/smartinfo
@@ -0,0 +1,32 @@
+#!/bin/bash
+# Get device S.M.A.R.T. and store in appropriate file.
+
+set -e
+
+die() {
+ echo $1
+ exit 1
+}
+
+get_file_name() {
+ sn=$(sed -n 's/Serial Number: \+//p' < "$1" | tr ' ' '_')
+ printf 'smart-%s-%s.txt' "$sn" "$(date +%F)"
+}
+
+[ -b "$1" ] && DEVICE="$1" || die 'First parameter must be block device.'
+
+tmp=$(tempfile)
+sudo smartctl -Ai "$DEVICE" > "$tmp"
+fname=$(get_file_name "$tmp")
+if [ -f "$fname" ] ; then
+ echo "File $fname already exists. Override? [yN] "
+ read answer
+ case "$answer" in
+ y|Y)
+ ;;
+ *)
+ exit 0
+ ;;
+ esac
+fi
+mv "$tmp" "$fname"