About Syngin

Syngin's Blog:
Blog Index

Previous Blog Posts:

  • Linux: Create a Secure Copy Tunnel Between 2 systems with no password
  • Dr. Suess Meets the Information Age
  • Linux Server Backups: The Essential List of Items
  • If Architects had to work like Programmers
  • Artistic Blocs
  • Online Contract Work Web Sites
  • MySQL Canada Provinces Table (SQL)
  • Temperamental Hard Drives

    Blog Archives:
    June 2004
    August 2004
    October 2004
    February 2005
    March 2005
    September 2005

     

    Blog Powered by:
    Powered by Blogger

     

     
    Syngin's_Blog:  
     
    General musings of the PHP Poet, Syngin.


    Wednesday, September 14, 2005

    Linux: Create a Secure Copy Tunnel Between 2 systems with no password

    Let us assume that you are setting up a secure copy tunnel between 2 machines: local and remote. The first thing to do is ensure that ssh and openssl are installed. For our purpose, the local machine is the machine doing the copying to the remote host.
    Local machine setup:

    1. cd into the .ssh directory in your users home directory (ie. cd /home/syngin/.ssh)(If this directory does not exist yet, try ssh-ing into the remote host from the command line and it should be created for you)

    2. ssh-keygen -t rsa (This might ask some strange questions. Be sure to choose no passphrase. Two files will be created: id_rsa and id_rsa.pub)

    3. scp id_rsa.pub user@remote-host.com:.ssh/authorized_keys (This will copy your public key to the remote host)(You may be prompted for the remote users password)

    4. Test for success: ssh user@remote-host.com You should now be logged in without a password.

    Remember that this is valid for user to user only (I believe) so make sure you set up any automated copying in the specific user’s crontab or under that user in the main crontab.

    Friday, March 18, 2005

    Dr. Suess Meets the Information Age

    If a packet hits a pocket on a socket on a port,
    and the bus is interrupted at a very last resort,
    and the access of the memory makes your floppy disk abort,
    then the socket packet pocket has an error to report.

    If your cursor finds a menu item followed by a dash,
    and the double-clicking icon puts your window in the trash,
    and your data is corrupted cause the index doesn't hash,
    then your situation's hopeless and your system's gonna crash!

    If the label on the cable on the table at your house,
    says the network is connected to the button on your mouse,
    but your packets want to tunnel to another protocol,
    that's repeatedly rejected by the printer down the hall.

    And your screen is all distorted by the side effects of gauss,
    so your icons in the window are as wavy as a souse;
    then you may as well reboot and go out with a bang,
    'cuz sure as I'm a poet, the sucker's gonna hang.

    When the copy on your floppy's getting sloppy in the disk,
    and the macro code instructions is causing unnecessary risk,
    then you'll have to flash the memory and you'll want to RAM your ROM,
    and then quickly turn off the computer and be sure to tell your Mom!

    Thursday, February 24, 2005

    Linux Server Backups: The Essential List of Items

    I've dumped a Linux install more than once before I backed everything up so here is a master list of everything that needs backing up:

    1) Configuration files: This is especially important if your install has been running for a while as you may actually forget what it was that you did to tweak a particular program to get it running the way you wanted. This was particularly true of me with Samba after having a system up and running fine for almost 2 years. Other inportant config files to back up: Apache, MySQL, PHP.ini, BIND files, fstab, customized startup scripts, etc. Its pretty much a good idea to go right through /etc/ looking for things.

    2) ALL Databases: You should already be backing these up elsewhere but still a very handy thing to remember. It is also handy to make sure you know which database programs are installed on the system. I almost lost an entire line of PostgreSQL database this way a few years back. Phew!

    3) ALL Web Files: Sometimes its easier just to burn everything in /var/www to cd.

    4) HOME Directories: This should be something that you won't be likely to forget.

    I may add more to this list as time goes on.

    Sunday, October 31, 2004

    If Architects had to work like Programmers

    This is too true not to reprint:

    Dear Mr. Architect:

    Please design and build me a house. I am not quite sure of what I need so you should use your discretion.

    My house should have between two and forty-five bedrooms. Just make sure the plans are such that the bedrooms can be easily added and deleted. When bringing the blueprints to me, I will make the final decision of what I want. Also bring me the cost breakdown for each configuration so that I can arbitrarily pick one.

    Keep in mind that the house I ultimately chose must cost less than the one I am currently living in. Make sure, however, that you correct all the deficiencies that exist in my current house (the floor of my kitchen vibrates when I walk across it, and the walls don't nearly have enough insulation in them).

    As you design, also keep in mind that I want to keep yearly maintenance costs as low as possible. This should mean the incorporation of extra-cost features like aluminium, vinyl, or composite siding. (If you choose not to specify aluminium, be prepared to explain your decision in detail.)

    Please take care that modern design practices and the latest materials are used in the construction of the house, as I want it to be a showplace for the most up-to-date ideas and methods. Be alerted, however, that the kitchen should be designed to a accommodate, among other things, my 1952 Gibson refrigerator.

    To ensure that you are building the correct house for our entire family, make certain that you contact each of our children, and also our in-laws. My mother-in-law will have very strong feelings about how the house should be designed, since she visits us at least once a year. Make sure that you weigh all of these options carefully and come to the right decision. I, however, retain the right to overrule any choices that you make.

    Please don't bother me with small details right now. Your job is to develop the overall plans for the house: get the big picture. At this time, for example, it is not appropriate to be choosing the colour of the carpet. However, keep in mind that my wife likes blue.

    Also do not worry at this time about acquiring the resources to build the house itself. Your first priority is to develop detailed plans and specifications. Once I approve these plans, however, I would expect the house to be under roof within 48 hours.

    While you are designing this house specifically for me, keep in mind that sooner of later I will have to sell it to someone else. It therefore should have appear to a wide variety of potential buyers. Please make sure before you finalise the plans that there is consensus of the population in my area that they like the features this house has.

    I advise you to run up and look at my neighbours house he constructed last year. We like it a great deal. It has many features that we would also like in our new home, particularly the 75-foot swimming pool. With careful engineering, I believe that you can design this into our new house without impacting the final cost.

    Please prepare a complete set of blueprints. It is not necessary at this time to do the real design since they will be used only for construction bids. Be advised, however, that you will be held accountable for any increase of construction costs as a result of later design changes.

    You must be thrilled to be working on as an interesting project as this! To be able to use the latest techniques and materials and to be given such freedom in your designs is something that can t happen very often. Contact me as soon as possible with your complete ideas and plans.

    PS: My wife just told me that she disagrees with many of the instructions I've given you in this letter. As the architect, it is your responsibility to resolve these differences. I have tried in the past and have been unable to accomplish this. If you can't handle this responsibility, I will have to find another architect.

    PPS: Perhaps what I need is not a house at all but a travel trailer. Please advise me as soon as possible if this is the case.

    Source: Kevin Coheen, Associate Professor. Department of Mechanical & Aerospace Engineering Carleton University, Ontario, Canada



    Wednesday, August 18, 2004

    Artistic Blocs

    I've always had this idea of putting together a group of artists from many different artistic disciplines; Graphic designers, painters, writers, musicians, sculptors, poets, theater performers and even dancers all working under the same group banner in their own field but more importantly also in collaborative works across the varying genres. Some combinations are already common in society but what I have in mind would some of the more unusual combinations.

    Picture if you will, a painter, musician, dancer and poet collaborating on a single piece of art, its impact greater than the sum of its various facets. Painting blends into dance, poetry blends into music, forming an enrapturing miasma of sight and sound.

    I may be wrong but a group like this that transcends genre seem to me to be an interesting idea that could really make an impact on our world.

    Tuesday, August 03, 2004

    Online Contract Work Web Sites

    My friend Pete recently turned me on to a rather large site called Guru.Com that specializes in matching professionals up with companies / employers for contract work. In particular, they have quite a large area specifically for web development / general programming work which I have found to be an excellent resource. I find it interesting though that some US companies are reluctant to work with Canadians even if the job does not require on-site work. Now I can understand if the person was say from India where there would be no possibility of them visiting the job site but, in the case of one project I bid on, the job site was about a 5 minute drive from where I live (currently in downtown Windsor, ON across the river from Detroit, MI) Its strange really because I do qualify under NAFTA to work in the US as a System Analayst and would only require a short letter of sponsorship for employment.

    It is what it is I guess.

    Saturday, June 26, 2004

    MySQL Canada Provinces Table (SQL)

    For anyone who needs the MySQL SQL statement for creating a Canadian provinces table and populating it, here it is:

    .
    DROP TABLE IF EXISTS `provinces`;
    CREATE TABLE `provinces` (
    `id` int(11) NOT NULL auto_increment,
    `name` char(40) NOT NULL default '',
    `abbrev` char(2) NOT NULL default '',
    PRIMARY KEY (`id`)
    ) TYPE=MyISAM;


    INSERT INTO `provinces` VALUES (NULL,'Alberta','AB'),(NULL,'British Columbia','BC'),(NULL,'Manitoba','MB'),(NULL,'New Brunswick','NB'),(NULL,'Newfoundland / Labrador','NL'),(NULL,'Nova Scotia','NS'),(NULL,'Northwest Territories','NW'),(NULL,'Nunavut','NU'),(NULL,'Ontario','ON'),(NULL,'Prince Edward Island','PE'),(NULL,'Quebec','QC'),(NULL,'Saskatchewan','SK'),(NULL,'Yukon','YT');


    I've built this from scratch multiple times which can be a real waste of time. I hope it comes in handy for someone. The above link goes to a US States version of this table.

     

     
    Home