Resurrecting the tech blog!
It’s been over six years since my last technical blog post on “adamstechblog.com”. Time has really flown. Stay tuned for more!
Endless technology ramblings…
It’s been over six years since my last technical blog post on “adamstechblog.com”. Time has really flown. Stay tuned for more!
It looks like China has erected a new landmark structure that is composed of over 2,200 LED lights over 24,000 square feet. It uses photovoltaic technology to convert sunlight directly into electricity. The picture on the right is a photovoltaic tree in Sydney, Australia.
The structure was created by a New York based architect who says it functions like an organic system. The system takes all the power it can get during the day and stores it for displays at night.
As we continue to find Linux loaded on more and more consumer-based PC’s the reality of Linux everywhere has come to fruition. I’m relatively excited that Ubuntu is being endorsed by companies like Dell. As more and more PC’s ship with Linux pre-loaded it’s almost necessary to become acquainted with the Linux shell. For those of you from the Microsoft days I would almost consider the Linux shell to be the DOS of Windows 3.1/95/98 (WinXP just emulated the shell). In the blurb below I try to make correlations to Windows commands to help you grasp what each command does.
Anyway, here ten of the commands I think you should know when using Linux as a first-time user. Note that when typing these commands the # sign symbolizes the shell prompt and you shouldn’t type it 🙂
# man <command>
Example:
# man ls
Type "q" on the keyboard to exit.
# ls <directory,optional>
Example:
# ls /etc
Use the following basic commands to navigate vi:
a.) /<search string> (searches for a string)
b.) :w (writes the open file)
c.) :q! (quit without saving changes)
d.) :wq (write changes and quit)
e.) :q (quit vi)
Type "i" to enter editing mode. Hit escape after making your changes to enter the commands above.
# vi <file to edit>
Example:
# vi /etc/fstab
# find <path> -name <name of file>
Example:
# find / -name foo.txt
(This command finds "foo.txt" anywhere starting with the root "/" of the file system)
# cat <file to output>
Example:
# cat /etc/fstab
# <command> | less
Example:
# cat /etc/exim.conf | less
# grep "string" <file>
Example:
# grep "sda" /etc/fstab
Windows Command | Linux Equivalent |
del | rm |
copy | cp |
rename/move | mv |
To remove a file use this syntax:
# rm <file>
To remove a directory and its files contained:
# rm -rf <path to directory>
To copy a file simply use the following syntax:
# cp <source> <destination>
To rename or move a file use the following syntax:
# mv <source> <destination>
# ps aux
This command shows you a list of all processes, which user they are running as and the command (truncated).
There are many ways to use chmod but we’ll explain the simplest.
# chmod <modes> <file/directory>
If we were to create a shell script and we wanted to set it executable we would perform the following chmod:
# chmod +x script.sh
If we wanted to set the file read/write/execute we could use this command:
# chmod +rwx script.sh
Chown simply changes the owner and/or group of the file. The old way of changing the ownerships was like this:
# chown user.group <file/directory>
To the best of my knowledge this command works but it is a bit outdated. Now simply replace the "." with ":" so the command looks like this:
# chown user:group <file/directory>
I want to change /etc/fstab to be owned by user award and group foogroup. (Don’t do this really hehe!) I would use this command:
# chown award:foogroup /etc/fstab
There are quite a few commands available in the Linux world. It’s always a good idea to be comfortable with the command line. The command line becomes easier as you use it (I’ve been living in it for almost 10 years now). The power and flexibility the command line offers is unmatched by any GUI. As with everything I recommend that you learn something from the inside out. That being said, start out with the command prompt and play around. Load up a VM (Virtual Machine) with Ubuntu or CentOS and play around. Check out this article to see how to load VMware Server Beta and get started today.
Backups are most important when you really need them. Most hosting companies, business and personal users implement their backups with traditional RSYNC. Since RSYNC can be piped over SSH it serves as a very secure way to perform backups of critical files. Using Rsnapshot can provide even more flexibility with snapshot capabilities.
What if you have thousands of files? What about millions of files? RSYNC becomes very cumbersome as it has to walk every directory and every file to compare checksums, modified times and contents. RSYNC literally grinds to a halt as it attempts to tally file counts greater than 500,000 (at least on our system systems).
So what’s the solution? For many years we have been performing backups at the file level. Performing backups at the file level adds latency and can be very time consuming. The new technology is CDP (Continuous Data Protection). This technology, in fact, is not very new at all. Faster Internet connections enable us to perform backups at the sector-level over the wire. Sector-level backups are so much faster because only the changed sectors are transmitted.
R1Soft has pioneered this technology in the Linux market. Their kernel device driver (the heart of their backup agent) actually tracks block-level changes in real time. The next time the backup kicks off the agent knows exactly what blocks have changed. You might be thinking to yourself "That has to add overhead!" but, in reality, it uses no more than 10MB of physical RAM per 100GB the device driver monitors.
Image level backups are so fast we can back up our web servers in less than 5 minutes every 2 hours. These backups are less CPU and disk intensive than any file-level backup can offer.
To test drive image-level backups with R1Soft technology, visit WebHostBackups.com for more information.
As prices and energy usage goes up top server manufacturers are finding ways to make the datacenter use less energy. This is a great idea because most servers are not utilized even 50% of their total capacity. Virtualization technologies like VMware can allow for more virtual servers to run on less hardware – I consider this to be a "green" technology. What are server manufacturers like Dell, IBM and Sun doing to help the green effort? They’re coming out with a line of servers focuses specifically on saving energy.
The problem gets worse because the industry has focused around developing the fastest dual and quad-core processors consuming more and more energy. Server racks are now using five to ten times the power as racks four years ago. The sad part is a large amount of the energy goes to waste. I believe that if projects from corporations were planned better they would consume less energy and money.