Tuesday, 15 December 2009

list sort with delegate

myList.Sort(new Comparison(
delegate(MyClass a, MyClass b)
{
if (a.number <>
else if (a.number > b.number) return 1;
else return 0;
}
));

Monday, 23 March 2009

xorg.conf for Widescreen SD TV on TV-Out (s-video)

See DisplaySize setting http://www.mythtv.org/wiki/Display_Size

e.g.

Section "Monitor"
Identifier "TV"
HorizSync 30.0 - 50.0
VertRefresh 50.0
DisplaySize 320 180
EndSection

Monday, 2 March 2009

openbox Desktop context menu

Need to disable Nautilus Desktop context menu

Disable it with the gconf-editor program. Run gconf-editor and browse to "/apps/nautilus/preferences" and turn off the show desktop option. Another simpler way to get that is to call nautilus with the --no-desktop switch.

http://icculus.org/openbox/index.php/Help:GNOME/Openbox

Switch Gnome Window Manager

Applications -> System Tools -> Configuration Editor

/desktop/gnome/session/required_components -> windowmanager

Saturday, 14 February 2009

smb.conf for LAN access

Config below, also need to add samba users with:

smbpasswd –a username

# This is the main Samba configuration file. You should read the

# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command #"testparm" # to check that you have not made any basic syntactic #errors.
#
#======================= Global Settings =====================================
[global]

workgroup = home
netbios name = mistervole
server string = mistervole

# Logging Options:
# this tells Samba to use a separate log file for each machine
# that connects

log file = /var/log/samba/log.%m

# Put a capping on the size of the log files (in Kb).
max log size = 50

hosts allow = 192.168.1.100 192.168.1.101 192.168.1.102 192.168.1.103 127.

# Security mode. Most people will want user level security. See
# security_level.txt for details.

security = user

# Password Level allows matching of _n_ characters of the password for
# all combinations of upper and lower case.

password level = 8

# You may wish to use password encryption. Please read
# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
# Do not enable this option unless you have read those documents
# Encrypted passwords are required for any use of samba in a Windows NT domain
# The smbpasswd file is only required by a server doing authentication,
# thus members of a domain do not need one.

encrypt passwords = true
smb passwd file = /etc/samba/smbpasswd

# Browser Control and Networking Options:
# Most people will find that this option gives better performance.
# See speed.txt and the manual pages for details

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS
# names via DNS nslookups. The built-in default for versions 1.9.17 is
# yes, this has been changed in version 1.9.18 to no.

dns proxy = no

#============================ Share Definitions ==============================

[homes]
comment = Home Directories
browseable = no
writable = no

# This one is useful for people to share files
;[tmp]
; comment = Temporary file space
; path = /tmp
; read only = no
; public = yes

# A publicly accessible directory, but read only, except for people in
# the "staff" group
;[public]
; comment = Public Stuff
; path = /home/samba/public
; public = yes
; writable = no
; write list = @staff
# Audited directory through experimental VFS audit.so module:
# Uncomment next line.
; vfs object = /usr/lib/samba/vfs/audit.so

[photos]
path = /usr/share/data/photos
valid users = v
public = no
writeable = yes
browseable = yes
available = yes
guest ok = no

[music]
path = /usr/share/data/music
valid users = v
public = no
writeable = yes
browseable = yes
available = yes
guest ok = no

[video]
path = /usr/share/data/video
valid users = v a
public = no
writeable = no
browseable = yes
available = yes
guest ok = no

-----------------------------------------------------------
# A private directory, usable only by Fred. Note that Fred requires
# write access to the directory.

;[fredsdir]

# [Agustin]
; comment = Fred's Service
# comment = Agustin Private Files
; path = /usr/somewhere/private
# path = /home/agustin/Documents
; valid users = fred
# valid users = agustin
; public = no
; writable = yes
# writable = yes
; printable = no

Friday, 5 December 2008

smb.conf

# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command #"testparm" # to check that you have not made any basic syntactic #errors.
#
#======================= Global Settings =====================================
[global]

workgroup = home
netbios name = mistervole
server string = mistervole

# Logging Options:
# this tells Samba to use a separate log file for each machine
# that connects

log file = /var/log/samba/log.%m

# Put a capping on the size of the log files (in Kb).
max log size = 50

hosts allow = 192.168.1.100 192.168.1.101 192.168.1.102 192.168.1.103 127.

# Security mode. Most people will want user level security. See
# security_level.txt for details.

security = user

# Password Level allows matching of _n_ characters of the password for
# all combinations of upper and lower case.

password level = 8

# You may wish to use password encryption. Please read
# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
# Do not enable this option unless you have read those documents
# Encrypted passwords are required for any use of samba in a Windows NT domain
# The smbpasswd file is only required by a server doing authentication,
# thus members of a domain do not need one.

encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd

# Browser Control and Networking Options:
# Most people will find that this option gives better performance.
# See speed.txt and the manual pages for details

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS
# names via DNS nslookups. The built-in default for versions 1.9.17 is
# yes, this has been changed in version 1.9.18 to no.

dns proxy = no

#============================ Share Definitions ==============================

[homes]
comment = Home Directories
browseable = no
writable = no

# This one is useful for people to share files
;[tmp]
; comment = Temporary file space
; path = /tmp
; read only = no
; public = yes

# A publicly accessible directory, but read only, except for people in
# the "staff" group
;[public]
; comment = Public Stuff
; path = /home/samba/public
; public = yes
; writable = no
; write list = @staff
# Audited directory through experimental VFS audit.so module:
# Uncomment next line.
; vfs object = /usr/lib/samba/vfs/audit.so

[photos]
path = /usr/share/data/photos
valid users = user1
public = no
writeable = yes
browseable = yes
available = yes
guest ok = no

[music]
path = /usr/share/data/music
valid users = user1
public = no
writeable = yes
browseable = yes
available = yes
guest ok = no

[video]
path = /usr/share/data/video
valid users = user1 user2
public = no
writeable = no
browseable = yes
available = yes
guest ok = no

-----------------------------------------------------------
# A private directory, usable only by Fred. Note that Fred requires
# write access to the directory.

;[fredsdir]

# [Agustin]
; comment = Fred's Service
# comment = Agustin Private Files
; path = /usr/somewhere/private
# path = /home/agustin/Documents
; valid users = fred
# valid users = agustin
; public = no
; writable = yes
# writable = yes
; printable = no

Monday, 26 May 2008

.lircrc config file goes in ~

For Totem, VLC and Rhythmbox

---------------------------------------------------------

# lircrc for iMON
#
# To check button names on your remote, make sure lircd is running and run irw
# Pressing buttons will show the appropriate button name
#

# Non-program specific
#

# Command bindings

begin irexec

begin
button = MyMovie
prog = irexec
repeat = 0
config = vlc
mode = vlc
end

begin
button = MyMusic
prog = irexec
repeat = 0
config = rhythmbox
mode = rhythmbox
end

end irexec

##############################################
### Rhythmbox juke box player
###############################################

begin rhythmbox

begin
button = MyMovie
prog = irexec
repeat = 0
config = totem
mode = totem
end

begin
button = MyMusic
prog = irexec
repeat = 0
config = rhythmbox
mode = rhythmbox
end

begin
prog = Rhythmbox
button = AppExit
config = quit
flags = mode
end

begin
prog = Rhythmbox
button = Play
config = play
end

begin
prog = Rhythmbox
button = Pause
config = pause
config = play
repeat = 0
end

begin
prog = Rhythmbox
button = Stop
config = stop
end

begin
prog = Rhythmbox
button = Vol+
config = volume_up
repeat = 3
end

begin
prog = Rhythmbox
button = Vol-
config = volume_down
repeat = 3
end

begin
prog = Rhythmbox
button = NextChapter
config = next
end

begin
prog = RhythmBox
button = PrevChapter
config = previous
end

begin
prog = RhythmBox
button = Mute
config = mute
end

begin
prog = RhythmBox
button = Eject
config = shuffle
end

begin
prog = RhythmBox
button = FastForward
config = seek_forward
repeat = 5
end

begin
prog = RhythmBox
button = Rewind
config = seek_backward
repeat = 5
end

end rhythmbox

##############################################
### Totem player
###############################################

begin totem

begin
button = MyMusic
prog = irexec
repeat = 0
config = rhythmbox
mode = rhythmbox
end

begin
button = MyMovie
prog = irexec
repeat = 0
config = totem
mode = totem
end

begin
prog = Totem
button = AppExit
config = quit
flags = mode
end

begin
prog = Totem
button = Play
config = play
end

begin
prog = Totem
button = Pause
config = pause
config = play
repeat = 0
end

begin
prog = Totem
button = Stop
config = stop
end

begin
prog = Totem
button = Vol+
config = volume_up
repeat = 3
end

begin
prog = Totem
button = Vol-
config = volume_down
repeat = 3
end

begin
prog = Totem
button = NextChapter
config = next
end

begin
prog = Totem
button = PrevChapter
config = previous
end

begin
prog = Totem
button = Mute
config = mute
end

begin
prog = Totem
button = Eject
config = shuffle
end

begin
prog = Totem
button = FastForward
config = seek_forward
repeat = 5
end

begin
prog = Totem
button = Rewind
config = seek_backward
repeat = 5
end

end totem

##############################################
### VLC player
###############################################

begin vlc

begin
button = MyMusic
prog = irexec
repeat = 0
config = rhythmbox
mode = rhythmbox
end

begin
button = MyMovie
prog = irexec
repeat = 0
config = vlc
mode = vlc
end

begin
prog = Totem
button = AppExit
config = key-quit
flags = mode
end

begin
prog = vlc
button = Play
config = key-play-pause
end
begin
prog = vlc
button = Pause
config = key-play-pause
end
begin
prog = vlc
button = Stop
config = key-stop
end
begin
prog = vlc
button = FastForward
config = key-jump+medium
end
begin
prog = vlc
button = forward
config = key-next
end
begin
prog = vlc
button = Rewind
config = key-prev
end
begin
prog = vlc
button = Vol+
config = key-vol-up
repeat = 1
end
begin
prog = vlc
button = Vol-
config = key-vol-down
repeat = 1
end
begin
prog = vlc
button = Mute
config = key-vol-mute
end
end vlc