journal
all all entries rss SoML excited dreams runes YRUU ultimate KTRU skate sleepy nihongo
Rob is 20,135 days old today.
prev day next day printable version

Entries this day: a-bit-repetitive-kids-class cloud-9-is-amazing install.sh

a bit repetitive kids class

##10:30am Wednesday 26 Nov 2014

(written 07:14 Thursday 27 November 2014 JST)

The first kids class yesterday included the song "Walking Walking" about 20 times; I brought Johnny (the bear I bought in Thailand) and had him join in the circle as we sang Walking Walking. All the kids wanted a chance to hold his hand, thought at first I tried to skip a few kids to save time. Not that I normally try to save time when it comes to play, but I felt a sense that I was suppose to do something productive during the class. Some of the kids cried so we did a little sit down circle and each one got to sing the song while moving Johnny to the next kid.

During the second class one girl cried and went to the side of the room while we played Hokey Pokey. I had the entire class slowly move from the other end of hte room to the side where she was sitting. I sat down beside her and she was still moe joe, but realized I was there for her when I took her hand to help her stand up. She was all genki by the end and seemed happy.

A lot of the kids were all climbing on me, trying to high five me and hang on my arms. That part is fun and great, but trying to do a lesson during the chaos is chaos.

"Can you say chaos?"

permalink

cloud 9 is amazing

##12:51 Wednesday 26 November 2014 JST##

''''';;;;;;;;;;;;

Sorry, that was Ted walking on my computer.

Cloud 9 is amazing! How can they implement SublimeText in a browser? I can run emacs! It's like I'm working in a local shell.. So brilliant!

There's a .bash_aliases file, .bashrc so I can set up aliases and stuff. Wow. I'd like the pricepoint to be a bit lower, but dang it's pretty close to amazing. If it can replace my local computer, why not?

Cloud 9 terminal

There are a couple of rough edges; I mentioned using emacs. I can, though C-b has to be pressed twice for each move-cursor-back command (or whatever it is). I guess some of the keystrokes are swallowed by the something in the mix.

I was able to edit files in a repo, push the changes to github; wow wow wow!

  • - - - -

##15:06

This, for example, is being typed on Cloud 9's interface, which offers things like visible whitespace,

multiple cursors, multiple cursors, multiple cursors, multiple cursors,

Cloud 9 text editor

drag and drop images(!), and though I haven't found it, apparently some type of image editor.

I found the Cloud 9 image editor

permalink

install.sh

##20:35 Wednesday 26 November 2014 JST##

I spent most of the day working on installing a website from git; it has symlinks to a config directory and a vendor directory. We're not just updating an existing directory, but cloning the repo from git each time.

I made a little install.sh file:

#!/bin/bash
read -p "This will install the latest version from git!!  Are you sure? (n) " -n 1
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
    exit 1
fi

echo
echo installing new site....
echo

oldTZ=$TZ
export TZ='Asia/Tokyo'
DATE=$(date +%Y-%m-%d-%H%M%S)
export TZ=$oldTZ

ROOT_DIR=/var/www/example.com
VERS_DIR=$ROOT_DIR/versions
DATE_DIR=$VERS_DIR/$DATE

sudo chmod 777 $VERS_DIR

git clone --depth 1 git@gitexample.org:path/to/repo.git $DATE_DIR

if [ ! -d "$DATE_DIR" ]; then
    echo "no folder created; did git clone work?"
    exit 1
fi

sudo chmod 755 $VERS_DIR

sudo rm $DATE_DIR/config/ -R
sudo ln -s $ROOT_DIR/config $DATE_DIR/config
sudo ln -s $ROOT_DIR/vendor $DATE_DIR/vendor
sudo chown www-data:www-data $DATE_DIR -R
sudo chmod 750 $DATE_DIR -R

sudo service monit stop
sudo service apache2 stop
if [ -f $ROOT_DIR/revert ]; then
    sudo rm $ROOT_DIR/revert
fi
sudo mv $ROOT_DIR/current  $ROOT_DIR/revert
sudo ln -s $DATE_DIR $ROOT_DIR/current
sudo service apache2 start
sudo service monit start

read -p "Does it work??  y to keep; n to revert to previous version: (n) " -n 1
if [[ $REPLY =~ ^[Yy]$ ]]
then
    sudo rm $ROOT_DIR/revert
    sudo chmod 755 $VERS_DIR
    echo
    echo
    echo installed NEW VERSION of site
    echo
    echo
else
    sudo service monit stop
    sudo service apache2 stop
    sudo rm $ROOT_DIR/current
    sudo mv $ROOT_DIR/revert  $ROOT_DIR/current
    sudo chmod 755 $ROOT_DIR/versions/
    sudo service apache2 start
    sudo service monit start
    echo
    echo
    echo REVERTED to PREVIOUS version of site
    echo
    echo
fi
permalink
prev day next day