Click to search Andy Jarrett.co.uk RSS feed

Loading Twitter

Copy/moving files from mulitple sub-directories to the parent

Since moving to Mac I use the terminal more and more. Today I had an issue of having wanting to move 1000 files in 50+ sub folders to the parent. A quick Google search didn't come up with anything so I figured it couldn't be too hard.

My directories went like this

/parent /parent/subfolder1/file.1 /parent/subfolder1/file.2 /parent/subfolder1/file.3 /parent/subfolder2/file.1 /parent/subfolder2/file.2 and so on .... in reality each subfolder had 20 files in it.

So to copy the files out was easy: [sourcecode language="plain"]cp -r ./* ../[/sourcecode]

Swap the cp for mv to move them

Comments Comments (1) | Print Print | Send Send | 320 Views

Max your CPU

I was at the Apple store yesterday with the need to run both my CPU's at max for some tests. The "Genius" put the following in two separate Terminal windows
Yes > /dev/null

The YES commandsimply sends an endless stream of y’s to standard output until killed. The reason the guy did it twice is to ensure that both CPU's are being used. This should work on any *nix machine but if you only have 1 CPU you only need to do it once

If are even to lazy to open two windows you can just put the following in one:
Yes > /dev/null & Yes > /dev/null

Comments Comments (1) | Print Print | Send Send | 279 Views

My blog has moved

Please update your bookmarks and feeds for my site.

I now have a Mango Blog at:

http://www.andyjarrett.com/blog

Feed URL: http://feeds.feedburner.com/andyjarrett

Comments Comments (0) | Print Print | Send Send | 1261 Views

Slicehost VPS

As you can probably tell from the recent posts I have moved my host over to a linux VPS, at Slicehost.com. Without sounding to tacky it was built by developers, for developers. No overly complicated control panels it just works. On top of that they have some excellent documentation on there site for helping you setup your box with only the basic Linux knowledge.

From the site:

Sick of oversold, underperforming, ancient hosting companies. We took matters into our own hands. We built a hosting company for people who know their stuff. Give us a box, give us bandwidth, give us performance and we get to work. Fast machines, RAID-10 drives, Tier-1 bandwidth and root access. Managed with a customized Xen VPS backend to ensure that your resources are protected and guarante

Check out their questions and community sections. Even if you're not setting up a VPS just yet their articles cover setting up a linux server so well, including SSH users, iptables etc.

If you do sign up with Slicehost.com, please feel free to use my referal link https://manage.slicehost.com/customers/new?referrer=5326d19c676e950dfab1fc8aaa724b6c :)

Comments Comments (2) | Print Print | Send Send | 2421 Views

Checking propagating of domain name

When you move servers one of the annoying parts can be waiting for the domain to propagate when you change name servers. There is a terminal tool though for checking the settings, dig(domain information groper) is a tool for interrogating DNS name servers.

You'll need to install the dnsutils package

view plain print about
1$ sudo apt-get install dnsutils

After that It's pretty easy, simply put in the terminal:

view plain print about
1$ dig google.com

Obviously swap google for your domain name that your are checking.

Read more here

Comments Comments (1) | Print Print | Send Send | 1218 Views

Another Linux Railo MySQL install guide (no Apache)

This was meant to be a guide about setting up your server with Linux, Railo, Apache, and MySQL but I've dropped Apache. Why? Well its an overhead I don't need. Resin functions perfectly well as a HTTP server and it does all I need. Why add another bit of software to fail? .... simplify :) In the long run I might change but for now I'd rather save the resources.

So ... where did this guide come from considering there are quite a few guides for this setup? Well for one reason or another I just didn't get on with them and by the end something went wrong which was mainly because I am Mac boy more than a Linux guy and sometimes I just missed the points here and there. The aim of my guide is to be clear and simple. So with a fresh Ubuntu install i'm planning on gettingt Railo running via Resin so I can call http://www.mysite.com/index.cfm

I won't lie, to make this post I have "borrowed" from other sources out there which I will try and link to at the end.

Im running Ubuntu 8.10 (Intrepid) without a graphical interface.

Note: If you are doing this on a clean, new server then before you even read on check out Slicehost.com documentation about setting up a Ubuntu server. These guides are the best and clearest I've seen online to date and cover everything you need!!!!

  1. http://articles.slicehost.com/2008/11/28/ubuntu-intrepid-setup-page-1
  2. http://articles.slicehost.com/2008/11/28/ubuntu-intrepid-setup-page-2

On to Railo

[More]

Comments Comments (3) | Print Print | Send Send | 2777 Views

Finding out memory usage on Linux

Since having my own server I'm becoming a little OCD on memory usage.

There are two tools I have been using which are

  1. Top:
    view plain print about
    1$ top
    Once its loaded press shift-m to sort by memory. You can read more here
  2. Free
    view plain print about
    1$ Free -m
    This is a high level view of whats being used and whats free. You can read more about this here. Don't worry about the first line of output here its always close as Linux automatically uses all the RAM you've got for caching etc. The second line is usage without counting the OS-internal buffers and cache and is the "real" RAM utilization. * (Thanks to Barney Boisvert for his help on better understanding these :))

Comments Comments (1) | Print Print | Send Send | 1235 Views

Getting remote access to MySQL

After setting up my server yesterday I had issue with getting remote access to MySQL it was like it wasn't even running. After some digging around and annoying a linux user (always make sure you know a *nix admin guy, and buy him a scotch or two to say thanks) I found out is was running and it just wasn't bound to the machine's IP address but instead to localhost. For security reasons remote access disabled, but sometimes you need it for one reason or another.

  1. Login via SSH
  2. Edit the my.cnf. On Ubuntu you can do this
    view plain print about
    1$ sudo nano /etc/my.cnf
  3. Once file open look for bind-address=127.0.0.1 and change it for your host machine IP address. So if you host machine is 10.0.1.1 your configuration file would look like:
    view plain print about
    1# Instead of skip-networking the default is now to listen only on
    2# localhost which is more compatible and is not less secure.
    3bind-address = 10.0.1.1
  4. Save, close and restart your mysql service to take change in effect
    view plain print about
    1$ /etc/init.d/mysql restart

Comments Comments (4) | Print Print | Send Send | 1646 Views

How to unzip on Ubuntu

More for my reference but extracting Zip files in Ubuntu from the command line is pretty straight forward

view plain print about
1$ sudo apt-get install unzip

This should install the unzip utility for you. Then to unzip it's pretty straight forward

view plain print about
1$ unzip {file}
Where {file} is your .zip archive.

Comments Comments (0) | Print Print | Send Send | 9522 Views

Setting up Apache and Subversion on JeOS (Ubuntu)

I'll be honest, I don't have much linux experience. I've always liked the idea of Linux and a command line driven OS but as soon as I see the GUI I tend point and click, which means I don't learn anything new. Then comes along JeOS (Just enough OS, pronounced as "juice") from Ubuntu which doesn't give you a GUI, it just gives you the bare minimum to run a server. It's designed for VM's and perfect for running a Subversion server on your local machine in the background. The specs are:

  • Less than 100Mb ISO image
  • Less than 300Mb installed footprint
  • Specialised -virtual Kernel 2.6.24
  • Optimised for VMWare ESX, VMWare Server and KVM
  • Intel or AMD x86 architecture
  • Minimum memory 128M
  • No graphical environment preloaded as it is aimed at server virtual appliance

So with JeOS and VMWare Fusion armed I was ready to setup a light-weight Subversion and Apache server. Below documents what I did to get a single SVN repository up and running. Im not installing Trac or SSL with this just so you know. I might try and cover them later, along with multiple repositories.

Setting up JeOS with VMWare fusion is no different than setting up any other VM so I won't go over that here. I'll assume that you can do that, and have done that and now at the command prompt.

Obviously because there is no GUI supplied all commands have to be run from the Command Line/Terminal. This also means editing txt files from the terminal too. If you've never used VIMM you might want to have the following URL handy www.gnulamp.com/vi.html

First things first, lets make sure your install is up-to-date.

view plain print about
1$ sudo apt-get update

[More]

Comments Comments (4) | Print Print | Send Send | 4840 Views

Hanso exposed

With Lost season 3 four weeks away I've stumbled across an orientation file from Alvar Hanso on YouTube that only got added a couple of days ago. It explains a little bit more about the numbers and there significance in the whole project. It also ends with someone spying (think Blair Witch) in on what seems to be the scientists initiations to the project. I don't want to put a spoiler here but one of the scientist sitting down raises an interesting question!!

YouTube has got quite a big section on Hanso if you've got some free time.

Comments Comments (0) | Print Print | Send Send | 2566 Views

FeedMine, A Web Developer Aggregator

I've just came across Feedmine via my referers which seems to be a aggregator for Web developers and it cover topics like CF , PHP, Linux etc. I don't know anything else about the site as it seems to be lacking in any information as you'll see.

Comments Comments (0) | Print Print | Send Send | 1558 Views

Linspire for free

Taken from the Lindows site as a special promotion to celebrate and make aware the new name:

For the next few days, we have a special offer where you can receive a copy of Linspire, hot-off-the-presses for free. That's right zero dollars. But there's a catch - actually two. First, you must use a special coupon code. Simply click on $49.95 Linspire 4.5 OS from the order page. Then click on the 'Apply Coupon' button and enter the coupon code. Second, the download will only be available from our BitTorrent P2P system so our servers don't melt. Don't worry if you've never tried BitTorrent. It runs on Microsoft Windows, Macintosh and Linux computers and is easy to get started. We'll give you step by step instructions. And no, it's not an oversight that I haven't provided the actual coupon code. You'll have to guess what the one-word code is.

Comments Comments (0) | Print Print | Send Send | 1493 Views

Lindows name change to Linspire

Well it looks like Microsoft have finally won. Lindows will now be Linspire.

In Michaels Minutes it explains why the change and how they came to the new name. He also covers some details about the legal fights in 6 countries!! (WOW if ever there was a display of a monopoly abusing its size it's there.)

Comments Comments (0) | Print Print | Send Send | 1298 Views

Free copy of Lindows

Im still playing around with Linux at the moment and today I came across this. Basically it gives you a $59.99 discount of Lindows Developer Edition, which conincidently costs $59.9.

Once you've prossed the order you can also download the Lindows Live (which is usually $19.95) CD, which is Lindows that just runs of CD, no install.

I dont usually post these kind of ads but it is "apparently" one day only, so anyone who likes Lindows or just wants to try out Linux give it shot.

Comments Comments (0) | Print Print | Send Send | 1469 Views

Redhat to drop Linux

Though a Window user i found this rather interesting that Red hat are stopping the freebies. I know there are lots of other distro's out there but what does this mean for the medium businees where some IT guy has just convinced the Boss to go all in with Red Hat to save money?
Well to read more check out
www.newsforge.com/software/03/11/03/1657205.shtml

Comments Comments (0) | Print Print | Send Send | 1393 Views

BlogCFC by Raymond Camden + Twitter @AndyJ + ColdFusion jobs + Contact Me + Snippets/Downloads + RSS .