Thursday, June 02, 2016

Ubuntu / Website design Frameworks / GCP Tools / Useful 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
  • install chrome from repositories
    get -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-chrome.list'
    sudo apt-get update
    sudo apt-get install google-chrome-stable
  • uninstall default apps
    sudo apt-get remove cheese thunderbird rhythmbox firefox aisleriot gnome-mahjongg gnome-mines gnome-sudoku 
  • install creative apps
    sudo apt-get install vlc gimp inkscape blender ardour krita musescore gtk-recordmydesktop
  • sudo add-apt-repository ppa:pmjdebruijn/darktable-release
    sudo apt-get update
    sudo apt-get install darktable
  • and these from ppa or ... fontforge
  • pdfimages -png filein.pdf fileout
    pdf image extract
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]
Ubuntu wifi workaround for desktop (fixes home connection issue, cause unknown, not sure if this actually works yet):
Domain stuff:

No comments: