Ubuntu / website frameworks / GCP / utils / commands

Since throwing in the towel on operating a LAMP web server and pure HTML back in 2006, I've been using the cloud and Blogger purely exclusively, as there were benefits to this move (like not needing to deal with bare metal). Blogger has lots of templates and flexibility to customize site design. It is CMS based and user maintainable without the need for web geeks, making it relatively simple to hand over. Best of all the sites are alive, and changes propagate to people who subscribe to feeds.

Recently (2016) one thing lead to another and I got into Google Cloud Platform (GCP). The years between 2006 and 2016 were my server capability gap years. Now with GCP I got my server capability back, but cloud based which is even better than ever.

After playing around with my first hand carved GCP website based on one simple HTML file, it is not long until the first client walked in the door (it was a friend who got my story and shared my excitement). It is at that point that recent whispers from my peers started to echo in my head more loudly -- responsive, responsive, responsive. Within a day or two I did a bit of research and got into responsive frameworks. I did a read-up about skeleton, google web fundamentals, material design light (MDL), and codepen. I chose to run with MDL and codepen.

Blogger website tools:
HTML CSS tools
GCP tools
Notes for GCP web server setup:
  1. click to setup a vm instance
  2. click SSH to open terminal
  3. sudo apt-get update
  4. sudo apt-get install apache2
GCP file upload via SSH command terminal:
  • click SSH to open terminal
  • click cog (upper right corner), select Upload file, select local gzip file
  • ls {list files}
  • move file into directory: mv myfile.tar.gz var/www/html/archive
  • change directory: cd var/www/html/archive
  • see file: ls
  • extract gzip verbose file structure : tar -xzvf myfile.tar.gz
  • see files: ls
  • delete ter : rm myfile.tar.gz
  • change directory: cd myfile
  • see files: ls
  • change directory: cd ../../../../..
  • run my deploy script:
    sudo sh 1.sh
    (which contains the following commands)
    sudo rm -r /var/www/html/*
    sudo cp -r /home/GOOGLEUSERNAME/var/www/html/* /var/www/html
Ubuntu misc commands:
  • sudo nano /etc/apache2/apache2.conf
  • sudo /etc/init.d/apache2 restart
  • rm -r {delete folder, much faster than with file manager}
  • unzip -o file.zip -d var/www/html {extract into directory structure and overwrite}
Ubuntu system maintenance commands:
  • sudo apt upgrade {to update system}
  • sudo reboot
  • sudo apt clean {deletes download cache}
  • sudo apt autoremove {uninstall not needed packages}
Ubuntu desktop useful commands:
  • to network scan LAN neighborhood for port 80 web servers
    nmap -p 80 192.168.0.*

  • as a fallback for making a USB boot disk
    sudo usb-creator-gtk

  • fallback to format USB
    sudo dd if=/dev/zero of=/dev/sdb bs=4k && sync
  • fallback for disk format
    sudo gnome-disks

  • Chrome install command line
    wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
    sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
    sudo apt update
    sudo apt install google-chrome-stable

  • uninstall default apps
    sudo apt remove cheese thunderbird rhythmbox aisleriot gnome-mahjongg gnome-mines gnome-sudoku gnome-calendar

  • install creative apps
    open Software and Updates, Other Software tab, check Canonical Partners
    sudo vlc apt install gimp inkscape blender darktable ardour krita musescore gtk-recordmydesktop fontforge gnome-tweak-tool

  • optional Blender install latest version (some newer features)
    download via https://www.blender.org/download/
    extract folder and rename to 'blender'
    run blender from folder
    (this method will not associate .blender files, so have open them from within blender)
  • optional Darktable install latest version command line (fixes some issues but I can't remember the main one, maybe tethering)
    sudo add-apt-repository ppa:pmjdebruijn/darktable-release
    sudo apt-get update
    sudo apt-get install darktable

  • GWD Google Web Designer install command line
    [if installed after Chrome then no need to get key again]
    wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
    sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/webdesigner/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
    sudo apt-get update
    sudo apt-get install google-webdesigner

  • PDF images export
    pdfimages -png filein.pdf fileout
Notes for file manager remote folders

  1. Open gnome-terminal
  2. ssh-keygen -t rsa -f ~/.ssh/my-ssh-key -C [googleusername]
  3. Restrict access to keys
    chmod 400 ~/.ssh/my-ssh-key
  4. Go to the metadata page for your project and copypaste pub key
    SUPER IMPORTANT: Metadata tab is to stay empty, but click onSSH Keys tab, and your locallly made pub key to the bottom of the list of google generated keys.
  5. Open Nautilus, connect to server as
    sftp://[googleusername]@[yourgcpserverIPaddress]
[possibly out of date] Ubuntu wifi workaround for desktop (fixes home connection issue, cause unknown, not sure if this actually works yet):
Domain stuff:

Comments