SyncMaster 2232bw on Windows 7 1680 x 1050 ATI 3850 AGP

On Windows 7, to get the 1680 x 1050 resolution running on a Samsung SyncMaster 2232BW attached to an ATI 3850 AGP graphics card, you will need two pieces of software:

- The Samsung SM 2232BW driver, from here
- The ATI Catalyst driver (9.1 or over) from here

This is the installation process:
- First, install the ATI driver and reboot
- Then install the Samsung driver
- Select the Analog (and not Digital) version
- Force the mode in the ATI Catalyst Control Center

Sound in Ubuntu using the VIA VT1708/A on-board sound card

The Ubuntu 9.10 (Karmic Koala) distribution is an almost flawless and amazing distro for desktop use, despite what some say.

Unfortunately, owners of the Asrock 4CoreDual SATA2 motherboard will face sound problems though due to the lack of support for Linux by the manufacturer. Shame on them, they should not be ignoring Linux as a valid OS.

Despite this, there is a workaround for getting the VIA VT1708/A [Azalia HDAC] High Definition Audio Controller to work.

1) Install the "alsa-oss" package using the Synaptic package manager. (v1.0.17-1 at the time of writing)
2) Right-click on the audio icon (top left of desktop) and click "Preferences"
3) At the bottom, change the Profile to "Analog Output" or "Analog Output Duplex". You may choose any surround profiles supported if you have the right speakers. That's it!

Enjoy your Karmic Koala audio.

Ubuntu xorg.conf: 1680x1050 with Ati 3850 AGP on 22" Samsung Syncmaster 2232BW

Following my previous post on getting Kubuntu 9.04 (Jaunty Jackalope) working on a 22" screen using 1680x1050 (and NVidia drivers) I'm going to post how I got a Ubuntu 9.10 (Karmic Koala) 1680x1050 resolution on a 22" screen (for ATI 3850 AGP).

I found out that using xrandr is by far the easiest and most sure-fire way of configuring obscure resolutions for Ubuntu. So this post is applicable even if your resolution is not the aforementioned, but it is obscure enough not to be available on the default display resolutions list provided by either Ubuntu or your graphics card manufacturer.

So this is how this works. Running xrandr gives us a bunch of info about the currently supported resolutions. Note that 1680x1050 is not there:

$ xrandr

Screen 0: minimum 320 x 200, current 1600 x 1200, maximum 1600 x 1600
DFP1 disconnected (normal left inverted right x axis y axis)
DFP2 disconnected (normal left inverted right x axis y axis)
CRT1 connected 1600x1200+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
1600x1200 60.0*+
1400x1050 60.0
1280x1024 60.0 47.0 43.0
....

To add a new mode, first you must establish the modeline, so do this:

$ cvt 1680 1050 60.0Hz
# 1680x1050 59.95 Hz (CVT 1.76MA) hsync: 65.29 kHz; pclk: 146.25 MHz
Modeline "1680x1050_60.00" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync

Now we can use the modeline to create and then add a new mode:

$ xrandr --newmode "1680x1050_60.00" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync
$ xrandr --addmode CRT1 1680x1050_60.00


That's it! Now simply backup your /etc/X11/xorg.conf and run your graphics card manufacturer's utility (e.g. ATI Catalyst Center) and the new mode should be there. Do not use the built-in Ubuntu display manager (System->Preferences->Display) as it will overwrite your xorg.conf and mess up your resolution in the process!

The resulting xorg.conf for my setup was the following:

$ more /etc/X11/xorg.conf
Section "ServerLayout"
Identifier "amdcccle Layout"
Screen 0 "amdcccle-Screen[1]-0" 0 0
EndSection

Section "Files"
EndSection

Section "Module"
Load "glx"
EndSection

Section "Modes"
Identifier "16:10"
ModeLine "1680x1050 (GTF)" 147.1 1680 1784 1968 2256 1050 1051 1054
1087
EndSection

Section "Monitor"
Identifier "Generic Monitor"
UseModes "16:10"
HorizSync 30.0 - 83.0
VertRefresh 60.0 - 60.0
Option "DPMS"
EndSection

Section "Monitor"
Identifier "0-CRT1"
Option "VendorName" "ATI Proprietary Driver"
Option "ModelName" "Generic Autodetecting Monitor"
Option "DPMS" "true"
Option "PreferredMode" "1680x1050"
Option "TargetRefresh" "60"
Option "Position" "0 0"
Option "Rotate" "normal"
Option "Disable" "false"
EndSection

Section "Device"
Identifier "Default Device"
Driver "fglrx"
EndSection

Section "Device"
Identifier "amdcccle-Device[1]-0"
Driver "fglrx"
Option "Monitor-CRT1" "0-CRT1"
BusID "PCI:1:0:0"
EndSection

Section "Screen"
Identifier "Default Screen"
Device "Configured Video Device"
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1680x1050"
EndSubSection
SubSection "Display"
Depth 16
Modes "1680x1050"
EndSubSection
EndSection

Section "Screen"
Identifier "amdcccle-Screen[1]-0"
Device "amdcccle-Device[1]-0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection

NHibernate cheat sheet using Attributes

A few common mapping examples when using the NHibernate ORM with Attributes.

Class

This is a required attribute for all Entity classes:
[Class(NameType=typeof(Being),Table="Being",Lazy=false)]
public class Being ...

Id
All classes should specify a unique table identifier:
[Id(0, Name="Id", Column="Id")]
[Generator(1, Class="native")]
public long Id
{
get;
set;
}


Sub-classing (joined table per sub-class)
When extending a class you can use 3 types of subclassing that NHibernate recognises. For subclassing by creating a table per sub-class use:
[JoinedSubclass(NameType=typeof(BusinessContact),
ExtendsType=typeof(Being),
Table="BusinessContact", Lazy=false)]

public class BusinessContact : Being ...

In this case sub-classes must override the Id property:
[Key(Column = "Id")]
public override Id {
get { return base.Id; }
set { base.Id = value; }
}


One to One
Use this when a one-to-one association is required between two classes (in this case PrintingSettings is within a BulkPrintingJob class):
[Key(0, Column = "BulkPrintingJobId")]
[OneToOne(1,
ClassType = typeof(PrintingSettings),
Cascade = "save-update")]

public virtual PrintingSettings Settings
{
get;
set;
}


One to One v2
Similar to above but for same class types ('Address') e.g. linked lists. Set to unique and contained within another Address.
[ManyToOne(0, ClassType = typeof(Address),
Cascade = "none",
Unique = true)]

public Address PreviousAddress
{
get;
set;
}


One to Many
Typically used for holding multiple objects relating to an object. Example where a business contact has multiple email addresses:
[Bag(0, Cascade = "all-delete-orphan", Lazy = false)]
[Key(1, Column = "BusinessContactId")]
[OneToMany(2, ClassType = typeof(Email))]
public IList Emails { get; set; }

Many to Many (IList example)
An example where categories have accessors who can access these:
[Bag(0, Cascade = "none", Lazy = false)]
[Key(1, Column = "CategoryId")]
[ManyToMany(2, ClassType = typeof(Accessor))]
public IList Accessors
{
get;
set;
}


Many to Many (Array example)
Example where a group has group members (uses Arrays instead of ILists):
[Array(0, Cascade = "none")]
[Key(1, Column = "BeingGroupId")]
[Index(2)]
[ManyToMany(3, ClassType = typeof(Being),
Column = "_beingId")]

public Being[] GroupMembers
{
get;
set;
}


Many to One (& parent/child)
An example where a BeingGroup contains other BeingGroups.
[ManyToOne(0, ClassType = typeof(BeingGroup),
Cascade = "none")]

public BeingGroup Parent
{
get;
set;
}



Trust Verisign Class 3 Citrix certificate in Linux Citrix sessions

Citrix Systems make among other things remote access server software which you access with the so-called Citrix Server Client software, downloadable from the installed Citrix server.

This is fine in most instances and most users, where everything works out-of-the-box. When using the Linux versions of the client though, you may get an error message as such:

"You have not chosen to Trust Verisign Class 3 certificate" or something along these lines.

This is the process which will ensure the Verisign Class 3 certificate is trusted:

1) Install Citrix Server ICA client (linuxx86.tar.gz) from the Citrix host
2) Save the Verisign Class 3 Secure Server CA certificate I attach (you may also download this directly from Verisign)
3) Save as/rename it to class3.crt
4) Move this file to your ICAClient/linuxx86/keystore/cacerts folder
5) Try again now, it should work now.

This has been tested with the Kubuntu and openSUSE distros.



Kubuntu xorg.conf: 1680x1050 with NVidia FX series on 22" Samsung Syncmaster 2232BW

Setting a 1680x1050 (widescreen) resolution on Linux is for some reason quite difficult.

Maybe not enough Linux users prefer this resolution for it to be as straightforward to set as for instance 1920x1080 (widescreen) or 1280x1024.

But this is the native resolution of 22 inch monitors, such as the SyncMaster 2232BW by Samsung and having one as such becomes quite a painful experience on too many distros.

The following are taken from the xorg.conf that basically guarantees to get this resolution going. It works on various distros, such as OpenSUSE and Kubuntu. The trick was to remove all other resolutions, forcing this one...

It is geared towards proprietary NVidia FX drivers, so if you do not have one, remove the "Module" and "Driver" sections.

Here are the contents of the /etc/X11/xorg.conf file:



Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS"
UseModes "16:10"
HorizSync 30-83
VertRefresh 60
EndSection

Section "Screen"
Identifier "Default Screen"
Device "Configured Video Device"
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1680x1050"
EndSubSection
SubSection "Display"
Depth 16
Modes "1680x1050"
EndSubSection
EndSection

Section "Modes"
Identifier "16:10"
ModeLine "1680x1050 (GTF)" 147.14 1680 1784 1968 2256 1050 1051 1054 1087
EndSection

Section "Module"
Load "glx"
EndSection

Section "Device"
Identifier "Configured Video Device"
Driver "nvidia"
Option "NoLogo" "True"
EndSection




Hopefully this will make your life a little bit more productive.


The IP protocol (Internet Protocol)

The internet protocol is one of the most widely used protocols today. You may not realize it, but you use the IP protocol even at this very instant. To understand how, please see the diagram below. This diagram is usually called the networking stack diagram:


The stacked organisation implies that whenever you use a high level protocol (such as you do now for instance with HTTP -the web protocol), a number of other protocols are actually used which allow for the HTTP protocol to function. Some examples of such protocols would be ARP, DNS, IP, TCP, etc. but of these only IP and TCP are used by HTTP. It is important to clarify that other protocols such as DNS, ARP, etc. are supporting protocols, not used. This will be clarified even further later on, so keep reading.



This is an important observation, because it means if you can capture the packets that describe lower-level protocols, you can effectively analyse/decipher higher level protocols too. Let's focus on the IP protocol, which stands for Internet Protocol.

The Internet Protocol (IP) is the basis of internet-related protocols. It allows for an unreliable way of addressing hosts within a network or even an inter-network (internet), as it is a packet-switching network communications protocol. This is what the structure of an IP network packet looks like:


A number of things of interest can be identified when observing the structure. Every IP packet has one source and one destination address. There are a number of other fields, relating to the correct operation of the IP protocol, including:
  1. Version number
  2. Flags, signifying various things, such as whether packet fragmentation is allowed
  3. Header checksum, allowing for header validation
  4. TTL, i.e. Time-To-Live which describes the maximum number of hops allowed for packets when routed from host to host

The Internet Protocol is itself 'layered' over other hardware protocols, such as Ethernet, 802.11 family protocols, etc. so it is technology independent. Some examples of how addressing works follow:

127.0.0.1 => the local machine (also known as 'localhost')
212.58.226.75 => BBC, news sub-domain (i.e. news.bbc.co.uk)
161.74.14.28 => University of Westminster primary web domain (i.e. www.wmin.ac.uk)

So in other words, the human-friendly names that you use to identify websites and other hosts are artificial and map to one or more IP addressed hosts. To find the IP address of a host, you may use various tools, provided by your operating system, such as ping, traceroute, etc. You may also perform a web WHOIS database query to do so.

IP is the most prevalent protocol for network communications on the internet. Why?
Because it is very mature (birthed in the 80's), it is standardized, it comes for free on all major computing and now some mobile operating systems, it is fast and efficient.

IP is a binary protocol. Examining it using packet sniffing tools such as Wireshark (see related blog post) whilst fetching a web-page yields the image shown on the left. The actual data is shown on the right part of the image, whereas the hex representation is on the left.






Each bit shown on the image on the left corresponds to a different protocol. The cyan bit is 16 bytes in length and contains Ethernet frames (i.e. hardware-related communications data). The yellow bit is IP & TCP protocol data and the red bit is HTTP data.




Nice collection of security tools

There are numerous security-related tools one can find nowadays on the internet. Furthermore, collections of tools come bundled in all-in-one solutions such as the Linux distro BackTrack.

Sifting through these is not easy, especially if you don't know which one are the most interesting and the most effective. A list of some is included here, feel free to add to the list.

This is not an exhaustive list of penetration testing and such tools by any means. Just a few handpicked utilities and resources that are recommended if not essential for your network's security. Here is the list:

Scanning/mapping tools
Allow you to scan targets, map networks, detect vulnerabilitities: wireshark, kismet, nmap, amap, nessus, satan

Multipurpose/suites
backtrack, cain

SQL Injection/fuzzers
Allow for SQL injections, exploiting poorly designed applications and buffer overflow problems
absinthe, bed

Exploits for privilege escalation
Allow for gaining root/administrator privileges: openssl scanner, metasploit

Defense/detection
Allow for proactively defending from various threats: iptables, snort

Cracking
Allow for making use of resources that are not yours, various tools exist, depending on target: WEP/WPA, Linux, Windows, etc.

Backdoors
Allow for maintaining access after breaking in, without having to break in again: matahari, subseven, SilentDoor, SafeBreaker

Rootkits
Allow for maintaining stealthy access by preventing being detected, various tools for *nix/win32 flavours, browsing this plentiful collection is strongly advised

Forensics
Allow for undeletion of deleted files, partitions and more: sleuthkit, foremost