linux

Connect NFC-Reader to RaspberryPi

NFC - Near Field Communication - is a short range (<10cm) contactless communication protocol. Many Smartphone have an NFC-Chip and several tags (stickers, cards, kesy rings, ...) are available. How can I use an NFC reader (e.g. http://www.identivenfc.com/en/nfc-readers/nfc-oem-reader-usb.htm) on a raspberryPi? To read tags or exchange data with smartphones.

Command-line access to REST endpoints

There is a web application that offers and interface via REST-endpoints for remote access and control. I have a Linux box as my main central tool, and I am used to the "command line" way of working. How would I access the web-acpplication using command line?

Enlarging logical volumes

First, the current status of the logical volume to be resized can be monitored with

sudo lvdisplay

or, alternatively,

sudo lvs

which results in something like:

--- Logical volume ---
LV Name /dev/server/data
VG Name server
LV UUID 5t0OX9-sLc9-jPHb-k4zk-2RnE-fTzB-qjQ3qN
LV Write Access read/write
LV Status available
# open 1
LV Size 1,46 TiB
Current LE 384000
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:3

or

LV VG Attr LSize Origin Snap% Move Log Copy% Convert
data server -wi-ao 1,46t

respectively.

Afterwards, the logical volume can be resized using

sudo lvextend -L 100G /dev/server/data

or

sudo lvextend -L +100G /dev/server/data

In the first case, the logical volume is set to exactly 100 Gigabyte, whereas in the second command 100 Gigabyte are added to the current size of the logical volume.

Finally it is necessary to also set the filesystem to the new size of the volume group, as this is not done with the commands above. This can be done

for ext2/ext3/ext4 file systems with

sudo resize2fs -p /dev/server/data

for JFS file systems with

sudo mount /mountpoint -o remount,resize

for XFS file systems with

sudo xfs_growfs /mountpoint

All other file systems cannot be resized while the machine is still online!

Resizing of Logical Volume on live Ubuntu Server

One of the logical volumes of an Ubuntu Server machine needs to be resized (enlarged) in order to be able to handle the amount of data to be stored. This should happen without having to shut down the web server which is currently running on this machine.

Taggings:

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:

Kill running process in a Unix-based console with the example of the Java Web Server Grizzly

1. Step: We need to find the proper running process in the background, for that we will use the command...


ps aux

... which lists all running processes which mostly is too long of a list:


jurgen 39191 0.0 0.8 904472 69368 ?? S 2:19PM 0:11.78 /Applications/Google Chrome
jurgen 39043 0.0 0.2 2524472 13976 ?? Ss 9:51AM 0:02.62 com.apple.security.pboxd
jurgen 38473 0.0 0.0 2467260 432 ?? Ss Tue03PM 0:00.20 com.apple.XType.FontHelper
...

So we filter out only the process that we are looking for, by using the command 'grep' and using the console pipe '|' to concatenate the commands


ps aux | grep java

Result:

jurgen 39543 0.1 1.9 4845420 163316 s008 S+ 5:49PM 0:07.18 /Library/Java/JavaVirtu... exec:java
jurgen 39573 0.0 0.0 2432768 460 s007 S+ 6:08PM 0:00.00 grep java

Now this returns us the proper process but also the 'grep' process itself which we were just running in our pipe, to filter this, we concatenate yet another 'grep -v grep':


ps aux | grep java | grep -v grep

... and we only get the process we need

jurgen 39543 0.1 1.9 4845420 163316 s008 S+ 5:49PM 0:07.18 /Library/Java/JavaVirtu... exec:java

Now that we have identified our process with its process number 39543 (second column in our process), we can terminate it with the 'kill -9'* command, as follows:


kill -9 39543

* If your wondering: The -9 parameter tells the kill-Command to send a SIGKILL signal to our process

In conclusion the following - more generic code - needs to be executed:

ps aux | grep [server_process_name] | grep -v grep
kill -9 [identified_process_id]

Taggings:

Web server process running in the background needs to be closed

When working with web servers (such as Tomcat, Apache, etc.) their processes are usually started in the background and cannot be easily closed by Ctrl+C or the Close-Button in GUIs. This goes for both the development process on a developer's workstation, as well as directly on the server in test or production. In Windows based systems those processes can be easily found in the process manager that can be accessed via the GUI. In Unix based systems (Linux, MacOSX) such a GUI doesn't always exist (especially on the server) or is sometimes hard to find. We need a console based solution to ... <ul> <li>Find the right web server process that is running in the background</li> <li>Terminate it via the console</li> </ul>

Use GMail account for syncronization

One possibility to synchronize the contacts is to use a google mail account. This works because GMail is able to import contacts exported by outlook as comma separated file. When using the Nexus Phone one typically uses a GMail account anyway, so this is a natural way to do it.
Follow these steps:

  • Create a gmail account.
  • In outlook choose the menu entry file->import/export->export.
  • Choose Comma separated values, then Contacts.
  • Save your contacts as comma separated file.
  • On GMail go to Contacts and choose from button More the entry import contacts.
  • Choose the file you just exported and push Import.
  • Thats it, more or less. As the Google Nexus will synchronize all mails and contacts with your google account automatically (of course it has to be set up accordingly) the contacts will appear at the phone after a short time. Additionally it shall be mentioned that Google has a great tool to find duplicate contact-entries or to merge contacts.

Taggings:

Transfer contacts from Nokia Phone (Symbian) to Google Phone (Android)

In the company I worked, I used Windows, Outllok and Nokia Phone N97mini. During that time I managed all my contacts at my company phone, which was used as private phone too. There is the standard tool from Nokia to synchronize contacts between Windows Outlook and the phone, called "PC Suite". In fact with PC suite there is much more possible, e.g. writing SMS messages on the PC (which is much more convinient). Unfortunately there is no such tool for the Android driven Google phone, so one cannot easily transfer the contacts stored in outlook to Android. Additionally my private computer runs with Linux, while the company computer is Windows driven. I want to transfer the contacts from my Nokia Phone to the Android-phone (Google Nexus).

Using Mango for DICOM data

One possibility could be to use Wine (Windows emulator) to run the windows program present on the CD. But: Wine often has problems with graphic intense software and the chances, that this would work are rather low.
Surfing the Web showed, that there might be only one decent application to allow the same functionality than the win app.
Mango (http://ric.uthscsa.edu/mango/mango.html) is capable of displaying DICOM picture series and additionally to do additional fancy things needed by a medical doctor e.g. creating 3D models (see homepage for full functionality).
As this is a java program and does not install into the system, e.g. is not accessible via the app-menu some additional steps have to be performed.

  • Download SW from Mango HP
  • Unpack somewhere in your home-folder
  • Start the Gnome Menu editor
  • Add java -jar {path_to_Mango_program} to it

To enable all users to access the program it has to be installed into some global folder (e.g. /opt/Mango). All other steps are same asa above. Note, that only superuser can install into /opt.
Another possible program would be Open DICOM Viewer (http://sourceforge.net/projects/opendicomviewer/) but this program only has limited functionality and cannot compare to the feature richness of Mango. As Open DICOM Viewer is a Java program as well the installation instructions above also apply to it.

Pages

Subscribe to linux