🕹ī¸ Do Something Great! 😄

Author: ryan

  • The Macintosh SE/30 lives

    Tonight, after just a little bit of tinkering, was a good night for my Macintosh SE/30. After I swapped the 2GB SD card in the SCSI2SD drive with a 256MB SD card, I was able to initialize the drive correctly. At first it only set up a 16MB partition, so I did have to re-partition the drive, but after that, the installation of System 6.0.7 was a breeze. And even though this thing only has 2MB of RAM, it is quick! I don’t know if it’s the SCSI2SD device or the fact that System 6 doesn’t require a whole lot, but Microsoft Word 4.0 loads almost instantly. I’ll have to measure the boot time when I get a chance.

    The Macintosh SE/30

    I’m writing this blog post in Microsoft Word on the SE/30. The worst part is the fact that the keyboard needs a good cleaning. I’m not too impressed with the Apple Extended Keyboard II, although I’ve heard people rave about it. I think I have an IIgs compact keyboard around here somewhere to replace it. The smaller size fits better with the SE/30 anyway.

  • Bringing my Apple Macintosh SE/30 back to life

    Several months ago an Apple Macintosh SE/30 came across eBay at a price I was willing to pay. It had a dead hard drive in it, but that wasn’t a big deal to me. I had already been looking at the SCSI2SD devices so the plan was to use one for the drive. Old hard drives are way too loud anyway. 🙂

    Last night I finally unwrapped the beast. The Apple Extended Keyboard II appears to have sustained some damage in shipment, but I think it still works. I cracked open the case and put the SCSI2SD device in place, but after Apple HD Setup chewed on the drive for 20 minutes, it said initialization failed. Ugh. Searching the Internet brought up something called Lido, so that’s what I’m going to try next. Unfortunately, I don’t know how I’m going to do it on the SE/30 because I only System 6 on a floppy, so I’m going to attempt to set it up from my 20th Anniversary Mac.

  • My blogging at RyanCollins.org vs Eduk8.me

    I’ve been struggling with my online identity and what I want to share. Too often I try to spread myself too thin, but if I’m not trying to learn it all I feel like I’m missing something. If you haven’t noticed, I’ve taken a different route with RyanCollins.org and Eduk8.me. For now I’m going to use RyanCollins.org for more nerdy pastimes, such as Raspberry Pi hacking and command line tomfoolery, and Eduk8.me for more general purpose Edtech tips.

  • Searching bash history when it’s in multiple files

    When I look for previous commands that I have ran in bash, I use history | grep COMMAND. That works well when you’re history is in one file, but I now save my history in multiple files from each shell and my simple command doesn’t work.

    With my history files saved in ~/.bash_history_log/ I needed a different solution. The one I came up with is grep -ri COMMAND ~/.bash_history_log/*. That seems awfully long, lets make it shorter. You can’t pass arguments to bash aliases, but you can to functions. In .bash_profile (or .bashrc, which ever runs for you by default) I added the following function:

    function searchhistory() {
        grep -ri "${1}" ~/.bash_history_log/*
    }
    alias shistory=searchhistory
    

    And now a simple shistory COMMAND is all it takes to find that command I ran a long time ago.

  • Uploading my current IP address so I can find my Pi

    For some reason my autossh job is failing to set up the reverse tunnel so I can find and connect to my Pi when the Pi is roaming. Until I figure out why that is happening, I wrote this bash script which will upload the wifi interface’s current IP address to a remote server.

    1
    2
    3
    4
    #!/bin/bash
    
    echo `ifconfig wlan0 | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'` | \
        ssh [email protected] "cat > ~/myip.txt"
    

    I already have ssh passwordless logins in set up because of autossh. If you don’t have that set up, then you’ll need to do that first or this won’t work. I then add a cron job to run this script every minute.

  • Upload and converting pictures automatically from Dropbox

    I’ve been using Pelican to publish this website for awhile now, and one of the things I wanted to do was to be able to post from my phone and include pictures. To accomplish this I wrote a script that checks the upload folder in dropbox, and if there is a file, it will re-size the pictures to 4 different sizes and upload it to Amazon S3. I can then easily link to any of the sizes of pictures for my posts.

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    #!/bin/bash
    
    TOUPLOAD=/Path/to/check/for/pics/*
    SAVEUPLOADED=/Path/to/save/uploaded/pics
    S3BUCKET="BUCKET/for/pics"
    S3CMD=/usr/local/bin/s3cmd
    DIR=/Path/to/html/file/that/has/links/to/pics
    UPLOADED=FALSE
    
    
    if [[ ! -d /tmp/uploadpic ]]; then
        mkdir /tmp/uploadpic
    fi
    
    if [[ ! -d ${UPLOADED} ]]; then
        mkdir -p ${UPLOADED}
    fi
    
    shopt -s nullglob
    
    for f in ${TOUPLOAD}
    do
        if [[ -f ${f} ]]; then
        OUT=/tmp/uploadpic
        FILENAME=${f}
        FULLFILENAME=$(basename "${f}")
        EXT=${FULLFILENAME##*.}
        FILE=${FULLFILENAME%.*}
    
        echo "Working with ${FILE}.${EXT}"
    
        echo "Resizing"
        convert "${FILENAME}" -resize 320x240 "${OUT}/${FILE}-xs.${EXT}"
        convert "${FILENAME}" -resize 640x480 "${OUT}/${FILE}-s.${EXT}"
        convert "${FILENAME}" -resize 800x600 "${OUT}/${FILE}-m.${EXT}"
        convert "${FILENAME}" -resize 1024x768 "${OUT}/${FILE}-l.${EXT}"
        convert "${FILENAME}" -resize 2048x1024 "${OUT}/${FILE}-x.${EXT}"
    
        echo "Uploading"
    
        find ${OUT} -name "${FILE}*" -print0 | xargs -0 -I upload ${S3CMD} put upload s3://${S3BUCKET}/ --acl-public
    
        ${S3CMD} put "${FILENAME}" s3://${S3BUCKET}/ --acl-public
        mv "${FILENAME}" ${SAVEUPLOADED}/
        UPLOADED=TRUE
    fi
    done
    
    if [[ ${UPLOADED} = TRUE ]]; then
        echo "Pics have been uploaded..."
        echo "<html><head><title>Blog Pics</title></head><body><ul>" > ${DIR}
        ${S3CMD} ls s3://${S3BUCKET}/ | sort -r | cut -c 69- | xargs -I filename echo "<li><a href='http://${S3BUCKET}/filename'>filename</a>" >> ${DIR}
        echo "</ul></body></html>" >> ${DIR}
    fi
    

    This requires ImageMagick to be installed for the convert command. Once I have the script written I set up crontab to run the script every minute.

  • Some fun with ST Writer on the Atari MegaSTe

    Inspired by a thread on AtariAge, I decided to write up my blog posts tonight on my Atari MegaSTe in ST Writer.

    The Atari MegaSTe was released near the end of the Atari computer era with a 68000 cpu running at 16MHz in a case that separates the keyboard with the computer itself. I’m using the Atari SC1224 color monitor with it (12″ at 640×200 resolution) which is fine for most things. The mono monitor is a superb 640×400 resolution at 70Hz, but mine needs some adjusting since the screen is too small. The keyboard is pretty amazing, one of the best feeling keyboards I have every used.

    ST Writer is the word processor that is the heir apparent to the AtariWriter word processor for Atari’s 8-bit line of computers. I used AtariWriter for at least 6 years as my word processor, and it made the most out of the 40 character wide screen. ST Writer feels like coming home, although now with 2.5MB of free space.

    To post the article, I will use ZModem to transfer it to my Linux box where I can fix the line endings and can then use Pelican to post.

    It’s pretty weird to be back on a single processing system with limited Internet access. I should do this more often!

  • autossh problems

    My Pi is doing a pretty good job on connecting to wifi when I travel between places. Unfortunately, my autossh job on the Pi is not working.

    I set up autossh to open up a reverse ssh tunnel to a known host, allowing me to always ssh to my Pi using a hostname. But it seems like I need to do some more testing.

  • Finding your Pi on the network

    When you’re playing around with the Raspberry Pi, there are multiple times when you won’t have a screen attached to the Pi but you’ll want the IP address to use with SSH. What I did was set up static IP addresses on my DHCP server (in this case the ASUS RT-AC66U$).

    Click on LAN on the left side, and then select the DHCP tab:

    Manual IP Management

    Enter the MAC address of the network port on the Pi and select an IP address that isn’t being used. You’ll probably want to enter the MAC address of the wifi dongle too, if you use that. The ASUS is nice because the drop down will contain the MAC addresses of the devices that have connected to it, so you should be able to go through that list until you find the correct entries. To get the MAC addresses if this method doesn’t work, ssh to the pi and run ifconfig | grep HWaddr. It will then show the network interfaces and their MAC addresses.

    Once you have it set up, it’s really nice playing around with your Pis. It doesn’t matter what SD card you put in, as long as the Pi is set for DHCP, it will always be assigned the IP address you set.

    $ – Affiliate link to Amazon. Non-affiliate link.

  • A bash script to check domain expirations

    I have a bad habit, and that’s of buying domain names. I have about 20, with several different registrars. If I was smart, I would consolidate them under one registrar, but, even then, checking expirations on the domains is a pain. I usually have autorenew turned on, but I still like to know when they are getting close to expiration.

    Before re-inventing the wheel, I did a Google search, and found Domain Expiration Check Shell Script. It worked pretty well, except for a few top level domains like .me which didn’t work. I modified the script, and just had to put some finishing touches on it today (.com, .net, and .org was broken). Check out the gist of the script on Github.

    I put all of my domains in a text file, and can then run it with ./domain-check -f mydomains.txt. It’s pretty cool.