Debian Lenny - set proxy for apt

Tuesday, 1 June 2010 12:20 by myro

If you need to set up a proxy into your debian machine you should open you terminal and run the following command:

HTTP Proxy
export http_proxy="http://USERNAME:PASSWORD@PROXYSERVER:PORT"

FTP Proxy
export ftp_proxy="ftp://USERNAME:PASSWORD@PROXYSERVER:PORT"


hope it helps

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   Linux
Actions:   Bookmark and Share | Permalink | Comments (0) | Comment RSSRSS comment feed

Debian Lenny: install and test your new USB sound card.

Saturday, 20 March 2010 13:36 by myro

Attach your usb sound card and see what your kernel says:

 # dmesg | tail

[  874.802892] usb 3-1: New USB device found, idVendor=0763, idProduct=2010
[  874.802900] usb 3-: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  874.802907] usb 3-1: Product: Fast Track
[  874.802911] usb 3-1: Manufacturer: M-Audio
[  874.803093] usb 3-1: configuration #1 chosen from 1 choice
[  875.442986] usbcore: registered new interface driver snd-usb-audio
 
Ok, you debian machine has recognized correctly your sound card.  Make sure your snd-usb-audio module is loaded correctly
 
# modprobe snd-usb-audio 
 
Now using aplay we can list out playback devices:
 
# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC262 Analog [ALC262 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 3: ATI HDMI [ATI HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Track [Fast Track], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
 
As you can see card 2 is my usb audio card.
If your usb sound card comes with a microphone, you should test if the capture device is working correcty:  use arecord for this test,
 
# arecord -l
 **** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC262 Analog [ALC262 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Track [Fast Track], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
 
 Yep! Looks like card 2 should be able to register my voice. But before testing if everything is working correctly, check your card's volume using alsamixer:
 
# alsamixer -c 2 -V all

 
 
In alsamixer the -c parameter is used to select what card do want to manage and the -V all isused to display all cards volumes.
 
Finally we can make a simple test by recording your voice and playing out.
To record:
#arecord -d 10 --device=hw:2,0 -f cd -t wav /tmp/tmp.wav
 
and to playback
# aplay --device hw:2,0  /tmp/card2.wav 
Playing WAVE '/tmp/card2.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo 
 
Make sure you are testing the correct card through the parameter --device=hw:2,0.
hw: 2,0
means that you are using the Card 2 and the device 0: card 2: Track [Fast Track], device 0: USB Audio [USB Audio]
 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:  
Actions:   Bookmark and Share | Permalink | Comments (0) | Comment RSSRSS comment feed

SharePoint 2007: EXECUTE permission denied on object 'proc_putObject', database 'SharePoint_Config', schema 'dbo'.

Tuesday, 17 November 2009 15:51 by myro

If you receive the followin error:

EXECUTE permission denied on object 'proc_putObject', database 'SharePoint_Config', schema 'dbo'.
EXECUTE permission denied on object 'proc_putDependency', database 'SharePoint_Config', schema 'dbo'.
EXECUTE permission denied on object 'proc_putDependency', database 'SharePoint_Config', schema 'dbo'.
EXECUTE permission denied on object 'proc_putDependency', database 'SharePoint_Config', schema 'dbo'.
EXECUTE permission denied on object 'proc_putDependency', database 'SharePoint_Config', schema 'dbo'.

when you try to activate a SharePoint 2007 Feature through the http://yoursite/_layouts/ManageFeatures.aspx?Scope=Site url, it's probably because your user probably doesn't have enough rights on your Sql Server Database.

Try to activate the feature using the stsadm command  stsadm -o activatefeature -name yourfeaturename -url http://yourserver/

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:   ,
Categories:   SharePoint 2007
Actions:   Bookmark and Share | Permalink | Comments (0) | Comment RSSRSS comment feed

How to write a byte array to a file in c#

Thursday, 5 November 2009 12:04 by myro

An another piece of code that I should always remember...

public void writeByteArrayToFile(byte[] buff, string fileName)
{
 
     try
     {
               FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.ReadWrite);
               BinaryWriter bw = new BinaryWriter(fs);
               bw.Write(buff);
               bw.Close();

      }
      catch (Exception ex)
      {
              Console.WriteLine(ex.Message);
      }
}

Currently rated 4.3 by 6 people

  • Currently 4.333333/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   .NET
Actions:   Bookmark and Share | Permalink | Comments (0) | Comment RSSRSS comment feed

Using Log Parser: get website usage statistics.

Wednesday, 28 October 2009 16:13 by myro

Microsoft Log Parser is a great tool when it comes to parse your IIS Log files. But probably you will need something more usable than a command line program: here comes the excellent tool provided by Lizard Labs: Log Parser Lizard GUI (free edition).

With this program you can query you IIS Log using a SQL-Like syntax and export your results into excel. Using Log Parser you can obtain almost any kind of information that is incapsulated into your IIS's logs. For example if you want to know, how many Http Requests (Hits) did a particular site on your web server gets  since a certain date you can run:

SELECT  date as Data, cs-username as Utente, cs-uri-stem as Url, COUNT(cs-uri-stem) as Hits
FROM 'c:\YOUR_IIS_LOG_FOLDER\ex*.log'
WHERE (cs-uri-stem NOT LIKE '%.jpg' AND
 cs-uri-stem NOT LIKE '%.gif'  AND
 cs-uri-stem NOT LIKE '%.css' AND
 cs-uri-stem NOT LIKE '%.js'  AND
 cs-username  <> null AND
 cs-uri-stem LIKE '%/YOURSITE/YOURFOLDER/%'  AND
 date >= '2009-01-01'

)
GROUP BY Data , Utente, cs-uri-stem
ORDER BY Data, Utente, Hits

As you can see, i have excluded different file types extensions, because i'm not interested in this kind of files. If you are intersted in tracking only aspx file extensions, you should modify the query in appropriate way.

Important searcheble IIS log fields are described into this table:

Table 1: IIS Log Fields

Field Name Description Uses
Date (date) The date of the request. Event correlation.
Time (time) The UTC time of the request. Event correlation, determine time zone, identify scanning scripts.
Client IP Address
(c-ip)
The IP address of the client or proxy that sent the request. Identify user or proxy server.
User Name
(cs-username)
The user name used to authenticate to the resource. Identify compromised user passwords.
Service Name
(s-sitename)
The W3SVC instance number of the site accessed. Can verify the site accessed if the log files are later moved from the system.
Server Name
(s-computername)
The Windows host name assigned to the system that generated the log entry. Can verify the server accessed if the log files are later moved from the system.
Server IP Address
(s-ip)
The IP address that received the request. Can verify the IP address accessed if the log files are later moved from the system or if the server is moved to a new location.
Server Port
(s-port)
The TCP port that received the request. To verify the port when correlating with other types of log files.
Method
(cs-method)
The HTTP method used by the client. Can help track down abuse of scripts or executables.
URI Stem
(cs-uri-stem)
The resource accessed on the server. Can identify attack vectors.
URI Query
(cs-uri-query)
The contents of the query string portion of the URI. Can identify injection of malicious data.
Protocol Status
(sc-status)
The result code sent to the client. Can identify CGI scans, SQL injection and other intrusions.
Win32 Status
(sc-win32-status)
The Win32 error code produced by the request. Can help identify script abuse.
Bytes Sent
(sc-bytes)
The number of bytes sent to the client. Can help identify unusual traffic from a single script.
Bytes Received
(cs-bytes)
The number of bytes received from the client. Can help identify unusual traffic to a single script.
Time Taken
(time-taken)
The amount of server time, in milliseconds, taken to process the request. Can identify unusual activity from a single script.
Protocol Version
(cs-version)
The HTTP protocol version supplied by the client. Can help identify older scripts or browsers.
Host (cs-host) The contents of the HTTP Host header sent by the client. Can determine if the user browsed to the site by IP address or host name.
User Agent
(cs(User-Agent))
The contents of the HTTP User-Agent header sent by the client. Can help uniquely identify users or attack scripts.
Cookie
(cs(Cookie))
The contents of the HTTP Cookie header sent by the client. Can help uniquely identify users.
Referer
(cs(Referer))
The contents of the HTTP Referer header sent by the client. Can help identify the source of an attack or see if an attacker is using search engines to find vulnerable sites.
 

If you need more informations about Log Parsers capabilites, consider visiting: http://www.securityfocus.com/infocus/1712 

Currently rated 3.3 by 3 people

  • Currently 3.333333/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   Web
Actions:   Bookmark and Share | Permalink | Comments (0) | Comment RSSRSS comment feed