CLI – GUI – Code – Name
Ubuntu Coding Examples
This is a quick reference for various things I've done.
It is definitely not meant to be comprehensive, or even definitive.
Most things I don't do very often, and since my wetware memory has intermittent problems, this has been a great time-saver for refreshing my knowledge.
Most of these are of the
everyone knows that category.
But when one does something only once a year or so, it's nice to have a reminder that one really does know it.
- $ date --date="@-545693400" +"%F %H:%M %z"
- 1952-09-15 22:30 -0400
Expand file into command line:
If file is guaranteed not to contain whitespace:
If file might contain whitespace:
- $ xargs <file --delimiter=$'\n' --replace='%' cmd ... % ...
% is any character not contained in the
from other files
- import sys
- sys.path.insert(0, "../../source/myprogsource")
- from myprogsource import myprog
- # pip3 install gspread oauth2client
- # pip3 install networkx
- import gspread
- from oauth2client.service_account import ServiceAccountCredentials
- scope = ["https://spreadsheets.google.com/feeds"]
- credentials = ServiceAccountCredentials.from_json_keyfile_name("client_secret.json", scope)
- client = gspread.authorize(credentials)
- sheet1 = client.open("Name of Sheet").sheet1