Linux
How Freelancing Works
A good friend of mine asked for a quick run-down of how freelancing sites like vWorker.com work. Freelancing is a great way to earn extra money on the side. When work dries up, I go to vWorker.com and bid on projects and make some quick money. It's not going to make you rich but it'll keep you alive or give you some extra spending money :) And if you enjoy your work, like I do, then it's fun. So here it is, short & sweet:
- A person with a project posts it and requests bids
- Then you as a worker bid on the work saying u can do it for $xx.xx and how long it will take, etc
- Then they pick out of the pool of bidders
- If you win a bid request, 15% of your bid goes to vworker.com for facilitating the process
- The rest goes to you
- Money is paid into vworker (escrow / safe-keeping)
- And u get it once you're done
- Then person rates you
- Once you get some good ratings, you can charge more and win more and also start getting invited to bid on more projects
- Unfortunately, i don't know a way around being cheap at first
- And u can bid on 100 and get none, or get all 100
- In many cases, it's purely about price
- So bidding lowish but bidding on many projects seems the best strategy, at least to start out with
- Be warned, it can take a lot of time to bid on them all and then you wait
Let me know what Qs you have in the comments :)
Passwordless SSH
This one's for the geeks...
I have a server inside my LAN that I ssh to a LOT. Not having to type in my password would save me quite a bit of time. There are a lot of tutorials out there but I think this one cuts straight through to the point :D
On The Server
On Your Computer
That's it! SSHing into your server, from the computer you set this up from, will no longer require that you type in your password. Instead, it will use your public key to decrypt messages sent from your computer, using your private key.
For more information on how this public/private key system works, see Wikipedia: http://en.wikipedia.org/wiki/Public_key
I have a server inside my LAN that I ssh to a LOT. Not having to type in my password would save me quite a bit of time. There are a lot of tutorials out there but I think this one cuts straight through to the point :D
On The Server
- Make sure "RSAAuthentication" and PubKeyAuthentication" are both set to "yes" in your ssh config file. (/etc/ssh/sshd_config)
- If they weren't, and you changed them, restart ssh. (/etc/init.d/ssh restart)
- Change to your home directory. (cd ~)
- Check that the '.ssh' directory exists. (ls -dl .ssh)
- Confirm it has the correct permissions. (chmod 700 .ssh)
On Your Computer
- Change to your home directory. (cd ~)
- Check that the '.ssh' directory and your public (id_rsa.pub) and private (id_rsa) keys exist. (ls -l .ssh/)
- If they don't, create them. (ssh-keygen -t rsa) Press enter in response to each question.
- Now copy them to your server. (ssh-copy-id -i .ssh/id_rsa.pub user@server:) You'll need to type in your SSH password this one last time.
That's it! SSHing into your server, from the computer you set this up from, will no longer require that you type in your password. Instead, it will use your public key to decrypt messages sent from your computer, using your private key.
For more information on how this public/private key system works, see Wikipedia: http://en.wikipedia.org/wiki/Public_key
apticron - Keep Debian Servers Up-To-Date
Debian is, in my opinion, the best distribution for a server you have to maintain yourself. That's because it takes care of a lot of stuff for you and apt-get is soooo easy to use.
Of course, you have to keep your server updated or, sooner or later, someone will hack it to itty bitty pieces. And running updates automatically is dangerous as someone can mess with the DNS server you use and get you to download trojanned software nice and automatically - wonderful!
So instead of updating everything automatically, install apticron and it will automatically check what updates are available and it'll email you daily to let you know if something needs updating.
Then you can log in to your server, check that everything's OK and, if it is, do the update. It's magical :)
Of course, you have to keep your server updated or, sooner or later, someone will hack it to itty bitty pieces. And running updates automatically is dangerous as someone can mess with the DNS server you use and get you to download trojanned software nice and automatically - wonderful!
So instead of updating everything automatically, install apticron and it will automatically check what updates are available and it'll email you daily to let you know if something needs updating.
Then you can log in to your server, check that everything's OK and, if it is, do the update. It's magical :)
Linux: Automatically Updating a Remote Site
NB: Don't let the cute kitty fool you! This is an advanced tutorial. Don't bother reading it if you're not familiar with Linux / web development.
So, I'm a webdeveloper, right? And I often find myself in a position where I've worked on an existing site and need to upload my changes to that site, right? And, being a coder-type-person, I want to do it the easiest way possible right?
Well, I've got just the solution if you're like me. First off, set up passwordless ssh into the remote server.
Next, use this command to automatically copy everything across...
find . -mtime -30 -exec scp -r '{}' user@example.com:www/ ';'
Let's break this up...
NB! NB! Before screwing up a live server, test this out on some mickey-mouse account of yours that it's OK to mess up a little. ANY time you automate something, you face the risk of screwing EVERYTHING up en-masse. Been there, done that, didn't have too much fun! Backups are a good thing. Use them!
<!-- technorati tags begin -->
So, I'm a webdeveloper, right? And I often find myself in a position where I've worked on an existing site and need to upload my changes to that site, right? And, being a coder-type-person, I want to do it the easiest way possible right?Well, I've got just the solution if you're like me. First off, set up passwordless ssh into the remote server.
Next, use this command to automatically copy everything across...
find . -mtime -30 -exec scp -r '{}' user@example.com:www/ ';'
Let's break this up...
find
That's it! Provided you have everything set up right with your passwordless ssh, this will be a pretty damn easy way to update any site you work on. Of course, you can tweak the find command to your heart's content. It's really one of the most powerful commands you have in your arsenal. Use it wisely.This is a great command that allows you to find almost any file anywhere on your server.
find .Here, we're telling find to only find files from the current directory ('.') and below.
-mtime -30The -mtime switch basically lets us find files that have been modified within a specified amount of time. The -30 says we're looking for files that have been modified in under 30 days since now. To find files that were modified OVER 30 days ago, you'd just type: -mtime 30
-execThis switch tells find to execute the command that follows with EVERY file it finds. Yup, this is where it starts getting juicy (for us geeks, that is ;))
scp
This is the command used to transfer files over an SSH connection. It's much more secure than FTP because your login credentials (and the whole session!) is encrypted before being sent to the other server. With FTP, anyone on either computer (or, in some cases, on either network!!) can simply grab your details and use them to log in as well!
-r
This stands for 'recursive' and it will create directories for you. So if your command above finds a file inside a directory, it will first create that directory on the remote server (if it doesn't yet exist) before copying the file across.
'{}'
This is a placeholder for the results that the find command returns. In other words, it will be replace with each filename that you want copied across. Pretty important!
user
Replace this with your username on the remote server.
example.com
This should be replaced with the hostname of the remote server.
www/
And this is the remote directory you want all the files copied into. This is usually 'www/' or 'public_html/'
';'
And this is just how you tell the find command that this is the end of the command that the -exec switch should execute.
NB! NB! Before screwing up a live server, test this out on some mickey-mouse account of yours that it's OK to mess up a little. ANY time you automate something, you face the risk of screwing EVERYTHING up en-masse. Been there, done that, didn't have too much fun! Backups are a good thing. Use them!
<!-- technorati tags begin -->
Tags: linux, ssh, scp, automated file copying
<!-- technorati tags end -->
Subscribe to Blog Posts