Tar in combination with find
daniel posted this on Aug 10th 2007 under Howto
When you want to add a selection of files to a tar archive you could do this:
find . -type f -name "*.jpg" | xargs tar rvf my.tar
Unix rules!
Things stuff and more
daniel posted this on Aug 10th 2007 under Howto
When you want to add a selection of files to a tar archive you could do this:
find . -type f -name "*.jpg" | xargs tar rvf my.tar
Unix rules!
daniel posted this on Aug 3rd 2007 under Dot NET, Howto
Add this Class:
Public Class ValueDescriptionPair
Public Value As Object
Public Description As String
Public Sub New(ByVal NewValue As Object, ByVal NewDescription As String)
Value = NewValue
Description = NewDescription
End Sub
Public Overrides Function ToString() As String
Return Description
End Function
End Class
This is the way to add items to a combobox:
Dim Test_Array As New ArrayList
For i = 0 To someArrayWithData.GetLength(0) - 1
Test_Array.Add(New ValueDescriptionPair(i, someArrayWithData(0)))
Next i
With ComboBox1
.DisplayMember = "Description"
.ValueMember = "Value"
.DataSource = Test_Array
End With
daniel posted this on Aug 3rd 2007 under Dot NET, Howto
I was using some DLL and got this error. I found this out that the DLL was returning a 1-based Array. VB.NET only has 0-based arrays. The following VB.NET script converts the 1-based Array to a 0-based Array.
Dim destArray() AS String
Dim counter AS Integer
counter = 0
For Each str As String In someDLLComponent.getStuffAsArray
ReDim destArray(counter + 1)
destArray(counter) = p
counter += 1
Next
destArray now contains a 0-based Array.
daniel posted this on Aug 1st 2007 under Howto
If you want to enable Cyrus' TLS/SSL facilities, you have to create a certificate first. This requires an OpenSSL installation
openssl req -new -nodes -out req.pem -keyout key.pem openssl rsa -in key.pem -out new.key.pem openssl x509 -in req.pem -out ca-cert -req \ -signkey new.key.pem -days 999 mkdir /var/imap cp new.key.pem /var/imap/server.pem rm new.key.pem cat ca-cert >> /var/imap/server.pem chown cyrus:mail /var/imap/server.pem chmod 600 /var/imap/server.pem # Your key should be protected echo tls_ca_file: /var/imap/server.pem >> /etc/imapd.conf echo tls_cert_file: /var/imap/server.pem >> /etc/imapd.conf echo tls_key_file: /var/imap/server.pem >> /etc/imapd.conf
Thanx to http://www.delouw.ch/linux/Postfix-Cyrus-Web-cyradm-HOWTO/html/cyrus-config.html