Mplayer Playlist

March 31st, 2010 -- No Comments

Ok I know this type of post is not like me but I thought I would post it since I needed to research on how to do this. Well a lot of my developement is done in the Linux environment. All my music comes from CD’s or purchases from iTunes. In the Linux realm I have found that purchased music is not liked. So when I program in the Gentoo I mount my iTunes music folder. Since I am in command line most of the time I use Mplayer to listen to my music. So I needed to figure out how to tell Mplayer to play everything in my Music folder. I got tired or having to pick a new song all the time. So let me show you how I did this.

Ok the first thing you want to do is run the following command from my home directory to create the playlist:

jcostanzo@virtual-gentoo ~$ find /media/prl/iTunes\ Music/ > myMusic

Now the two things you would need to change is where the main folder of your music is and the other thing is what you want to name your playlist. Instead of myMusic you could say JohnsPlaylist. Now that you got the playlist to run it you would run this command

jcostanzo@virtual-gentoo ~$ mplayer -playlist ~/myMusic

If you want to shuffle the playlist you would do

jcostanzo@virtual-gentoo ~$ mplayer -playlist ~/myMusic -shuffle

Well I hope this might have help some other people who maybe had the same struggles I did.

Categories: General, Linux / BSD

Hosts File

March 25th, 2010 -- No Comments

As a web developer one of the tools that I love to use is built right into the operating system. I have come across some jobs where the coder has coded everything in absolute paths. Let me show you an example of an absolute path and a relative path.

….

Absolute Path
<a href="http://www.jcwebconcepts.com/index.php">Home</a>
 
Relative Path
<a href="index.php">Home</a>

As you can see there is a little difference. So now you may ask why is this an issue. Well if you are like me and like to test stuff on a local server first, then you will run into some issues. If your page calls an file it will call it from the remote server and not the local one. There are other examples but I will spare you of them. Lets get to this hosts file.

The hosts file exists in modern day operating systems. You can find it in Linux, Mac, Unix, and or Windows. Let me show you where these files exist.

Linux (Most distros)/Unix
/etc/hosts
 
Mac
/etc/hosts
 
Windows
C:\Windows\system32\drivers\etc\hosts

Here is an example of what a host file looks like

Linux Host File

So now let me show you some magic. So now on your testing box I would add a new entry. It can be added anywhere you want. So add this line

127.0.0.1     http://www.jcwebconcepts.net
127.0.0.1     http://jcwebconcepts.net
127.0.0.1     www.jcwebconcepts.net
127.0.0.1     jcwebconcepts.net

Of course you could substitute with any domain. So now when you test your files/scripts and the point to the absolute path you will pointing to your local box. Of course when you are done I like to comment that out. Just in case I forget that I have that and I want to look at the remote site. Now if you want to see the test environment on another computer the line you add to the host file will be different. First get your IP of the test box. Mine is 192.168.2.120

192.168.2.120     http://www.jcwebconcepts.net
192.168.2.120     http://jcwebconcepts.net
192.168.2.120     www.jcwebconcepts.net
192.168.2.120     jcwebconcepts.net

So you can start to see the things you can do with the hosts file that can help you. Instead of recoding all those absolute paths to relative you can edit the hosts file and test it that way.

Here is a video that explains some of this

CentOS (My Thoughts)

March 17th, 2010 -- No Comments

When I first learned Linux about 12 years ago I started off using Red Hat. You guys who have used it long enough remember the day when you wanted to install an app you had to not only download the application but 5 or 6 dependencies. In todays world that has changed. Things have been made so much easier. Thru the years I have used different distributions from Red Hat, SuSE, Fedora, Ubuntu, and CentOS. If you have used the Fedora and Red Hat land distro’s then you are not going to have much of a problem.

To do a net install it is not as easy like the other distro’s but if you have seen one version of Linux you have seen them all. The big thing about CentOS that I really like is that apps are tested fast and properly. Updates seem to be coming before some of the other versions of Linux. For now I use CentOS to try to stay on top of it to keep my knowledge up on some of these distributions. So go try and download a copy and throw it in a Virtual environment. See what you think and post a comment if you have a different opinion or question(s).

Categories: General, Linux / BSD, Servers

Site Re-design

March 8th, 2010 -- 1 Comment

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

NAS Server. Should I or Should I Not

March 2nd, 2010 -- 1 Comment

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.