Linux

Uploading PDF Expert Documents from an IPad to TUWEL

The easiest solution would be to simply move the files to another computer by using a cable or sending the files. This might be difficult as documents in the PDF-Expert folder – in contrast to the folders with pictures, films, etc. - are only rarely approachable when opening the IPad media on a Linux or Windows system.

Thus, the only solution always working for me seemed to be uploading the files (or an zipped archive) to a web-space (e.g. home.student.tuwien.ac.at or a dropbox) and downloading them (it) from another computer where the TUWEL system can be used easily.

OwnCloud for syncing calendars, address book and files

OwnCloud is an Open Source software with a commercial branch. There are many repositories for multiple operating systems and tons of how-to’s on the internet. It is based on the popular MySQL data base and uses Apache and PHP for web publishing. There are clients for file syncing and viewing available for multiple devices including iOS and Android. Syncing calendar and a address book is limited to the calDAV and cardDAV protocol. While Linux, Mac OS and iOS hast built in the protocol, there is also a client for Windows, called eM Client. For Android users, there are also a lot of DAV syncing software available in the Android-Store.

Installing Linux on Android Table

First of all, the Android device must have root access, a file manager application is needed and also busybox must be installed.

Download your favorite Linux distribution to the tablet internal storage.

Install the applications "Complete Linux Installer", "Terminal Emulator" and "androidVNC" from google play.

After the installation, open "Complete Linux installer" and click on Launch. You have to select the operative system and then click on Boot. Follow the instructions and you will have a Linux running on you tablet.

Taggings:

Solution for adding disclaimers with Zimbra

Workaround is not a solution

I've seen many workarounds to achieve functionality which should be out of the box in all mail servers, which isn't. Real solution should work tightly with MTA (Postfix, Sendmail), easy to install, configure and work almost without maintenance.
Many dirty solutions for disclaimers and signatures, like MIMEdefang, Alermime or Mailscanner, works perfectly fine and do the job. They're often based on scripts, which are fast and simple, but they've disadvantages. When there is a need to make something advanced the power ends.
We may thing that collaborative suites offer functionality in this field. Not quite. Zimbra have disclaimers, but only for single domain. If we want to add footer to multiple domains, we're on our own. HTML? Images? Personalized signatures with images and dynamic variables from LDAP? Forget about it. Built-in functionality is not even close to business needs.

Administrator it's not a programmer, it's not his task and he doesn't have time to implement everything. Writing bulletproof script isn't easy. For this job milter is needed. This piece of software it's a plug-in for Sendmail, Postfix and Zimbra. It can analyze headers and message body, accept or reject message, modify body and manipulate attachments.

MSH Disclaimer & Signatures it's a milter extension for common mail servers, like Postfix, Sendmail and Zimbra (use internally Postfix). It's a sophisticated application which works in background and does heavy email processing.
We'll add disclaimers in many ways: per user, per domain, in time range.
If we want personalized signatures and disclaimers for our users. Show them an example. Maybe they are not aware of this and we're still in dark ages of email disclaimers.
Pic. Built-in compose editor will help us to make simple and beautiful disclaimers.

Download

I'll show how to install and configure application. Our goal is to make configuration which will append different disclaimers per domain. Go to download page and get proper files for our platform. Server module is mandatory to install, desktop module works on two platforms (Windows or Linux), so we can choose between them.

Install server module
Add execute permission and run with --auto parameter, it will use default values and will install in default directory /opt/msh-ds.
# chmod +x msh-ds-milter.bin
# ./msh-ds-milter.bin --auto
If we have customized environment see more about custom parameters. After installation MTA server will be reloaded and milter will automatically run.
Make sure that defaults TCP ports 1107, 1108 are not blocked but our firewall.
Install desktop module

If we choose Windows version then run setup.exe and click couple of times Next button. If we choose Linux version then add executable bit and run install script without parameters.
$ chmod +x msh-ds-admin.bin
$ ./msh-ds-admin.bin
Run and make some rules
Run Administrator Panel. On Windows desktop find a new position in menu start. On Linux desktop an application is installed in our home directory in msh-ds-admin directory. After installation we'll need to connect to server where we installed milter extension.
Create new rule in Disclaimer Rules node. The task is easy, we want to add company disclaimer at the bottom of each message, but different disclaimer per domain. Of course we don't want to duplicate disclaimers if recipients reply several times to the same message.
Pic. Message Sender condition. This condition matches messages that
are sent by senders within the specified scope.
1. Create disclaimer for both e-mail message formats: HTML and Plain Text.
2. Define which messages should have footer. Choose from menu Message Sender condition. Put here *@domain1.com value.
3. Probably some messages need to be skipped (cron jobs, mailing lists, etc.), use Exceptions to define exclusions. To skip adding another disclaimer choose Message Keyword Searching exception and put some text which you have in disclaimer template.
4. Rules execution path. Do we need to process another rules? Yes. Set proper options when disclaimer is added or not.
5. On the last step define rule name.
Now we're almost done. Create second rule and do exactly like previous, but set *@domain2.com in Message Sender condition and make different template.
Test it and have fun
Save the changes and we're ready to test our settings. Jump to our mail client and send test message to someone (it can be to ourself).

Use rsync to copy files

There is a tremedous tool out there: rsync.
Though mostly Linux based, there is a Windows version available (using cygwin):
http://www.rsync.net/resources/howto/windows_rsync.html

Rsync can transfer files from everywhere to everywhere, so to speak. It provides network and encrypting capabilities as state of the art.

So this might seem like an overkill. But if you are after a repeatable, reliable, fast, logging scripting solution, then you are on the right side with rsync.

Here's another example: http://it-em.net/joomla/index.php?option=com_content&view=article&id=49&...

And of course, GoogleSearch will teach you a lot more.

Using VPN to connect to TUWien network

Potential users are members of the TU Vienna, who have Internet Connectivity of any kind (but not with a TUNET IP address).
When using this service a TUNET IP address will be dynamically assigned to you. In cases where rights on Institute servers should be set on the basis of an IP address, employees (only!) may also be assigned a fixed address.For this service there are no additional costs involved. Employees can use their Network Account (username@tuwien.ac.at) to gain admittance. Students can use their Student Account (eXXXXXXX@student.tuwien.ac.at) to gain admittance. Other Accounts (username@vpn.tuwien.ac.at) can be requested via the Online Account Management.
and also with CISCO SSL VPN Client (AnyConnect) you can use VPN.Cisco Anyconnect is a VPN client based on SSL technology. The software can be installed directly from our VPN-Webportal. Available for Windows (32-Bit and 64-Bit), Linux, Mac OS X.

Libnfc and Libfreefare

Libnfc (http://nfc-tools.org) is an open source library for Linux.
Unlike most NFC drivers this is a completely free MFC library and tool collection.

at first check if your reader hardware is compatible:
http://nfc-tools.org/index.php?title=Devices_compatibility_matrix
This is not a complete list. If your reader is not listed but the NFC-controller PN53x, you have a god chance that it will work.

If you want to read/write Mifare (Classic and Desfire) Tags, install the Libfreefare API first. It adds some mifare specific functions, so you can handle MIFARE Tags much easier.

Libfreefare

prerequisites
sudo apt-get install autoconf
sudo apt-get install libtool
sudo apt-get install libssl-dev

get sources and extract
wget https://libfreefare.googlecode.com/files/libfreefare-0.4.0.tar.bz2
tar -xvjf libfreefare-0.4.0.tar.bz2

install
cd libfreefare-0.4.0
autoreconf -vis
./configure --prefix=/usr
make
sudo make install

Libnfc
get sources and extract
wget http://dl.bintray.com/nfc-tools/sources/libnfc-1.7.1.tar.bz2
tar xfvj libnfc-1.7.1.tar.bz2

create configuration directory
mkdir /etc/nfc/
mkdir /etc/nfc/devices.d

create config file e.g. /etc/nfc/devices.d/nfc_arygon.conf.
connstring
name = "NFC Arygon"
connstring = arygon:/dev/ttyUSB0
allow_intrusive_scan = true
allow_autoscan = true

connstring is the most important option. If you have a different NFC-Controller or it is not connected by USB, you have to change this string.
for more configuration Options : http://nfc-tools.org/index.php?title=Libnfc:configuration
btw. the brand "Arygon" is now "Identive"

install libnfc
cd libnfc-1.7.1/
./configure --with-drivers=arygon --sysconfdir=/etc --prefix=/usr
sudo make clean
sudo make install all

(--with-drivers adept, if you have a different NFC Controller. eg. pn532_uart if you have a serial connected reader.)

Test the installation with the included examples.
cd examples
./nfc-list

This lists all the connected and recognized NFC-Readers. Try a restart if it does not work. Check the connstring and --with-drivers parameters.

Start
./nfc-poll
and hold a tag over the reader (<4cm) to read a tag.

Type ls to show all examples. Read the example sources to use the API for your own projects.

SSHDroid, AirDroid

As Google decided to remove USB mass storage support from recent android-versions (starting with version 4.0 - "Ice Cream sandwich") the phone can only be connected via PTP or MTP support. AFAIK this works quite well with Windows and Mac but unfortunately not very well with Linux.
There are however other methods to connect the phone. Two of them I used are:

Both can be obtained from the Google App Store.
SSHDroid sets up an SSH-Server on the Android phone. File transfer can be done via every ssh-able client (command line, explorer, nautilus...).
AirDroid is far more advanced. It sets up a Web server on the Android phone and lets you connect via a standard Web browser to the Android phone. Besides transfer of video, audio or picture files it allows access to standard moblie phone functionalities, like SMS writing (or reading) or camera.
For detailed descriptions of how to set up the tools please refer to the links.

Taggings:

CA Certificate

For Linux machines it is necessary to set the correct CA certificate as well. The installed certificates are stored at /etc/cert.
As many users are Using Ubuntu I give step-by-step instructions for this distribution. For other distros the steps are similar.

  • Open the Network Connection Settings-dialogue either via "System Settings" or via the Network-Icon on the menu bar on top of the screen
  • Select your eduroam-connection from the list of connections and choose "Edit"
  • Choose the "Wi-Fi Security"-tab.
  • Have a look at the "CA certificate"-settings. The certificate Deutsche_Telekom_Root_CA_2.pem has to be set. This can be done by just klicking on the button right of the label "CA certificate". The machine shall search in the right folder automatically. If not, choose /etc/cert

The attached picture shows the correctly filled in Settings dialogue.

Taggings:

restoring KVM Vm Ware deleted images

don't restart or stop the VM not at all, by doing this, you will lose your image files and this will lead to a disaster.
Linux mark the files as deleted, but they are still exist, I will show you how to restore the files.

1- Look for the pid of the running virtual machine you just deleted (for example a virtual windows server)

lsof | grep -i qcow | grep deleted
kvm 31127 root 9u REG 9,2 32212254720 2985316 /home/root/kvm/windows_2003/win2k3.qcow2 (deleted)

2-With the pid (31127) you can find the filediscriptor in /proc.

ls -al /proc/31127/fd | grep deleted
lrwx------ 1 root root 64 Nov 6 14:51 9 -> /home/root/kvm/windows_2003/win2k3.qcow2 (deleted)

3-Now suspend your virtual machine in order to prevent data loss

virsh suspend winserver

4-Restore the files to its original path and name.

cat /proc/31127/fd/9 > /home/root/kvm/windows_2003/win2k3.qcow2

5-Now you have to hard-reset your virtual machine.

virsh destroy winserver && virsh start winserver

Taggings:

Pages

Subscribe to Linux