For the next few weeks I will be working on a new Wordpress theme. I will post when it is complete so please do not judge my themes till I get it at 100% I was thinking that I might setup a test environment to test on since Wordpress really does not have a tool to check your theme before you make it live.
I guess if anyone has an opinion on how to test a theme before making it live then post a comment or hit me up on twitter @jrock2004
For the people who do not know what NAS stands for, it stands for Network-attached Storage. Do you have an old computer that is just sitting there collecting dust? I for one when I bought my iMac and MacBook my Dell became a dust collector. So one day I decided I needed to set something up to backup my files. I know I could have burnt stuff to DVD or buy an external hard drive to store them on.
Now for the Mac I could use a portable HD to setup Time Machine. Now my concern with Time Machine is that as far as I know you can only use it for one computer. Now I have not researched it so I could be wrong. With the external if you do run multiple operating systems like Linux or Windows then you have to worry about how you format your HD. Also if you buy a portable that needs a power source then I need to fiddle behind my desk to plug in the power adapter for the HD. What a mess I’ll tell ya.
Now if you have the luxury of having a dual layer burner you could burn all your backup data. Now I will tell you that data that does not change I still put to DVD but why waste it all for stuff that changes. You then need to setup databases or spreadsheets on what stuff is on what DVD or CD. I do not know about you but I would not want to worry about all that stuff.
So this brings me to setting up a NAS server. All you need is a computer with a decent size hard drive and if you want to hide it a wireless card. The other option here is buying a time capsule cause that is basically a NAS server. So if you decide the old computer you then have 2 choices for the OS that I would use. One is FreeNAS which is based off FreeBSD and the other would be Ubuntu. I basically chose Ubuntu cause I can run other things off it like a web server and set it up as a puppet master for some of my virtual machines.
So what are you going to choose? Do you have any opinions on what you think about storage backups? Post a comment and let us know what you believe the is the best backup solution.
One of the things that people talk about in the computer world is password strength. They talk about how you should not use the same passwords for everything. They say you should not use your kids names, date of birth, social security number, etc… Some people I know make 2 passwords. They make a real tuff one for important sites like banking and credit cards. They use the other one for sites they do not care about like forums.
I came across this nice piece of software called 1Password. What this software does is it makes an encrypted database to store all your passwords. It then will integrate itself into Safari and Firefox. When you install the software you make a master password. This password is something that you want to make pretty difficult so nobody can guess it. Now I will not go into more detailed since there are already a bunch of videos and stuff about this. Below is a video from the company that developed the software. Watch it and I think you might like the software as well.
Since posting my tutorial on running a web server on Ubuntu 9.10, I have had some questions on some of the next steps. So in this tutorial I want to discuss what you want to do to get your web server on the internet. I want to discuss on how to set it that a standard user can edit files in the web directory.
Are you running a Linux or Unix server that there are process you need to automate? Is there a daily process that are just a waist of your time but not to your server? There is a nice application called Expect that can help you with this. This application can handle several protocols. Some are ssh, telnet, ftp, passwd, fsck, rlogin, tip, etc… This application does not need a server it is just a client. The client is installed where your script will run from. The nice thing about expect is the file can be executed on a webpage as well. So let me show you an example script:
#!/usr/bin/expect###Usage: call the file with a username.
spawn ssh-i/var/employee/includes/id_rsa root@10.10.1.12
expect "The authenticity of host '10.10.1.12 (10.10.1.12)' can't be established.
RSA key fingerprint is 47:4a:6a:ce:65:99:e2:93:2b:7t:a9:48:19:64:f6:28.
Are you sure you want to continue connecting (yes/no)?"
send "Yes\r"
expect "root@10.10.1.12's password:"
send "iamthegreatone\r"
expect "#"
send "cd /home\r"
expect "#"
send "rm -Rf $argv\r"
expect "#"
send "cp -a default/ $argv\r"
expect "#"
send "chown -R $argv:513 $argv\r"
expect "#"
send "exit\r"
expect eof
This script is executed by running the following:
root@john-server:~# expect thefilename.exp john
This is a script I use at work to reset my users profiles when they mess them up. As you can see then when you run the file you must pass an argument. So in this case you ssh into the server that has the user directories pass the name of the directory. So this script will remove the current users directory and cp the default profile directory to theirs. It will then set the right permissions for the user. Note: The group 513 may be different from server to server.
Now you do not need to use ssh or anything like that. So if you want to have the script live in the same box you can remove the SSH information. Hope this helps and give it a try it is a nice tool.
If you have been reading previous blog posts, I have been using a monitoring tool called Zenoss. Under the hood there is a lot of Python stuff. So I decided to start learning Python. Python can run on Mac, Linux, Unix, and Windows. Let me show you some basic on what you can do in python.
#!/usr/bin/python
firstName = "John"
lastName = "Costanzo"# Lets just print out one variableprint firstName
# Now lets complete my nameprint firstName, lastName
# Lets just print something random without a variableprint"The sun is warm. The grass is green"# Now I will print some variables followed by some textprint firstName, lastName, "Is the owner of this blog."
For more information on Python you can visit this site.
One of the things I have never been strong in is layout design. If you look at most of the sites I have done, there blah. Colors are limited and there is just no iCandy to the site. So my question is, is this fixable? Is there something out there that I can learn to help me develop more iCandy websites? If so could you please share?
When I first started working with Linux one of the tools I disregarded was VIM. I felt it to be too confusing and believed it was not worth it at all. I was so use too notepad, nano, pico, etc… Then a programmer finally convinced me one day to make a switch. I am so glad I did.
So the first thing you have to get use to is that there are two modes to be in. One is command mode and the other is in insert mode. When in command mode you can save or do other things like find and replace. In insert mode you do like you normally do. You type away. I know it sounds confusing now but wait and I will show you what I mean.
VIM can be found in Mac, Linux, Unix, and or Windows. To start a file you bring up your terminal or if in Windows you open the application in your start menu. In the terminal you will type
vim whateverfilename
In the Windows work you go to file -> new I believe. Sorry not much in the Windows side of things.
Command Mode
Ok so lets get into some of the things you can do in command mode. So lets say you have to edit a document for work and you have to change the word Bob with the word John. hit ESC to make sure you are in command mode and hit the following:
:% s/Bob/John/g
The g at the end will make sure it goes thru the whole document. To search for some text is not that hard to do. So lets say we want to find all instance of the word happy. You will do the following:
/happy
When you find the first result you can hit n on your keyboard to go to the next instance that it finds the work happy. If there is none it will tell you that there is none. Now I am sure you are asking how do I search for multiple words? Well let me show you how to search for Happy Birthday
/Happy Birthday
As you can see you I did the same thing as above. VIM knew that you were looking for multiple words. Before you ask if there is a term in the document called Birthday of Happy, it will not bring that up as a result. The next thing I want to show you is if you need to get to line 10000 in a file all you have to do is the following:
:10000
Yep that is it. To wrap up this first tutorial on VIM I will show you how to quit without saving, saving but not exiting, and saving and exit. Here they are in order.
:q!
The q stands for quit. If you forget the ! you would be prompted about saving before quiting
:w
The w tells VIM that you want to save the changes
:wq
As you see we combined the w and the q to save the changes then quit. Now before you ask, if you would do :qw that would fail. Cause vim reads the commands from left to right. Well I think that is enough for now. If you have any questions about vim please post a comment.
Below is a video on what I basically explained above.
One of the things I never understood after installing Zenoss, was where is this mysql database. I found out that with Zenoss it sets up it’s own MySQL server and it is even smart to put it on a different port.
So lets say you want to access this database and see what it looks like. This can be done by doing the following:
SSH into the server that zenoss is on and
su zenoss
mysql -u zenoss -p
Just enter the password for your zenoss database and then you can have access to the MySQL server. Hope this helps out someone.