Nevyn's Blog

Wednesday, 4 November 2009

the best administrators are lazy...

"...the best administrators are lazy because they don't like to work. They find the fastest way to do a task and finish it quickly so they can continue in their lazy pursuits."

quote comes from this highly recommended read for novice - intermediate linux / UNIX users

Lazy Linux: 10 essential tricks for admins

How to be a more productive Linux systems administrator
http://www.ibm.com/developerworks/linux/library/l-10sysadtips/

# Trick 1: Unmounting the unresponsive DVD drive
# Trick 2: Getting your screen back when it's hosed
# Trick 3: Collaboration with screen
# Trick 4: Getting back the root password
# Trick 5: SSH back door
# Trick 6: Remote VNC session through an SSH tunnel
# Trick 7: Checking your bandwidth
# Trick 8: Command-line scripting and utilities
# Trick 9: Spying on the console
# Trick 10: Random system information collection


This one goes on for more intermediate - advanced usersUNIX tips: Learn 10 good UNIX usage habits
Break bad UNIX usage patterns
http://www.ibm.com/developerworks/aix/library/au-badunixhabits.html

1. Make directory trees in a single swipe.
2. Change the path; do not move the archive.
3. Combine your commands with control operators.
4. Quote variables with caution.
5. Use escape sequences to manage long input.
6. Group your commands together in a list.
7. Use xargs outside of find .
8. Know when grep should do the counting -- and when it should step aside.
9. Match certain fields in output, not just lines.
10. Stop piping cats.

Of course, the truly advanced user would read the bash man pages and the advanced bash scripting guide

The tips should apply to almost any linux or UNIX distribution, from AIX to Ubuntu! (or BeOS, or BSD, Debian, Gentoo, IRIX, OpenSolaris / Solaris etc for that matter .I sense some experimenting coming over the holiday period, yay) Now, just because I was too lazy to write my own content tonight, doesn't mean this post isn't useful ;-)

In fact, it's an example of being highly efficient, because I now know exactly where I can find these super tips when I need them, instead of wasting time finding the exact google search terms to use - and so can you, the reader, if you press CTRL+D to bookmark, or add my feed! (hint)

So now, instead, I can get on with my other hardware projects, bash shell scripting, UNIX admin, php/mysql web developments or just studying programming algorithms in general, and post about them as I stay indoors over the coming winter months, full of long dark nights (yay!)

Until then, try practising one of my other mantras - "you should never have to solve the same problem twice". Learn it; then adapt it.

=)

Labels: , , , , , ,

Sunday, 10 May 2009

BOOTP server

Setting up a BOOTP / TFTP server sounds tricky, but in reality it is marvellously simple. I used it to install IRIX over the network,on my SGI's.

In this example I shared IRIX 5.3 from my Origin 200 running IRIX 6.5.xx to my Indigo R3000. If you are struggling with SCSI bus reset errors from that old cdrom drive, this is a much simpler route to take.

on the server:

  • /etc/hosts - not required initially, but lets you address the client by hostname from the server.

  • /etc/ethers - specify the mac address of the client(s)
    08:00:69:c0:ff:ee       iris

  • /etc/bootptab - this specifies the hostname, IP, (mac?) and the directory to boot.
    iris    1  08:00:69:c0:ff:ee  192.168.1.118  /cds/irix53/stand/sash.IP12

  • /etc/inetd.conf - here you enable the bootp and tftpd services. It is advised that you use the -s switch to specify which directory(ies) the user can see, otherwise they will have access to all world readable ones (not so bad on a closed network, still better to specify though).
    bootp dgram   udp   wait  root    /usr/etc/bootp  bootp
    tftp dgram udp wait guest /usr/etc/tftpd tftpd -s /cds/irix53


  • finish with this command: /etc/killall -HUP inetd



on the client

enter the command monitor by selecting option 5, and a quick hinv -v to double check all the hardware is recognised may avoid confusion later on.

setenv netaddr 192.168.1.118
setenv notape 1
boot -f bootp()192.168.1.9:/path/to/diskimage/stand/fx.IP12 --x

now repartition / format the drive as necessary (I had to do this a couple of times, it appeared to keep the old installation the first time, and the second time, the amount of freespace was well below the 2GB capacity, which left me with 2 failed installations, but was successful on the third attempt - hint: during the inst phase, I selected the admin commands and looked for the mkfs option. Even though the miniroot was copied to the drive, I wiped it clean - it recovered from the shock by offering to restart the interrupted distribution.

Right, now you've hopefully got a clean drive - restart and

setenv netaddr 192.168.1.118
setenv notape 1
boot -f bootp()192.168.111.9:/path/to/diskimage/stand/sash.IP12
install -n

for some reasoon, this didnt work too well for me, it kept looking for /dev/tape and I couldnt trick it by setenv tapedevice /path/to/diskimage =(

in this case, just select option 2, install the os.
are you using remote tape [y/n] : n
enter the hostname:directory - 192.168.1.119:/path/to/diskimage/dist

once you have the miniroot, and inst running, you should be able to select additional distributions by setting the 'from' to /path/to/disk2image/dist, as appropriate.

HINTS:
This assumes the server is IP 192.168.1.119, and the client is 192.168.1.118
It also assumes you have copied the IRIX 5.3 disc from /CDROM to /cds/irix53/ on the server.
BOOTP wont work across a router, but if you can NFS mount the files across the router, you could establish a nearby BOOTP server on the local segment.
In order to edit the files, especially on a text console, a quick 'man vi' should help
serial port settings are often 9600-8n1 no flow control, see 'man serial'

LINKS:


securing IRIX (more 6.5.xx specific, but still useful)
http://www.blacksheepnetworks.com/security/resources/IRIX_65.html
http://sgistuff.g-lenerz.de/tips/security.php
http://www.siliconbunny.com/irix-security/

Labels: , , , ,

Friday, 8 May 2009

Massive List of Rails Development Tips

I tried out Ruby on Rails the other day, installing it onto Ubuntu, and the ideas it gave me for improving my coding skills / toolset or just generally improving the way I think about approaching programming projects are amazing. Im glad I found these Ruby on Rails development tips, they break down my learning curve into manageable steps:
Massive List of Rails Development Tips

Note that I got it working by also installing a clean AMP - Apache, MySQL and PHP server, and using Ruby Gems to add RoR support. It is possible to run Ruby without the Apache, the built in WEBrick server runs on port :3000 but you can use both simultaneously.

The cheat sheet graphic comes from https://kaul.inf.fh-brs.de

Installing Ruby on Rails in Ubuntu

Create a blog using Ruby on Rails in 15 steps
(+5 more if you want AJAX)
this tutorial is pretty reasonable, but there are a few filename typos, and you will need to checkout the comments to fix the odd errata or two...

Total time to get it all working: 2h40 mins

Labels: , , , , ,

Thursday, 30 April 2009

BlueOnyx linux download torrent

The official BlueOnyx CD's are now available to download over bit torrent! Each ISO has its' own .torrent file - unless you actually require a specific release, you should just stick to downloading the latest one. Each of the ISOs are about 600MB.

BlueOnyx ISO latest .torrent

hint: you may need to "Save As" the .torrent file to your machine (a 25KB size) and load it into your client manually from your local copy



BlueOnyx-5.3-20090405.iso.torrent
BlueOnyx-5.2-20090318.iso.torrent
BlueOnyx-5.2-20090212.iso.torrent
BlueOnyx-5.2-20090107.iso.torrent
BlueOnyx-5.2-20090102.iso.torrent
BlueOnyx-5.2-20081224.iso.torrent



The files are initially being seeded from the UK, and download speeds may be restrictive at first - hopefully before long, it is anticipated that more seeders will join in, and the response times will improve drastically!


PLEASE be responsible - if your bit torrent client is firewalled, meaning you can only leech and not reseed, please consider just downloading the ISO instead, direct from http://blueonyx.it or a mirror!

Labels: , , , , , , ,

Monday, 27 April 2009

Switch to a Linux Terminal Server Project network environment

Get your old computers working as UNIX terminals! Setup a Linux Terminal Server with LTSP on Ubuntu, and use it from a remote workstation!

Im sick of losing machines, and having to reinstall from scratch, so if all goes well on this project, I will be able to run my blade server without even thinkiing about how to set each one up, beyond configuring each blade to boot from the Lan instead of the local hard drive, and instead concentrate on maintaining just the one central server.

Before you cry Single Point Of Failure - and it is, my comeback is that instead of having to make each server resilient, I only have to harden the one, saving time effort, and computer resources. Backups are essential, so I will have a remote machine rsync essential data on a CRON schedule. I will also improve the resilience of the server itself. This can be accomplished by having a couple of spare ethernet interfaces, a bit of software RAID (mirroring the partitions) and optionally a redundant hot/warm spare or even offline server knocking about will do for my purposes =)

To get an LTSP server running on an existing system running Ubuntu, Kubuntu, Xubuntu (which has an LTSP install option) or even Edubuntu, which sets up LTSP by default, you will need to set up a static Ethernet interface where you will attach the thin clients, install two packages and run a single command.


On the server (it can be a desktop, but for this scenario lets call it the server) configure your static / spare interface for the thin clients to have
the IP 192.168.1.1, then follow the instructions below.

sudo apt-get install ltsp-server-standalone openssh-server

Create your Thin Client environment on the server with.

sudo ltsp-build-client

After that, you will be able to boot your first thin client. Note that
if you want to use another IP than the above, you need to edit the
/etc/ltsp/dhcpd.conf

file to match the IP values and restart the dhcp server. If the IP changes (shame on you for not using IP aliases with IP/MAC address takeover tut tut) after you have done the initial setup, run
sudo ltsp-update-sshkeys

to make the ssh server aware of the change.

nb The ltsp-utils package from universe (for dapper) is for a different ltsp version, installing them together will break, so I gather. Maybe worth avoiding that, unless you have a test machine you can experiment on.

Labels: , , , ,

Microsoft surface

This Microsoft "Surface" video (around May 07) shows the coffee table desktop that they were pioneering, aimed primarily at hotels, catering and other hospitality segments.

Its more than simply a horizontal touch screen desktop, as it can recognise & communicate with the (mobile / data) devices placed on it. Words don't do it justice, so please watch the video.
http://www.popularmechanics.com/technology/industry/4217348.html

Yes, I know, a Microsoft oriented post here *gasp!*.

It only merits mention as an example of how interfaces are changing, that computers are evolving beyond the humble, uh... desktop.

With the motion sensors in the WiiMote, multi-touch and motion sensory devices from Apple, and new style desktops like KDE 4, im sure this is only the tip of a proverbial iceberg.

My prediction for the future is that if Asus ever launch the k-eee-yboard, that will be one gadget I can't resist.

Labels: , ,

Vyatta - open source router and firewall.

The Vyatta open-source router firewall - Welcome to the Dawn of Open-Source Networking!

http://www.vyatta.com

If your network is growing, and you need to improve your networking skills, so you can convince your boss to commit sums of money on an expensive hardware solution - e.g. Cisco gear - try installing Vyatta linux natively onto a spare old pc with some network cards in, or use a vmware image.

Then you can practice setting up your network, however you please, all day long! =)

Labels: , , ,