Apr 132014
 

First of, a BIG thank you to my friend Luca Ferrarotti who inspired, actively contributed and helped me with this HowTo.

Then, something I wanted to write since a very long time. Other articles in this blog instruct about how to use OS X or iOS to build a native client to site IPSec VPN terminated on McAfee (formerly Stonesoft) Next Generation Firewall. Since I joined Stonesoft many years ago, lots of people enquired me and Support and my SE colleagues about how to build this configuration… here you are. Your voice has been listened!

I wrote this article using McAfee Next Generation Firewall version 5.5.6 and McAfee Security Management Center 5.7.0, while on client side I am on Ubuntu 12.04.4 LTS. Continue reading »

Nov 292012
 

Can’t remember how much I dug this info on the internet, always when in emergency.

Hence I’ve decided once forever to write a small note here.

Suppose that in /boot directory there is a kernel you want to remove, identified by files like:

  • abi-2.6.38-15-generic-pae
  • config-2.6.38-15-generic-pae
  • initrd.img-2.6.38-15-generic-pae
  • System.map-2.6.38-15-generic-pae
  • vmcoreinfo-2.6.38-15-generic-pae
  • vmlinuz-2.6.38-15-generic-pae

Here’s the right command:

apt-get remove --purge linux-image-2.6.38-15-generic-pae

If you are brave and wanna go scripting wild 🙂 first you check what kernel are you booting with using the command:

uname -r

This will give you an output like: “2.6.38-16-generic-pae”

Then you check which other kernels you have, except the one you’re booting with, using the command:

dpkg -l|egrep '^ii  linux-(im|he)'|awk '{print $2}'|grep -v `uname -r`
(yes, if you do not use egrep on the first grep it won't work)

This will return the list of kernels which are not the one you’re executing (because you excluded that one with grep -v):

linux-headers-2.6.38-15
linux-headers-2.6.38-15-generic
linux-headers-2.6.38-15-generic-pae
linux-headers-2.6.38-16
linux-headers-2.6.38-16-generic
linux-headers-generic
linux-headers-generic-pae
linux-image-2.6.38-15-generic-pae
linux-image-generic-pae

Finally, you run the remove command using:

sudo apt-get remove $(dpkg -l|egrep '^ii  linux-(im|he)'|awk '{print $2}'|grep -v `uname -r`)

TO BE CHECKED: the command above might remove also metapackages such as linux-headers-generic-pae. Hence it is safer to remove one by one the needed packages from the above list.

Jan 162010
 

Let’s start this new year by referencing an excellent system I happened to find on the Internet to perform uPnP server functionality on my Linux system.

The name of the thing is LLink and although I haven’t exploited at full yet, it looks VERY promising.

Some features:

  • Parses various video containers: vob, avi, ts, mkv, tp, mov, m2ts, evo.
  • Streams any file type the NMT player can handle: mp3, flac, jpeg, png etc.
  • Can play straight from rar files: no more need to unrar your media. (Comes with special unrar-3.7.8-seek.)
  • SSDP / UPnP discovery support (although minimal).
  • Skin support: make your own html templates or choose from pre-built.
  • Simple iMDb querying to look up media information for Jukebox skins.
  • Both HD and SD skins available.
  • Light, tiny and clean code for Unix, OsX and Windows.
  • Paginating: support to send listings in pages, with tags for Next/Prev.
  • PlayAll cgi tag, and PlayAllFrom.
  • External subtitles: subtitle files can be consolidated in one directory.
  • libdvdnav support (and libdvdcss): provides basic playback of DVD .iso and .img files and from DVD drives.
  • UDF 2.50 BD5-ISO support: provides basic playback of Bluray and HD-DVD.

Got interested? You can find more here.

Dec 312009
 

Although it could seem an oxymore, sort something in randomic order might be usefl sometimes.

Give a look to the script below, which I’m writing here for future reference.

#!/bin/bash
#
# This script creates a list of file or symbolic link to pictures in a directory
# The pictures are dynamically selected within a library of thousands
# This is to allow a wireless frame to display daily an ever changing list
# of pictures

# Define variable to be the target directory where we put the link/pictures
# This directory is regularly scanned by MediaTomb, the uPnP server talking to
# the digital frame

# Define variable to be the root directory where it will start to scan
scandir=/media/allphotos

# Clean previous contents of the directory used for streaming
cd /var/streampix
rm -rf *

# Define cycle to set the max number of photos to be displayed
# (like from 1 to 50 repeat)
for i in `seq 1 50`

# list the dir, pick a random file, add to the list
do
y="$(find $scandir -type f -iregex ‘.*\.\(bmp\|gif\|jpg\|png\)$’ | sort -R | head -1)"
cp "$y" /var/streampix/
done

Enjoy!

Nov 032009
 

Here’s another successful operation done on fantastic Linux OS that is a pure dream for other operating systems.

Situation: I have a virtual machine with 20 GB HDD, partitioned as follows:

95% ext3 on primary partition

5% swap on first partition of extended partition

I certainly can expand my hard disk, by setting the new size in VMware configuration… so I brought it to 60 GB… but then I have a problem, since I cannot use tools like gparted to extend the main partition since the swap is in the middle between the two.

What to do? Well, again Google has been a best friend.

Well done, well written, clear and… working!

Dec 102008
 

This is happening, for instance, when moving a Virtual Machine from one Server to another or when changing the physical network adapter of a server.

The reason is that NIC’s MAC Address changes, therefore Linux perform a new HW detection and creates new adapter definition, ending in situation where there’s no more eth0 but only eth1… and if /etc/networks was configured to use eth0 it will default to DHCP mode causing issues.

How to solve?

You need to edit file /etc/udev/rules.d/70-persistent-net.rules

In this file you will find one line per each network device detected.

For instance in case of detected eth1 and disappeared eth0 it will probably read something like:

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:74:1f:c6", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:72:6f:c8", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

where the second entry reports the currently detected MAC address.

How to solve this?

Delete the first line and edit the second line changing "eth1" in "eth0"… then I guess you need to reboot and eth0 will automagically reappear.