23 dicembre, 2008

How to disable disk burning utility on Vista.

If you dislike the native Windows Vista disk burning utility or if you have a problem with automatic disk format popup when insert a disk in a drive (like me),
there is a method to disabile this functionality.
Open Regedit
goto : HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
Create new DWord with the name : NoCDBurning with value 1.
Restart system.

15 novembre, 2008

Asterisk - SPA3102

Hi everybody, I've worked on Asterisk these weeks and I've a great experience abount configuration of LinkSys SPA3102 and Asterisk.
My necessity was to have a Asterisk Server connect to PSTN line throught SPA3102.
I'm not an expert in VOIP but on internet I've found many and many help request and many and many configuration response. So, scan log file, read Asterisk documentation and many forums post I've found my solution.

This is the minimal configuration to achieve :
PSTN (SPA3102) <-> ASTERISK.

Ip configuration :
IP ASTERISK : 192.168.1.30
IP SPA3102 : 192.168.1.132

Asterisk (FreePbx) configuration:
Create a new Sip Extension on Asterisk Free PBX for the line1 on SPA3102.
Extension : 298 , secret 298 (Leave other parameters as default)

Create a new Sip Extension on Asterisk Free PBX for the pstn line on SPA3102.
Extension : 299 , secret 299 (Leave other parameters as default)

Create a new Custom Trunk to forward calls on the extension 299 ( PSTN line)
- Trunk name : PstnTrunk
- Outbound Caller ID : PSTN number
- Maximum Channels : 1
- Custom Dial String : SIP/299/$OUTNUM$

Create a new Outbound route to forward calls to the Custom Trunk
Dial Pattern : 0. e 3. ( in italy , local end cellular phone number )
Trunk sequence : PstnTrunk

Spa3102 configuration:
Setting static Lan ip adress to 192.168.1.132

Line1
- Proxy : 192.168.1.30 ( ip trixbox)
- Display Name : 298
- User ID : 298
- Password : 298
- Make Call Without Reg : yes
- Ans Call Without Reg : yes

PSTN line
- Proxy : 192.168.1.30
- Display : 299
- User Id : 299
- Password : 299
- Disconnect Tone : 425@-12,425@-12;1(.2/.2/1+2) ( for Italy )


User1
- Cfwd All Dest: 201@192.168.1.30 ( where 201 is a FreePbx extension to responde pstn calls )



It's all, enjoy Astersik and customize other configurations as you like.

14 ottobre, 2008

Visual Studio 2008 Setting

Hy Guys, in these days i've found a very nice VS settings that's change the editor as Vibrant Ink Textmate color settings.
I've found colours on internet and I change the dimension and font type for my business.

Application : C#, ASP.NET pages, XAML, XML
File : VibrantInk_Ciro.zip

21 settembre, 2008

Incremental backup with rsync

Hi everybody, today we talk abount rsync command and how use it to create a 7 days incremental backup to folder in a linux based system. I tested this script on FC6 but rsync is available on other linux distibutions.


   1:  #!/bin/sh

   2:  

   3:  ###### Setting Script ##########

   4:  logfile=/var/log/rsync_scotty.log

   5:   

   6:  ###### Setting Date ###########

   7:  backup_date=`date +%d/%m/%Y`

   8:  backup_hour=`date +%H:%M`

   9:  week_day=`date +%w`

  10:  data=`date +%Y%m%d`

  11:   

  12:  echo "" >> $logfile

  13:  echo "" >> $logfile

  14:  echo "" >> $logfile

  15:  echo "$backup_date::$backup_hour::Start rsync server" >> $logfile

  16:   

  17:  # list of directory to backup

  18:  LIST="/home/pippo/ /home/pluto/"

  19:   

  20:  DAY=`date +%a`

  21:  BACKUP_PATH=/backup

  22:  CURRENT=current

  23:  for d in $LIST; do

  24:          OPTS="--force --ignore-errors --progress --delete --backup --backup-dir=$BACKUP_PATH$d$DAY -a"

  25:          [ -d $HOME/emptydir ] || mkdir $HOME/emptydir

  26:          echo "rsync --delete -r $HOME/emptydir/ $BACKUP_PATH$d$DAY"

  27:          rsync --delete -r $HOME/emptydir/ $BACKUP_PATH$d$DAY/ >> $logfile

  28:          rmdir $HOME/emptydir

  29:   

  30:          echo "rsync $OPTS $d $BACKUP_PATH$d$CURRENT"

  31:          rsync $OPTS $d $BACKUP_PATH$d$CURRENT >> $logfile

  32:  done

  33:   

  34:  echo "$backup_date::$backup_hour::Finish rsync server" >> $logfile



You can find other information on http://rsync.samba.org/examples.html .

By, Ciro

06 maggio, 2008

OpenVpn Experience

Hi everybody, in my company we have a VPN service powered by OpenVpn, a standard configuration between a linux server and many windows client.
As you now, lately I've reinstalled Xp and I have some problems when configuring OpenVPN Client.
The problem is known (the openvpn website explain that) after installing XP ServicePack 2, there are some problem with windows firewall and TAPI network adapter in configuration with a dhcp openvpn server.
Now, I give you more information about my successful configuration.
1. Install OpenVpn 2.1 Rc7 (tha last at this time)
2. Disable Or configure firewall for TAP Interface
3. Download devcon.exe from Microsoft website http://support.microsoft.com/kb/311272
4. Rename the TAP connection in MyTap
5. Identify the interface ID on TAP interface using : devcon hwids =net @root\NET\*
In my case tap0901
6. Create two .bat file in the OpenVPN config directory:
ConfigFileName_pre.bat
devcon enable tap0901
ConfigFileName_down.bat
devcon disable tap0901
OpenVPN Gui launch this two file when start and close the connection ( note the name of the configfile )
7. ConfigFileName
client
dev tap
dev-node MyTap
proto tcp
remote server 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client1.crt
key client1.key
tls-auth ta.key 1
cipher BF-CBC
comp-lzo
verb 3
mute 10
route-method exe
route-delay 30
ping 5
ip-win32 netsh
8. Start OpenVpn (using ConfigFileName file of course )

Another information, if you have the same subnet network class at home and at office you have to setting the metric of a TAP interface at a lower value than Etherter connection metric.

Good VPN to all!

01 maggio, 2008

Extend ASP.NET ListBox

Hi, tonight we extend a standard ASP.NET control : the ListBox.
The ListBox have a property that allow you to specify a SelectedElement when the page is loading.. great ! . But if you have a Multiple ListBox, and you need to select many elements ?.
You can create a custom control that provide this function. You only have to set the DataSource and a list of selected item in comma separated value format.
Start with the demo code:

The new custom control derive from ListBox :
   1:  namespace MyControls
   2:  {
   3:      [DefaultProperty("Text")]
   4:      [ToolboxData("<{0}:CustomListBox runat=server></{0}:CustomListBox>")]
   5:      public class CustomListBox : ListBox
   6:      {


Now add property SelectedValues that you use to select item of the list box in comma separated values format.
   1:  private string _selectedvalues;
   2:   
   3:  [Bindable(true)]
   4:  [Category("Data")]
   5:  [DefaultValue("")]
   6:  [Localizable(true)]
   7:  public string SelectedValues
   8:  {
   9:      set
  10:      {
  11:          _selectedvalues = value;
  12:      }
  13:      get
  14:      {
  15:          return _selectedvalues;
  16:      }
  17:   
  18:  }


Now override the OnDataBound to selected the appropriate values on DataBound Event.

   1:  protected override void OnDataBound(EventArgs e)
   2:  {
   3:      base.OnDataBound(e);
   4:      if (_selectedvalues != null)
   5:      {
   6:          foreach (ListItem item in Items)
   7:          {
   8:              if (_selectedvalues.IndexOf(string.Format(",{0},", item.Value)) != -1)
   9:                  item.Selected = true;
  10:          }
  11:      }
  12:  }


And olso, you have to override this other two method to preserve data in postback events.

   1:  protected override void OnDataBinding(EventArgs e)
   2:  {
   3:      try
   4:      {
   5:          base.OnDataBinding(e);
   6:      }
   7:      catch (InvalidOperationException)
   8:      {
   9:          this.GetData().Select(DataSourceSelectArguments.Empty, new DataSourceViewSelectCallback(DoSelect));
  10:      }
  11:  }
  12:   
  13:  private void DoSelect(IEnumerable data)
  14:  {
  15:      this.PerformDataBinding(data);
  16:  }



Build your class, and add to your project.
Insert the control in your asp.net page :
   1:  <%@ Register Assembly="MyAssembly" Namespace="MyControls" TagPrefix="cc1" %>
   2:      <cc1:CustomListBox ID="CustomListBox1" runat="server" DataSource="MyDataSource" SelectedValues=",1,2,3,5"></cc1:CustomListBox>

30 aprile, 2008

WeekEnd in Tuscany

Last weekend me and my wife Laura goes to Tuscany to meet our friends Massimo, Veronica and little Matteo. Sunday we have a good time .... .

Do you know "Fiorentina Steak" ? ....... No need other words to explain !

Have a nice day!

25 aprile, 2008

Back to the Future... no XP !

I'm sorry, I didn't .
I've just finished to downgrade my notebook to XP from Vista. I've installed Vista 10 month later on Dual Core Duo Notebook with 2Gb RAM and Nvidia Quadro NVS and after a boring search of driver and program i have a good function machine.
1 week later I've installed Vista Sp1 and I haven't seen the expected benefits and the UAC control speed down opening program process.
So, I'm a coder guy, I'm not interested in grafic window movement or enhanced side-bar and finally I've decide to reinstall XP.
Ok Ok, after reinstall everything run so faster than a road runner but ..... next month let you know how it goes :-)


Good Night.

18 aprile, 2008

First Post

Hi EveryBody ! Yes, yes, yes my first post.

Sorry for my English but, I think that my Italian is not so better .....
(and my Italian teacher think also ... )

So, my name is Cirelli Alessandro I live in Ospitaletto, a little town near Brescia in Italy. My passion and my job is Information Technology: Software, Hardware, Internet .. and so on.
In a spare time, I'm a guitar player ... Hard Rock Guitar Player. I've four guitar ( Epy Les Paul, Fender Stratocaster, Ibanez S and Ibanez GB ) and a Marshall JCM 30' Anniversary with a Emazing Blue Tolex and powefull 4 cone speaker.
I don't now what this blog will speak, maybe web, maybe programming language, maybe music, maybe technology ......... I hope that doesn't bore you.

It's all .... Good Night.