Showing posts with label tutorial. Show all posts
Showing posts with label tutorial. Show all posts

Sunday, October 26, 2008

Abilitare la gestione dei profili colore in Firefox 3

Un breve appunto per non dimenticare come abilitare la gestione dei profili colore in Firefox 3.
  • Aprire un nuovo tab e digitare: about:config
  • Cercare il flag: gfx.color_management.enabled
  • Doppio clic per abilitare l'opzione
  • Riavviare il browser

Monday, September 29, 2008

"Vmware Server" and USB devices

Dopo una settimana di sbattimenti sono finalmente riuscito a venire a capo di questa annosa questione. Vediamo di spiegare un poco come stanno le cose.

Precisazione iniziale: tutte le info scritte qui non sono farina del mio sacco ma dal momento che non è stato facile raccoglierle, preferisco lasciare questo appunto. In modo che sia io che i posteri possiamo usufruirne ;).

Ho una macchina virtuale Windows 2003 Server e voglio usare delle periferiche USB. Vmware Server (attualmente sto usando la versione 1.0.7-108231) non supporta le periferiche USB 2.0, questo significa che ogni volta che attaccate una periferica USB 2.0, Windows da un bel BSOD. Tra i vari suggerimenti che ho letto per risolvere questo problema c'è anche stato quello di usare un hub USB 1.1 (come se fosse facile trovarlo). Comunque ecco come ho risolto la questione:

  1. Aggiungere la riga: none /proc/bus/usb usbfs devgid=46,devmode=664 0 0 in /etc/fstab
  2. Rimuovere il modulo USB 2.0, lasciando solo quelli per USB 1.1: rmmod ehci_hcd
Questo permette di usare solo USB 1.1 ma meglio di niente ;).

Tuesday, October 2, 2007

An example of file-glob gimp script-fu function

After some attempts, I finally realize how to use:

file-glob

a GIMP script-fu function.

Here, an example:

(define filesPattern)
(set! filesPattern (string-append "/home/a_dir_with_some_jpeg/" "*.jpg"))
(define arrayFilesList)
(set! arrayFilesList (file-glob filesPattern 1))

;
; Convert the array to a SCHEME list
;
(define filesList)
(define counter)
(set! counter 0)
(while (< counter (car arrayFilesList)) (set! filesList (cons (aref (cadr arrayFilesList) counter) filesList)) (set! counter (+ counter 1)) )

;
; Now you can use "car" and "cdr" on filesList
;

Tuesday, September 4, 2007

CSI Munich zfs Saves World

A colleague passed me this link to a video from SUN that shows ZFS "bleeding edge" technology:



Awesome :)

Configure SNMP agent on Cisco devices

This article describes how to configure a Cisco Catalyst or a Cisco router in order to provide SNMP functionality.


1 - Login into Cisco device:


telnet 10.0.0.1


2 - Check if SNMP is enabled:


# show snmp
%SNMP agent not enabled

If SNMP is disabled, we enable it using:

3 - Enable SNMP

# configure terminal
# snmp-server community public RO
# snmp-server community private RW


For more information about SNMP options on Cisco devices look at [1]. By default SNMP version enabled on Cisco devices is 2c.

Now let's try to retrieve some informations using:

4 - Download and install net-snmp

* net-analyzer/net-snmp
Latest version available: 5.4
Latest version installed: [ Not Installed ]
Size of downloaded files: [no/bad digest]
Homepage: http://net-snmp.sourceforge.net/
Description: Software for generating and retrieving SNMP data
License: as-is BSD


After you installed net-snmp, you need to install Cisco MIBs. At first you should install CISCO-SMI and then CISCO-VTP-MIB (we want to retrieve vlans informations).You can download them from [2]. After downloaded copy them (changing extension from .my to.txt) to /usr/share/snmp/mibs


5 - Retrieve vlan information:


snmpwalk -m CISCO-VTP-MIB -v 2c -c public 192.168.177.34 vtpVlanState
CISCO-VTP-MIB::vtpVlanState.1.1 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.2 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.3 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.4 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.5 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.6 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.7 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.10 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.12 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.15 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.16 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.20 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.21 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.22 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.23 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.24 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.25 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.28 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.1002 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.1003 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.1004 = INTEGER: operational(1)
[...]


References:
[1] Configuring SNMP Support
[2] SNMP Object Navigator

Thursday, July 12, 2007

How to generate network load diagrams

Yesterday, someone asked me how I generated the network load diagrams used in the post "SSHFS performance test".

My original idea was to search for a ready to use software, but surfing the web I didn't found anything simple to install a quick to use. So i decided to write some bash lines to generate raw data and OpenOffice (oocalc) to draw the diagrams.

This is the script used to generate raw data:



#!/bin/bash

###################################
#
# Wed Jul 11 11:38:54 CEST 2007
#
# This script is used to generate
# network traffic statistics
#
# Author: Davide Restivo (xgutter@yahoo.it)
#
# Released under GPLv2
#
####################################

E_BAD_ARGS=65

# The default interface
INTF="eth0"

# Default output filename
TMP_FILE=`tempfile`
FILE_OUT="netmon-`basename $TMP_FILE`.out"

# Default delay measurement
TICK="1"

# Usage
function usage () {
echo "Please invoke this script with zero or three arguments."
echo ""
echo "Example:"
echo " $0 "
echo ""
echo "where:"
echo " defaults to eth0"
echo " is automatically generated"
echo " is equal to 1 second"
}

# Let's check command line arguments
if [ $# -eq 0 ]
then
:
elif [ $# -eq 3 ]
then
# Setting parameters
INTF=$1
FILE_OUT=$2
TICK=$3
else
usage
exit $E_BAD_ARGS
fi

################
##### MAIN #####
################
echo "Seconds - Byte sent - Byte received" >> $FILE_OUT

SECONDS_COUNTER="0"
while true;
do
INITIAL_BYTE_SENT=`ifconfig eth0 |grep bytes|cut -d":" -f3|cut -d" " -f1`
INITIAL_BYTE_RECEIVED=`ifconfig eth0 |grep bytes|cut -d":" -f2|cut -d" " -f1`

sleep $TICK

BYTE_SENT=$((`ifconfig eth0 |grep bytes|cut -d":" -f3|cut -d" " -f1` - $INITIAL_BYTE_SENT ))
BYTE_RECEIVED=$((`ifconfig eth0 |grep bytes|cut -d":" -f2|cut -d" " -f1` - $INITIAL_BYTE_RECEIVED ))

TEMP_SECONDS_COUNTER=$(($SECONDS_COUNTER + $TICK))
SECONDS_COUNTER=$TEMP_SECONDS_COUNTER
echo "$SECONDS_COUNTER $BYTE_SENT $BYTE_RECEIVED" >> $FILE_OUT
done

Tuesday, July 10, 2007

SSHFS performance test

Some days ago, I made some tests on SSHFS.

Let's talk, for a moment, about SSHFS.

From SSHFS home page:

This is a filesystem client based on the SSH File Transfer Protocol. Since most SSH servers already support this protocol it is very easy to set up: i.e. on the server side there's nothing to do. On the client side mounting the filesystem is as easy as logging into the server with ssh.

The idea of sshfs was taken from the SSHFS filesystem distributed with LUFS, which I found very useful. There were some limitations of that codebase, so I rewrote it. Features of this implementation are:

* Based on FUSE (the best userspace filesystem framework for linux ;-)
* Multithreading: more than one request can be on it's way to the server
* Allowing large reads (max 64k)
* Caching directory contents


Basically, SSHFS is a FUSE (File System in User Space) module.

In order to install it on gentoo GNU/Linux:

# emerge -av sys-fs/sshfs-fuse


Let's mount a remote directory:

# sshfs user1@192.168.177.172:/home/user1 temp_dir


If you would umount the remote dir, you should use the command:

fusermount -u temp_dir


Uhm, amazing simple ;), but what about network performances?

The following diagrams figure out network performances:




The tests had performed on a 100MBit network with very low traffic.

Friday, June 8, 2007

GIMP - Glow effect

Un breve tutorial su come creare un effetto di "glow" sulle proprie foto in 5 semplici passi ;).


1 - Aprite l'immagine che vi interessa modificare (questo punto è mandatory :P):




2 - Nel TAB Channel con il tasto destro scegliete "Channel to selection" (con tutti i canali selezionati):




3 - Create un nuovo livello e riempite di bianco la selezione appena creata:



4 - Dopo aver deselezionato il livello precedentemente creato. Applicate un filtro di "Gaussian Blur" con radius di 25 sia in orizzontale che in verticale.



5 - Adesso portiamo l'opacity al 90% ed ammiriamo il risultato finale :):