Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Guide: Lich + Profanity + Free VM via Google Cloud + GTK2

  1. Default Guide: Lich + Profanity + Free VM via Google Cloud + GTK2

    First off, thanks to Tillmen and the community for all the hard work with Lich. Without it, I wouldnt still be playing this game.
    --------------------------------------------------------------------------------------------------------

    I struggled recently with getting the right versions of ruby, sqlite and gtk installed on a remote ubuntu server based on the current guides out there. In the process of figuring it out, I compiled a clean set of repeatable actions that I figured I would share here in case anyone finds value in it.

    By following this guide, you will a have a FREE remotely-accessible VM instance utilizing Profanity as the frontend that includes GTK window support.

    Step 1: Create a free-tier VM instance on Google Cloud Platform
    • Head over to Google Cloud Platform @ https://cloud.google.com and sign up for an account
    • Browse to Compute Engine -> VM Instances and select to Create Instance
    • Configure the instance in the following way:


    Step1.jpg

    A. Name the instance whatever you want. I've created unique instances for each character so I name each one the character name.
    B. Under Machine type, change to "micro (1 shared vCPU)"
    C. Under Machine type, select Customize and change the memory to 1.7 GB (this is only to support installing gtk2 and will later need to be changed back in order to stay free)
    D. Under Boot disk, change the image to "Ubuntu 16.04 LTS" and update the Standard persistent disk size to 30GB (just because you can)
    E. Click "Create"

    Step 2: Setup your server
    • From your list of VM instances, select SSH to connect.
    • Note both the external IP address of the VM instance in the list and your username after you SSH in. You will need this information later.
    • Copy/paste each line below.


    Code:
    sudo apt-get update
    sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev libsqlite3-dev unzip
    git clone https://github.com/rbenv/rbenv.git ~/.rbenv
    echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
    echo 'eval "$(rbenv init -)"' >> ~/.bashrc
    source ~/.bashrc
    git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
    rbenv install 2.2.5 -v
    rbenv global 2.2.5
    echo "gem: --no-document" > ~/.gemrc
    gem install sqlite3 gtk2 curses
    wget https://lichproject.org/download/lich-4.6.44.zip
    unzip lich-4.6.44.zip
    git clone https://github.com/matt-lowe/ProfanityFE.git
    Step 3: Download MobaXterm and create SSH keys
    • Download and install the free Home Edition of MobaXterm from https://mobaxterm.mobatek.net/download.html
    • Run MobaXterm. Under Tools, select "MobaKeyGen"
    • Ensure RSA is selected
    • Click "Generate"
    • Move the mouse until the key is created
    • Save both the public and private keys in a place that you will remember. I name my private key private_key.ppk and public key as public_key without an extension.


    Step 4: Add SSH key to VM Instance and update memory
    • From the VM list in GCP, click on the VM name
    • At the top of the page, first select "STOP" and then "EDIT" after it is shutdown (it will take little bit)
    • On the edit page, click "Customize" under Machine Type
    • Update the memory setting back to 0.6 GB
    • Scroll down to SSH Keys and expand section by clicking "Show and edit"
    • Open your public key on your local computer with notepad
    • Copy only the characters for the key (not including the ---- and Comment) and paste them into the key data box
    • In the key data box on GCP, add the word "rsa" before the key. After the key add your username that you noted previously. The key should be one long string; ensure that there are no carriage returns from pasting. Your entered key should look like this:


    step4b.png

    • Click "Save"
    • Click "START" at the top of the page to restart the VM



    Step 5: Setup MobaXterm session
    • In MobaXterm, select the icon to "Start a new remote session" from the top toolbar
    • Select SSH


    step5a.jpg

    A. Enter the Remote host as the external IP address you noted previously
    B. Check the box for Specify username and enter your username you noted previously
    C. Select Advanced SSH settings
    D. Ensure X11-Forwarding is checked
    E. Check the box for Use private key and select the private key you saved previously

    step5b.jpg

    F. Select Terminal settings
    G. Change the Terminal type to “xterm-256color”
    H. Optionally, under Bookmark settings, you can customize the session name for later reference
    I. Click “OK”

    Step 6: Set up Lich and connect
    • After clicking OK, or later via the saved sessions list, you should be connected to your VM Instance via MobaXterm
    • Run lich by entering the command

    Code:
    ruby ~/lich/lich.rbw
    step6.jpg

    A. Enter your username and password
    B. Select the character entry next to "Gemstone IV"
    C. Check "Save this info for quick game entry"
    D. Click "Play"

    • You will receive an error stating “failed to find the Simutronics launcher” but your login information has been saved.
    • Now you can login with the following command
      Code:
      ruby ~/lich/lich.rbw --login <character> --without-frontend --detachable-client=8000 2> /dev/null &
    • And start profanity with this command (keep trying if you get an error, sometimes lich takes a bit to get setup)
      Code:
      ruby ~/ProfanityFE/profanity.rb --custom-colors=off --port=8000


    Some Notes
    • I use separate VMs for each character as the free 0.6 GB memory doesn’t seem to handle MA’ing. You may be able to upgrade and stay within the annual $300 credit, but I haven’t tracked this.
    • MobaXterm also has a built-in SFTP client to easily move your scripts around.
    • I’m not an expert with linux but I can try to assist if there are any questions.
    Last edited by Samire; 07-12-2018 at 10:35 PM.

  2. Default

    Very interesting.

    I'm actually working on learning AWS at the moment, and will post feedback.

  3. Default

    Used AWS, already had a lich directory to copy up to my server and a pub/priv key I wished to use, and I use putty. Besides that, I followed these directions and everything fired right up.

    The last time I used profanity I had a portion of it dedicated to chat, trying to figure that part out again, otherwise.. good to go. Thanks for the guide.

  4. Default

    I must be doing something wrong in regards to colors though. My injury and direction bits aren't working and seem to be all lit.

    snip.jpg

  5. Default

    Yeah, I fussed with colors for awhile. I had to make sure the terminal type supported 256 colors and then use the --custom-colors=off flag when running profanity in order to get it working.

  6. #6
    Join Date
    Jul 2003
    Location
    St. Louis, MO
    Posts
    4,251

    Default

    If you are getting weird colors, you probably want to make sure your $TERM is something like xterm-256color or screen-256color.
    Quote Originally Posted by Patrick McGoohan
    I am not a number, I am a free man!

  7. #7

    Default

    It's likely a putty / term issue. I've been using similar setup for the last few years. It's a real pain in the ass to get the colors to behave correctly connecting from a windows machine, in general. I've had the most success using ConEmu or cmder (which is a fork of conemu). Generally I connect from my macbook though so its not really an issue.
    Mithrilschlong, 2015-03-10 to slightly later on 2015-03-10. You will not be forgotten!

  8. Default

    Got colors working fine by creating a bash script for starting profanity:

    #!/bin/bash
    export TERM=xterm-256color
    $HOME/lich/profanity.rb --custom-colors=off --port=8000

    Also, if you aren't using the linux utility "screen" you really should. You can use screen -S to label your screens with the character they are logged in as. control+A, :sessionname NAME will work from within a screen.

    Currently running two characters on my AWS box without any noticeable lag.
    Last edited by sellies; 07-09-2018 at 04:34 PM.

  9. Default

    Has anyone been able to get F keys to work from within mobaXterm or putty, to activate your profanity F macros?

  10. Default

    I use MobaXterm with macros mapped to F1-F12. I only use them though because I could not get alt key mappings working.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •