|
|
|
Friday, 16 July 2010 12:09 |
|
Ubuntu 10.04 Samba Standalone Server With tdbsam Backend
This tutorial explains the installation of a Samba fileserver on
Ubuntu 10.04 and how to configure it to share files over the SMB
protocol as well as how to add users. Samba is configured as a
standalone server, not as a domain controller. In the resulting setup,
every user has his own home directory accessible via the SMB protocol
and all users have a shared directory with read-/write access. Read more: |
|
|
Wednesday, 16 June 2010 05:53 |
To create a directory I would typically use File.mkdir however class Pathname can be a convenient alternative e.g.
require 'pathname'
pathname = Pathname.new '/home/james/learning/ruby/fun/today.txt'
#=> #
pathname.exist?
#=> false
pathname.basename
#=> #
#=> #
pathname.dirname.mkdir
#=> 0
# observed directory '/home/james/learning/ruby/fun' was just created
Notes:
1) There is no Pathname#mkdir_p meaning parent directories will not be created automatically.
2) If the directory to be created already exists it will create an error
e.g. Errno::EEXIST: File exists - /home/james/learning/ruby/fun
Resources:
- pathname: Ruby Standard Library Documentation [ensta.fr]
- Module: FileUtils [ruby-doc.org] Read more: |
|
Saturday, 05 June 2010 13:32 |
Use the Dir-to-XML gem to save a file directory listing to a Dynarex file.
*installation*
sudo gem1.9.1 install dir-to-xml
Successfully installed dir-to-xml-0.1.0
1 gem installed
Installing ri documentation for dir-to-xml-0.1.0...
Updating class cache with 3178 classes...
Installing RDoc documentation for dir-to-xml-0.1.0...
require 'dir-to-xml'
DirToXML.new
#=> #
file created: dir.xml
directory | tag
fun.txt
file
.txt
2010-06-05 17:24:10 +0100
2010-06-05 17:24:10 +0100
2010-06-05 17:24:10 +0100
html
directory
2010-05-07 19:20:54 +0100
2010-05-07 19:20:54 +0100
2010-05-07 19:20:56 +0100
ruby
directory
2010-06-05 17:20:18 +0100
2010-06-05 17:20:18 +0100
2010-06-05 17:20:18 +0100
dir.xml
.xml
2010-06-05 18:19:03 +0100
2010-06-05 18:19:03 +0100
2010-06-05 18:19:03 +0100
Resources:
- Create a directory listing in XML format [dzone.com]
- jrobertson's dir-to-xml at master [github.com] Read more: |
|
|
Friday, 16 April 2010 10:16 |
In the following example the routes can determine if the URI is an alias, a file, a directory, or is the root path.
#!/usr/bin/ruby
# file: test.rb
require 'sinatra'
get '/' do
"home"
end
get '/:file*.*' do
"file"
end
get '/:alias' do
"alias"
end
get '/:directory/' do
"directory"
end
Tested (http://niko:4567) observed
----------------------- --------
/README alias
/README/ directory
/README/fun.txt file
/fun alias
/ home
/home.txt file
/home.txt/ file
/home/file.txt file
/home/f Sinatra doesn't know this ditty
/home/ directory
/home?edit=1 alias
/home/?edit=1 directory
/home.xml?edit=1 file
Note: Alias in this context means a URI which will be redirected to another URI
Resources:
- Sinatra: README [sinatrarb.com] Read more: |
|
Friday, 26 March 2010 11:28 |
|
Mandriva 2010.0 Samba Standalone Server With tdbsam Backend
This tutorial explains the installation of a Samba fileserver on
Mandriva 2010.0 and how to configure it to share files over the SMB
protocol as well as how to add users. Samba is configured as a
standalone server, not as a domain controller. In the resulting setup,
every user has his own home directory accessible via the SMB protocol
and all users have a shared directory with read-/write access. Read more: |
|
|
|
|
|
|
|