jueves, 11 de diciembre de 2008

Configuración de un servidor ftp en Ubuntu

Todos estos pasos se realizan en modo sudo:

$ sudo -i

Primero instalamos vsftpd:

# apt-get install vsftpd

Ahora se realizan los siguientes cambios en /etc/vsftpd.conf:

. Se descomenta local_enable=YES
. Se descomenta chroot_local_user=YES

Despues reiniciamos el servidor ftp

# /etc/init.d/vsftpd restart

Ahora procedemos a crear el grupo donde estaran los usuarios que podran conectarse via ftp:

# groupadd ftp

Cambiamos el permiso de acceso a la carpeta ftp default:

# chown ftp:ftp /home/ftp

Todos los pasos anteriores se realizan para configurar el servidor. Ahora vamos con el proceso para agregar usuarios.

Primero creamos la carpeta donde estaran los archivos del usuario, en este caso, como ejemplo, llamado test:

# mkdir /home/ftp/test
# chown root:ftp /home/ftp/test

Creamos el usuario:

# useradd -g ftp -d /home/ftp/test test

Se le asigna una contraseña:

# passwd test

y listo el usuario ya se puede loggear.

jueves, 13 de marzo de 2008

How to reproject in VBA of ArcMap

Dim pSpatialRefFact As ISpatialReferenceFactory
Dim pProjCoordSys As IProjectedCoordinateSystem
Dim point As WKSPoint

Set pSpatialRefFact = New SpatialReferenceEnvironment
Set pProjCoordSys = pSpatialRefFact.CreateESRISpatialReferenceFromPRJFile("Test.prj")
point.X = 627106.5
point.Y = 4484124.4
pProjCoordSys.Inverse 1, point
Debug.Print "->", point.X, point.Y
pProjCoordSys.Forward 1, point
Debug.Print "<-", point.X, point.Y
Set pProjCoordSys = Nothing
Set pSpatialRefFact = Nothing

jueves, 6 de marzo de 2008



Un tester orgulloso de su trabajo (lo que implica un programador no tan orgulloso).


Daniel Isaias comprobando que el sistema realmente cargue los temas.

STAR ALPHA TESTER



No pues ahi esta mi hijo testeando mi software. Lastima que no sabe aun escribir en papel y se le olvido grabar el notepad con la lista de errores... ni pex a que testee de nuevo.

jueves, 28 de febrero de 2008

How to use OPENXML in Transact-SQL


DECLARE @idoc int;
DECLARE @xml varchar(max);

EXEC sp_xml_preparedocument @idoc OUTPUT, @xml;
SELECT afield FROM OPENXML(@idoc, '/anodename/.../anodename[@anattribute="..."]/.../anodename[@anattribute="..."]', 1) WITH (afield int);
EXEC sp_xml_removedocument @idoc;

martes, 26 de febrero de 2008

T-SQL Cursors (autoreminder)


DECLARE thecursor CURSOR FOR SELECT ...;
OPEN thecursor;
FETCH NEXT FROM thecursor INTO @thevariable;
WHILE @@FETCH_STATUS = 0
BEGIN
...
FETCH NEXT FROM thecursor INTO @thevariable;
END
CLOSE thecursor;
DEALLOCATE thecursor;

domingo, 24 de febrero de 2008



Which Office Character Are You?

You are part Michael. Deep down, you are caring and good-natured, but you often express yourself in insensitive ways. Though you always try your hardest to make your talents be seen, you could use a little more self-awareness to avoid being awkward.
You are part Jim. You are personable, easy-going, and always socially aware. Your great sense of humor and impishness soften the blow of what might otherwise be a dark, cutting cynicism.
Find Your Character @ BrainFall.com

Customizing BoundField

This is a way to customize BoundField, to be able to support multiline textbox.


Namespace System.Web.UI.WebControls
Public Class MultilineField
Inherits BoundField

Private m_Rows As Integer

Public Property Rows() As Integer
Get
Return m_Rows
End Get
Set(ByVal value As Integer)
m_Rows = value
Me.OnFieldChanged()
End Set
End Property

Protected Overrides Function CreateField() As DataControlField
Return New MultilineField
End Function

Protected Overrides Sub InitializeDataCell(ByVal cell As DataControlFieldCell, ByVal rowState As DataControlRowState)
MyBase.InitializeDataCell(cell, rowState)
If (rowState And DataControlRowState.Insert) Or (rowState And DataControlRowState.Edit) And (Me.DataField <> "") Then
With CType(cell.Controls(0), TextBox)
.TextMode = TextBoxMode.MultiLine
.Rows = Me.Rows
End With
End If
End Sub
End Class
End Namespace