Ubuntu / website frameworks / GCP / utils / commands

Here's a mixed bag of stuff that I find useful. Any of it may be out of date.



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
  • Ubuntu desktop useful commands:

  •  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}
Multiple filename rename:
  • sudo apt install mmv
  • usage example
    mmv '*.3gpp' '#1.mp4'

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 apt install vlc libreoffice gimp inkscape darktable ardour krita musescore gtk-recordmydesktop fontforge simple-scan gnome-tweak-tool
  • optional Blender install bleeding edge 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 [googlegmailusername]
  3. Restrict access to keys (do this for new or copied files else nautilus may not login!)
    chmod 400 ~/.ssh/my-ssh-key
  4. Go to the metadata page for your project and copypaste public key (from my-ssh-key.pub)
    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://[googlegmailusername]@[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:
[possibly somewhat out of date] 




Generate mp4 video thumbnails in Ubuntu nautilus

option 1 (not sure if it works)
  • install totem via software app
  • sudo apt-get install gstreamer1.0-libav
  • open nautilus, press cntl+r to refresh and it should start to build thumbs
option 2 (with messy MS EULA)
  • sudo apt-get install totem ubuntu-restricted-extras
  • open nautilus, press cntl+r to refresh and it should start to build thumbs



DON'T LOOK HERE, but is to do with a current sd cards issue

wipefs -a -f /dev/sdc

fdisk /dev/sdc
n
p
1
w

wipefs -a -f /dev/sdc
dd if=/dev/zero of=/dev/sdc1 bs=512 count=1 conv=notrunc

dd if=/dev/zero of=/dev/sdc1 bs=1 count=64 seek=446 conv=notrunc

dd if=/dev/zero of=/dev/sdc1 bs=512 count=1
dd if=/dev/zero of=/dev/sdc1 bs=512 count=1000000000


Comments