BackupPC for workstations

Today I publish my script to do daily backups on a BackupPC Server http://backuppc.sourceforge.net/ on workstations which are not online all the time. BackupPC is normally used to do daily backups from servers, but this is a problem for workstations which are normally offline on backup times like 3:00AM (I heard people sleep during this time (wired)).

Therefore there are some solutions:

  1. Disable automatically backup in BackupPC and make in manually by clicking on the backup button in the webinterface
  2. Turn on the workstations in the night with wake-on-lan and power them off after the backup is done. This was my solution before i wrote this script which is also not so easy for example: whats do you do when somebody is working on the workstation after backup is finished. You can’t turn them off, but you can try ­čśÇ
  3. Use my script which can be used in a cronjob to run every minute, add it to the startup script, run it only at a given time and many more

What will the script do?

It starts the backup process on the BackupPC server as a ssh command, checks the backup state, save the last backup time to avoid to often backups and stores a pid so it run as singleton

Preparation for BackupPC:

  • Configure the workstations in BackupPC like a normal server
  • Test the backup
  • Disable the automatically backup “BackupsDisable=1”
  • Done

Where to find the script?

Indeed on github ­čśë https://github.com/wefixit-AT/backupPCworkstationScript

I hope this will help others to, comments are welcome

Missing predefs.h during compiling sources

Today I compiled freerdp (www.freerdp.com) from the latest sources to connect to a rdp connection through a rdp-gateway.

Durring compilation I get the following error:

[  0%] Building C object winpr/libwinpr/CMakeFiles/winpr.dir/synch/address.c.o
In file included from /usr/include/stdio.h:28:0,
from <folder>/FreeRDP.git/winpr/include/winpr/synch.h:25,
from <folder>/FreeRDP.git/winpr/libwinpr/synch/address.c:24:
/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory
#include <bits/predefs.h>
^
compilation terminated.
make[2]: *** [winpr/libwinpr/CMakeFiles/winpr.dir/synch/address.c.o] Error 1
make[1]: *** [winpr/libwinpr/CMakeFiles/winpr.dir/all] Error 2
make: *** [all] Error 2

It was clear that the problem must be anywhere around the libc6 libraries, but where ­čÖé

Remove and install of libc6-dev, build-essential and gcc-multilib doesn’t help. But after many hourse (no a joke after some minutes) I found it.

Here are the solution (yes it can be so easy):

apt-get install –reinstall libc6-dev

have a nice day

(This was all done under Ubuntu 14.04 amd64)

802.1x Repeater Version 0.2

v0.2 ist fertig, habe den zus├Ątzlichen Router aus v0.1 durch einen besseren WLAN-Stick ersetzt. Es war nicht so einfach einen Stick zu finden der den passenden Chip verwendet um einen AccessPoint zu erstellen. Anschlie├čend noch ein paar Stunden investiert um den Treiber ein wenig zu ├Ąndern und am Raspberry Pi kompiliert zu bekommen.

So sieht ihr v0.2:

DSC_6838

N├╝tzliche Links:

802.1x Repeater Version 0.1

Bastle seit ein paar Tagen an einer M├Âglichkeit f├╝r einen Repeater f├╝r 802.1x Authentifizierung. Leider gibt es im g├╝nstigen Bereich keinen WLAN-Repeater. Somit bleibt dieser hohe Verschl├╝sselung leider nur Firmen vorbehalten, obwohl dies mit extrem geringen kosten einfach umzusetzen ist. N├Ąhere Informationen kann ich gerne anbieten da ich in meinen Netzwerken diese Verschl├╝sselung ├╝berall verwende.

So sieht die erste Variante aus (v0.1):

DSC_6808_scaledVerwende hier einen Raspberry Pi um mich ins WLAN einzuw├Ąhlen und vorl├Ąufig einen Router um dieses dann weiter zu verteilen. Leider gibt es im normalen Handel keinen USB Stick der den Master oder AP Mode kann da ich das ganze sonst mit zwei USB-Sticks l├Âsen h├Ątte k├Ânnen.

Als Finale L├Âsung plane ich eine Flotte von Raspberry Pi die ein autonomes (+selbstheilendes) Netzwerk erzeugen um auch in alle Bereiche eine ideal Netzwerkverbindung zu gew├Ąhrleisten.

Falls jemand interessiert ist stelle ich gerne die Ger├Ąte ├╝berall auf.

Ziel: Plane einen lokalen mini ISP aufzubauen. Im privaten Bereich erhalten seit l├Ąngerer Zeit meine Nachbarn Internet ├╝ber meine Leitung, nat├╝rlich gratis.

here are my favorite modifikations for gnome3

1. show the date beside the time

shell: gsettings set org.gnome.shell.clock show-date true

gnome3_clock2. autostart some applications: gnome-session-properties

3. extract archives in nautilus from the context menu

shell: yum install file-roller-nautilus

4. a menu with some shortcuts to my favorite applications see: gnome3: gnome-shell-extension additional menu (here in the blog ­čÖé

gnome-shell-extension_sub-menu5. extension to disable the IM, the accessiblity icon and the alternative menu

shell: yum install gnome-shell-extension-noim gnome-shell-extension-remove-accessibility-icon gnome-shell-extensions-alternative-status-menu

6. extension to move the gnote icon to upper panel:

http://www.fpmurphy.com/gnome-shell-extensions/gnote.tar.gz

7. extension to show the cpu and network usage:

https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet

important: to disable some informations you can comment out eg “swap: Swap.instance” in the main() function from extension.js (~/.local/share/gnome-shell/extensions/system-monitor\@paradoxxx.zero.gmail.com/extension.js)

gnome3_system-monitor8. extension to copy the favorite tab to the upper main panel, you can find it here: http://intgat.tigress.co.uk/rmy/extensions/index.html

after you extract the archive you can find the extension
Panel_Favorites@rmy.pobox.com

gnome3_favorite_paneladditional hints:

  • refresh gnome 3 without closeing all applications
    alt+f2: r

create mirror repository for fedora

how to create a mirror repository for your local lan.

  1. create a destination folder eg: /var/www/html/repo/
  2. create subfolders for fedora eg: /var/www/html/repo/f15/x86_64/updates/repodata
  3. download the files from repository to local folder. i use the following line to copy the files from an official repository, this may take a little time

    rsync -av –delete –exclude=debug rsync://mirror.ovh.net/download.fedora.redhat.com/linux/updates/15/x86_64/ /var/www/html/repo/f15/x86_64/updates/repodata/

  4. create the informations for yum:

    createrepo /var/www/html/repo/f15/x86_64/updates/

  5. configure apache to display the entries from /var/www/html/repo/
  6. create the repo config on a client /etc/yum.repos.d/fedora-updates-cache.repo

    [cache-updates] name=Fedora $releasever – $basearch – Updatesfailovermethod=priority baseurl=http://reposerver.mydomain/repo/f$releasever/$basearch/updates/ enabled=1 gpgcheck=0priority=10

  7. try to reinstall an application or update
  8. create a job with crontab to run the rsync command every day

    # min hour day month weekday user command # — update cacherepo 00 00 * * * /bin/nice -n 15 /root/scripts/update-repo.sh &>/dev/null

below i uploaded my configs for the daily job to mirror some different repos. this way should also work for centos.

files:

fedora-updates-cache.repo

update-repo.sh

gnome 3: gnome-shell-extension additional menu

after upgrading to gnome3 i missed my additional menu with shortcut’s to rdesktop and vnc. then i researched a little bit and found some usefull links, see below.

here you can see my first little menu, i minimized entries so that the code fit to the weblog.

  1. create an extension with “gnome-shell-extension-tool –create-
    extension”
  2. name: menu
  3. description: my first menu
  4. uuid: menu@localhost (you can put any name here, but remember
    the name)
  5. edit ~/.local/share/gnome-shell/extensions/menu\@localhost
    /extension.js
  6. you can find the source below

here you can see how the menu should look:

gnome-shell-extension_sub-menu

full source:

menu@localhost.tar

useful links:

http://www.fedorawiki.de/index.php?title=Gnome_3_Extensions&
oldid=15089
https://live.gnome.org/GnomeShell/Extensions
http://blog.fpmurphy.com/2011/04/gnome-3-shell-extensions.html
and take a look at: /usr/share/gnome-shell/js/ui

gnome 3, network manager: how to transfer vpn settings from laptop to pc

two days ago i have upgraded from fedora 14 to fedora 15 and had the problem that i need to transfer the vpn settings from my pc to my laptop without transcribe. after some search i found that the settings are stored into /etc/NetworkManager/system-connections.

to transfer the settings you need to copy the files to the same destination on another workstation/laptop and IMPORTANT to change the entry permissions under connection when the username differ eg:

[connection]

permissions=<groupname>:<username>:;