Add Samba Users

Pretty simple. First have to make sure that you have a system user with the same user name added first:
Good article for that: http://www.ahinc.com/linux101/users.htm

Then, in Red Hat type distros you’ll need the smbpasswd file which contains the samba user names and passwords.

To add a new samba user:
smbpasswd -a [username]

To delete a samba user:
smbpasswd -x [username]

Secure Copy (scp)

scp stands for secure cp (copy). which means that you can copy files across an ssh connection that will be encrypted. and therefore secured.

You can this way copy files from or to a remote server. you can even copy files from one remote server to another remote server. without passing through your PC.

Usage: scp [[user@]from-host:]source-file [[user@]to-host:][destination-file]

EXAMPLE:
scp /var/www/html/somedirectory/somezipfile.zip root@ip_address:/var/www/html/someotherdirectory
scp root@myserver:/var/www/html/somezipfile.zip root@ip_address:/var/www/html/someotherdirectory

Description of options

from-host
Is the name or IP of the host where the source file is. this can be omitted if the from-host is the host where you are actually issuing the command

user
Is the user which have the right to access the file and directory that is supposed to be copied in the cas of the from-host and the user who has the rights to write in the to-host

source-file
Is the file or files that are going to be copied to the destination host. it can be a directory but in that case you need to specify the -r option to copy the contents of the directory

destination-file
Is the name that the copied file is going to take in the to-host. if none is given all copied files are going to maintain its names

Options

-p  Preserves the modification and access times. as well as the permissions of the source-file in the destination-file
-q  Do not display the progress bar
-r  Recursive. so it copies the contents of the source-file (directory in this case) recursively
-v  Displays debugging messages

Examples

scp *.txt user@remote.server.com:/home/user/

This will copy all files with .txt extension to the directory /home/user in the remote.server.com host

scp -r miguel@10.1.2.2:/home/duder/ duder@10.1.2.3:/home/duder/

This is going to recursively copy all files from miguel’s Home directory on 10.1.2.2 host to his Home directory in 10.1.2.3 host.

Note

To use this command you need to have open-ssh installed in the hosts

Formatting the Output of a Date – (eg. June 6. 2006)

Figured this one out when working on a client project. Needed to format the publishing date of newsflash articles that I was pulling from the database. Before I was writing a whole function to process the output but now I’ve got it down to a one liner. Here’s how I did it.

‘$row->publish_up’ when it first comes out of the db looks like this: ’2006-06-06 17:50:37′
which is standard output from the MySQL database.

Then I did this:

echo date("F jS. Y".strtotime($row->publish_up.1));

Which outputs: ‘May 5. 2009′

Funny Little Story About a Scrum “Implementation”

Featured

Funny little story about an “abstract” (if you will), implementation of Scrum that I told to Ken Schwaber at his CSM class in Boston a few years back.

My wife and I, like a lot of parents of young children, were trying desperately one night to get our three year old daughter to eat all her dinner. We tried everything from cutting up her food into smaller and smaller bites to introducing various incentives like ice-cream and TV after dinner .. no matter what the tactic, we just couldn’t get her to eat and were met with all sorts of resistance. At one point, I even made myself more food so that I could eat it along with her. Nothing was working. It was starting to get later in the evening and we knew we couldn’t put her to bed without dinner and I needed to get prepared for the next day for our team’s morning Scrum.

I think maybe because this was on my mind, I decided as a last resort to try some very basic agile approaches to get our daughter to eat. Instead of telling her that she needed to eat her dinner or – insert various parenting text-book consequences here -, I decided to ask her “…how many bites would you like to have?”. Immediately, I had her attention and she responded without much hesitation … “zero”. Well, zero obviously wasn’t going to be acceptable so we negotiated a higher number and finally arrived at two I believe it was. Hey, two was better than zero and meant at least some progress. She agreed and actually began and finished her two bites and then looked to me for feedback on her recent accomplishment. I thought, “Great! Well, how many would you like to have now”. “Three”, she said, and so we proceeded along just like this until her whole plate was finished. My wife, couldn’t believe her eyes, nor anyone else that we demonstrated our strategy too. Scrum Master or Parent Coach? … I thought … hmmm.

Ken Schwaber made a great point to me after I told him this story. A very fundamental part of this success was the fact that my daughter actually felt she owned the task of eating her dinner which differentiated it from all the other day-to-day requests we make to our children. She really felt good about doing it.

Scrum works, even for three year olds.

Firstly, A Little About Myself

My name is Troy Davis and I am a Technical Evangelist. I am a technology professional in Calgary and during my career here, I have contributed to the success of a large number of web projects in the marketing and oil and gas arenas. On these accounts, I’ve lead innovative development strategies and ensured seamless integration of forward-thinking technologies. I have managed to attract some attention here in town; just two years ago I made an appearance and speech at a national web technology seminar.

I am an alumnus of the Southern Alberta Institute of Technology (SAIT) in Calgary, Alberta with a major in Information Systems Technology and a background in application and web software development. I’ve worked as a wireless java application developer, project manager, systems / business analyst and web application developer at several top technology firms in and around Calgary.

Now enough about me. This is my first blog post on davisplanet.net. Stay tuned for much more interesting posts soon …