Showing posts with label Linux-Apps. Show all posts
Showing posts with label Linux-Apps. Show all posts

Sunday, 29 May 2016

Midnight Commander Configuration

By default when exiting Midnight Commander bash returns to the directory Midnight Commander was started from, instead of the last open directory. Midnight Commander has a wrapper script which can be used by adding
source /usr/lib/mc/mc.sh
to your
~/.bashrc
Useful Commands are
Copy (to second pane) : F5
Move (to second pane) : F6
Exit Midnight Commander : F10
Tab : Move to second pane
User menu (compress, uncompress) : F8

Monday, 28 March 2016

chromium - FATAL:setuid_sandbox_client.cc(126)] Check failed: IsFileSystemAccessDenied()

Testing running chromium in Docker I had the following stack trace :
[0329/035746:FATAL:setuid_sandbox_client.cc(126)] Check failed:
 IsFileSystemAccessDenied().
#0 0x55e51a82299e <unknown>
#1 0x55e51a8007ee <unknown>
#2 0x55e51a8934fe <unknown>
#3 0x55e51a7f3f3b <unknown>
#4 0x55e51a7f21a6 <unknown>
#5 0x7fe5e8984710 <unknown>
#6 0x55e51a7f34f9 <unknown>

[1:1:0329/035746:ERROR:nacl_fork_delegate_linux.cc(315)] Bad NaCl helper
 startup ack (0 bytes)
[1:1:0329/035746:FATAL:setuid_sandbox_client.cc(126)] Check failed: 
IsFileSystemAccessDenied().
This is because chromium should not be run as root. From the development list this is by design.

Sunday, 21 February 2016

ssh agent and forwarding on Arch Linux for Ansible

I have been using Ansible a lot for automation of deployments recently. One of my deployments had the need to clone a git hosted project from a server in the cloud. I did not want to have to place my private key on the cloud server for security reasons. The answer for me was setting up an ssh agent on my Arch Linux workstation to simplify working for ssh keys. With the ssh agent in place I could use ssh agent forwarding to authenticate using the private key on my workstation. The same process would work for any version of Linux.

SSH Agent set-up

On the Arch Linux Wiki there is a number of suggestions but the one I found was the easiest was from this StackOverflow article by adding the following to my ~/.bash_profile
SSH_ENV="$HOME/.ssh/environment"

function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}

# Source SSH settings, if applicable

if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
    start_agent;
}
else
start_agent;
fi
This will check if you already have an ssh-agent running and if not will start a new agent. You can always check its running:
$ pgrep -a ssh-agent
23409 /usr/bin/ssh-agent
The ssh-agent daemon will automatically import the private key ~/.ssh/id_rsa which can be listed with:
$ ssh-add -L
Other private keys can be included for use by the ssh-agent with :
$ ssh-add <path to private key>

Agent Forwarding

Within my /etc/ansible/ansible.cfg file I set the following ssh settings
[ssh_connection]
ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o ForwardAgent=yes
When Ansible is on the remote machine and clones from the git project the authentication will automatically be forwarded to my Arch workstation to be authenticated by the ssh-agent.

Obtain Random Words from a Dictionary in Linux

It can be very useful to be able to quickly generate random words from a dictionary in Linux. One common use case I have is generating random responses for the Security Questions on web sites. This is to avoid anyone easily guessing what the answers are. Typically the questions tend to be the same and not very difficult to guess. I save the actual responses in the Notes section of the Password Manager than I use.

Obtain A Dictionary Text File

There is a great dictionary list that is available with GNU Aspell (ftp://ftp.gnu.org/gnu/aspell/dict/0index.html) which provides a collection of International ‘words’ files for /usr/share/dict.
To install on Arch Linux :
$ pacman -S words
$ wc -l /usr/share/dict/usa
119095 /usr/share/dict/usa
There are a number of dictionaries installed under /usr/share/dict/ that you can choose from
$ ls /usr/share/dict/
american-english british british-english catala catalan finnish french german italian ngerman ogerman spanish usa

shuf - generate random permutations

We can use the shuf command to generate random words using a dictionary. Install shuf if its not installed :
$ pacman -S shuf
Then use the n argument to define the number of words you would like e.g.
$ shuf -n5 /usr/share/dict/usa
macroeconomic
visualizes
shabbiest
sen
chortler
To easily access this I have an alias :
alias GenerateRandomWord=’shuf -n5 /usr/share/dict/usa’

Tuesday, 8 September 2015

VirtualBox slow on installation of Guest OS

I use VirtualBox for testing in many environments. Normally the defaults are fine for installing Linux but on one environment it was really slow to just install. Installing Debian Jessie from an ISO would normally take 15 minutes but in this environment after an hour it was still only at 35%. The host OS was not over taxed and has lots of spare CPU + RAM resources free.

After some testing I found the issue was resolved by :

1. Open Settings
2. Navigate to System->Motherboard
3. Change the Chipset to ICH9 (see below)
4. Press OK

Now the installation will be fast.




Monday, 22 December 2014

Fix : Linux NTFS Error Mounting $MFTMirr does not match $MFT (record 0)




With an external USB hard drive that is used to share files between Windows and Linux computers you may get an Error on Linux similar to the following :

Error mounting: mount exited with exit code 13: $MFTMirr does not match $MFT (record 0). Failed to mount ‘/dev/sdd1′: Input/output error NTFS is either inconsistent, or there is a hardware fault, or it’s a SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows then reboot into Windows twice. The usage of the /f parameter is very important! If the device is a SoftRAID/FakeRAID then first activate it and mount a different device under the /dev/mapper/ directory

To resolve the issue is to use ntfsprogs which can be installed from most Linux distributions e.g.

Arch Linux

$ sudo pacman -S ntfsprogs

Ubuntu/Linux Mint/Debian

$ sudo apt-get install ntfsprogs

To fix the issue run the following command syntax

$ sudo ntfsfix <drive mount point>

Change the drive to be the same shown in the Error. For example in the above error the command is

$ sudo ntfsfix /dev/sdd1

Tuesday, 16 December 2014

BeagleBone Black Debian image initial steps



This article details initial steps of a BeagleBone Black with a Debian image. For this setup I am using a 5V adapter for power and connecting the Ethernet port to my local LAN.

  • With power and Ethernet connected the BeagleBone is set to automatically run DHCP. You can ping the hostname of 'beaglebone' to show the connectivity

$ ping beaglebone
PING beaglebone.lan (192.168.1.155) 56(84) bytes of data.
64 bytes from beaglebone.lan (192.168.1.155): icmp_seq=1 ttl=64 time=0.964 ms
64 bytes from beaglebone.lan (192.168.1.155): icmp_seq=2 ttl=64 time=0.630 ms

  • Next ssh as root (there is no password set)


  • Set a password for root :

# passwd

  • Update to the latest builds

# apt-get update
# apt-get upgrade

  • Set the correct Timezone
# dpkg-reconfigure tzdata

  • Confirm correct date

# date

  • Check that the web server is listening on port 80

# netstat -an | grep -i 80
tcp6 0 0 :::8080 :::* LISTEN
tcp6 0 0 :::80 :::* LISTEN

  • In a web browser (not IE) open the IP address of your Beaglebone to display the default page
  • Enjoy your Beaglebone!

Monday, 14 July 2014

Ubuntu/Arch Linux : USB Error Input/output error NTFS is either inconsistent, or there is a hardware fault


It can be quite common to use a USB drive on your Linux box and then have to copy file to a Windows computer. When you reconnect the USB drive to your Linux box you may get a similar Error to the following :

Failed to mount '/dev/sdd1?: Input/output error NTFS is either inconsistent, or there is a hardware fault, or it's softRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows then reboot into Windows twice.


This can seem a bit daunting but thankfully the solution is quick by installing 'ntfsprogs'. ntfsprogs is a suite of NTFS utilities based around a shared library.

Arch


$ pacman -S ntfsprogs

Ubuntu

$ sudo apt-get install ntfsprogs

Then run the command (note : change the drive to match the same as you get with the error) :

$ sudo ntfsfix /dev/sdd1

See the man file for full details.

$ man ntfsprogs             

Sunday, 13 April 2014

Paint Format : Google Doc's most useful time saving tool

After moving to only using Google Doc's for content creation one of the few but vital things I found to be lacking was the support for applying the same format to multiple sections at a time in a document.

After some searching I found the solution was the Paint format icon :


To be honest I had never really noticed this icon before and had presumed it was related to images. In fact this turns out to be the most useful and underrated Google doc feature.

Example of  Paint Format usage

A typical use case is you have a document with lots of text in it but some of the text in various places requires to be different. For example below I would like every line with a command starting # to be 'Courier New' with Font size of 10 :



Its very time consuming (especially in very large documents) to go to each line individually and select 'Courier New' with Font size of 10 each time.

Fast Track Process - Single Change
  • Define the first line as you would like e.g. 'Courier New' with Font size of 10
  • Press the 'Paint format' icon once and it will be grey


  • Use the mouse to highlight the full line you want to be the same
  • The line will now automatically change to 'Courier New' with Font size of 10





 Fast Track Process - Multiple Changes

  • In the above example the change only occurs for one selection. 
  • In large doc's we need to be able to apply the same format for many lines
  • Press the 'Paint format' icon twice and it will be grey
  • Every line you now highlight will change  to the new format
  • Disable by a single click to the 'Paint format' icon




Crop Images easily in Linux using GIMP

Its great to have a quick but powerful tool to be able to crop images. On Linux GIMP (GNU Image Manipulation Program) is a powerful tool but potentially not immediately obvious way to crop images. This post outlines how you can quickly crop your images on Linux Mint or Ubuntu.

  • GIMP should already be installed but you can quickly check from the terminal :
$ sudo apt-get install gimp
  • Browse to the image, right click and select 'Open With -> GIMP Image Editor'



  • The picture will open in the main window and a second 'Toolbox' window to the left will also appear (as highlighted below)


  • If the Toolbox does not appear from the main GIMP window select 'Windows -> New Toolbox'
  • On the Toolbox select the 'Crop Tool' icon as shown  below or press 'Shift + C'


  • Select the area you want to keep then choose a corner of this box e.g. as shown below with the arrow


  • By selecting the corner box this crops the picture 




  • The default save format is GIMP XCF. To save as another format e.g. jpeg select 'File -> Export' and select the relevant format you want.

Capture Screenshots using terminal or script with Shutter

For screenshots my favorite Linux tool is 'Shutter' which has lots of features. It can be useful to capture a screenshot using the terminal or a script. This post details how you can quickly use it on Linux Mint or Ubuntu.

  • To install shutter
$ sudo apt-get -y install shutter
  • Also useful to install (details at end of post)
$ sudo apt-get -y install gnome-web-photo libnet-dbus-glib-perl libimage-exif-perl libimage-exiftool-perl
  • Capture the full screen :
$ shutter -e -f -o FullScreen.png
  • Capture active window :
$ shutter -e -a -o ActiveWindow.png

Syntax

-a : Capture the current active window
-e : Exit after the first capture has been made
-f : Capture the entire screen 
-o : Filename to save the screenshot

Note : You can save to jpeg, png, gif and bmp format

  • Using a sleep command with shutter enables you to setup the capture as required :

$ sleep 5 && shutter -e -f -o FullScreen.png

  • Then open the file e.g. my workspace 



  • A simple bash script is


  • This example will create a file called 'FullScreen.png' after 5 seconds under the directory '~/Pictures/screenshots/' 
$ CaptureFullScreen.sh FullScreen

Some Useful Things

  • You can add the script under the a bin directory in your home folder i.e. mkdir ~/bin/
  • Add your bin directory (insert your username for <username>) to your PATH within ~/.bashrc
Syntax 

export PATH=/home/<username>/bin:$PATH

Example

export PATH=/home/cwishaw/bin:$PATH
  • Give the file executable privileges
$ chmod +x CaptureFullScreen.sh
  • Using a fast access top down terminal like Guake is great to quickly start scripts with F12
  • Further details can be found with 'man shutter'

Additional Package details

  • gnome-web-photo: Create snapshot images and print web pages from the command line
  • libnet-dbus-glib-perl - extension for the DBus GLib bindings
  • libimage-exiftool-perl - Library and program to read and write meta information in multimedia files
  • libimage-exif-perl - Perl module to extract EXIF information from image files

Draw arrows in GIMP on Linux





Unlike most photo editing software GIMP does not come with draw arrow support by default. This post shows how to get this feature within GIMP and how to use it on Linux Mint & Ubuntu.
  • Close GIMP if its open
  • Go to the GIMP Plugin Registry 
  • Search for 'Draw arrow' + download 'arrow.scm'
  • Copy file from "Downloads" directory to the gimp hidden folder in your home directory
$ cp arrow.scm ~/.gimp-2.8/scripts/

Note : Your GIMP version may vary but will be ~/.gimp-<version>/scripts
  • Open an image in GIMP and under menu 'Tools -> Arrow' will now appear
  • Select 'Colour Tool' and on the bottom of the 'Toolbox' select the colour you would like the arrow to be :

  • Select Paths Tool
  • Next is a bit tricky (until you do it a few times). Select where the arrow head will be, press mouse once and a small square will appear


  • Select where arrow tail will be, press mouse once and a line appears


  • Right click on the line and go to 'Tools-> Arrow'



  • Modify how the arrow is defined in the options (you can play with this until its what your want)


  •  Press OK and the arrow will appear :)

Highlight area of image with rectangle in GIMP on Linux




GIMP is a great photo editing tool on Linux Mint + Ubuntu. This post shows how you can quickly highlight an area of any image with rectangle.
  • Open GIMP and select the 'Colour Tool' then scroll down to the bottom of the Toolbox and change to the desired colour.



  • Choose the 'Rectangle Select Tool'


  • Select the area you want to highlight

  • Go to the 'Edit -> Stroke Selection'




  •  Select the type of stroke (Solid color or pattern) and change the width then press OK


  • You now will have the image highlighted

  

EtherApe : A great visual network monitoring tool



EtherApe is a great tool to be able to visualize traffic on your network.
  • Install in Linux Mint or Ubuntu
$ apt-get -y install etherape
  • Create a simple Launch script (to launch with root)
$ cat ~/bin/EtherApe.sh
#!/bin/bash
gksudo etherape
  • Set writable permissions (replace 'lclark' with your username)
$ chmod +x ~/bin/EtherApe.sh
  • Update launcher script line to match new script using sudo  :
$ grep Exec /usr/share/applications/etherape.desktop
Exec=~/bin/EtherApe.sh
  • Launch app using icon from Menu or launcher
Note -  As EtherApe runs as root use with caution when connected to the internet

ethtool : powerful simple tool to display or modify NIC parameters



I recently discovered ethtool which is a simple but effective command line tool for finding out information about your network card or to change the network settings.

Note - ethtool can only be used against physical adapters

Installation & Adapter Information
  •  Install on Linux Mint, Ubuntu or Raspberry Pi:
$ sudo apt-get -y install ethtool
  • Find out your adapters with ifconfig (typically starting eth0)
$ ifconfig

Adapter Information
  • Running ethtool with no options prints out adapter information e.g.
 $ sudo ethtool eth0 
  • Example output


  • The above network card supports
    • MMI (Media Independent Interface)
    • Maximum of 100base T/Full 
    • Auto negotiation support
    • Wake on 'MagicPacket'
  •  Actual device settings
    • Speed 100Mb/s
    • Full Duplex
    • Running MII
    • Physical address : 1
    • Auto Negotiation : enabled
    • Wake On Lan : disabled
    • Link is detected
  •  This information is really useful when troubleshooting a network card

Modify Settings
  •  '-s' can be used to modify settings on a NIC e.g. to set to 1000baseT/Full (if your switch supports it) :
 $ sudo ethtool -s eth0 speed 1000 duplex full autoneg on

 Find a Network Card
  • Occasionally on a server will many multiple cards it can be difficult to know which network card related to the system assigned ethX
  • ethtool has a cool 'blinking' feature that allows you to define the number of binks on a specified network card :
 $ sudo ethtool -p eth0 10
  • The above command will blink eth0 for 10 seconds
Driver Information
  •  The '-i' option queries the network card for driver information on the card
 $ sudo ethtool -i eth0

  • This provides a really easy and quick way to obtain the driver information

Statistics
  •  It can be really useful to obtain network card statistics
  • The '-S' option can be used to obtain the information
 $ sudo ethtool -S eth0








Lighttpd - lightweight low footprint web server




Having used Apache server for a long time I was looking for a web server with a much lower memory footprint. The solution I found was Lighttpd which is pronounced 'lighty'. Its used by many web sites including YouTube and Wikipedia as it allows them to scale a lot better with the same hardware. Its easy to use, powerful and quick to setup.

Pre Installation Check

  • Default listen port is 80
  • Check nothing is already bound to port 80
$ netstat -an | grep -i 80  
  • If the port was bound you would see 
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN 

Installation
  • On Linux Mint, Ubuntu or Raspberry Pi 
$ sudo apt-get -y install lighttpd 
  •  Lighttpd will automatically start. Check the port is now bound
$ netstat -an | grep -i 80 
  • Check status
$ /etc/init.d/lighttpd status
 * lighttpd is running




Manual Bug Fix
  • In the latest builds the default lighttpd.conf contains a bug
  • Open in a text editor and find the line starting 'index-file.names'
$ sudo vi /etc/lighttpd/lighttpd.conf


  • As hightlighted above there is an extra quoue in " index.lighttpd.html"
  • Remove quote and save as shown below


  • Restart service
$ sudo /etc/init.d/lighttpd restart

Change Default Port
  • Its a good idea to change the default listening port from 80 to another non bound port
  • I am going to change it to port 8888
  • First check nothing is listening on that port
 $ netstat -an | grep -i 8888
  • Open config file in text editor
$ sudo vi /etc/lighttpd/lighttpd.conf
  • Add
 server.port = 8888
  •  Save file and restart
$ sudo /etc/init.d/lighttpd restart
File and Directory Details
  • HTML files location : /var/www
  • Default directory index : index.html
  • CGI Scripts : /usr/lib/cgi-bin
  • Logs : /var/log/lighttpd
Further Configuration
  • Lighttpd has many support modules that enhance functionality
  • RRDTool can be used for statistics



Shaarli : personal hosted minimalist delicious clone



Its great to be able to access your own bookmarks in an organized manner. An open source solution I have been using lately is Shaarli. Key advantages are bookmarks are not shared to any 3rd party and you have full control over privacy. Shaarli is quick to deploy and import bookmarks.

Pre installation
  • Set up your own web server 
  • For an example setup see my previous post on Lighttpd - lightweight low footprint web server 
  • Note - for this guide I assume the webserver is available at http://localhost/
  • Install php5-cgi (server-side, HTML-embedded scripting language)
$ sudo apt-get -y install lighttpd php5-cgi
  • Enable fastcgi module, php configuration and restart service
$ sudo lighty-enable-mod fastcgi
$ sudo lighty-enable-mod fastcgi-php
$ sudo /etc/init.d/lighttpd restart
  • Create file /var/www/index.php with a text editor with contents
<?php phpinfo(); ?>
  • Open browser to http://localhost/index.php and following should appear


Installation
  • Create a folder on your web server
$ sudo mkdir /var/www/shaarli
  • Download the latest zip file from Shaarli
  • Extract file and copy contents to new folder
  • Change file and group ownership
$ chown www-data:www-data  /var/www/shaarli 
  •  Open browser to http://localhost/shaarli/index.php and following should appear


Configuration
  • After login select 'Tools->Shaare link' and drag to your bookmarks toolbar
  • Go to a site and when you want to bookmark it select 'Shaare link'


  •  You can define new tags automatically in the 'Tags' field
Import/Export bookmarks
  • Its easy to export bookmarks from Firefox, Chrome and import under 'Tools->import'
  • A corresponding 'Tools->export' feature

Other Features
  • The 'Tag cloud' gives an overview of all the tags
  • RSS and ATOM feed of site content
  • Daily overview of added content for that day in a newsfeed
  • Automatically stores thumnails that contain images
Backup
  • Option 1 : Copy /var/www/shaarli/data/datastore.php to backup location
  • Option 2 : Export via 'Tools->export' to html file to backup location

Convert Virtualbox VM to KVM



To Convert a Virtualbox VM to KVM there is a simple process to follow. It makes use of the Virtualbox tool 'VBoxManage'. If the VM image size is large the conversion can take some time (depending on your machine) e.g. 30 minutes for  a 40GB file. If you also have a low powered machine you may not be able to run other tasks while the conversion is occurring.

Convert Virtual Disk Image to RAW image format

  • Convert the Virtualbox vdi (Virtual Disk Image) file to a raw image
  • Format
$ sudo VBoxManage clonehd --format RAW /<Path to Virtualbox VM>/<Virtualbox VM>.vdi /<Path to KVM VM>/<KVM VM>.img 
  • Example
$ sudo VBoxManage clonehd --format RAW ~/VirtualBox\ VMs/Vista/Vista.vdi ~/KVMImages/Vista.img 
  • I also find it useful in a second terminal to have 'watch running on ls to see the file size increasing
$ sudo watch ls -lh

Convert RAW image format to QCOW2

  • RAW images are simple to work with but can take up a lot of space
  • QCOW2 (QEMU Copy on Write) advantages over RAW file format
    • Files with this format can grow as data is added i.e. smaller images
    • Allows changes made to a read-only base image to be stored on a separate qcow file by using copy on write
    • Snapshot support
    • Optional zlib compression
    • Optional AES encryption
  •  Format
$ sudo qemu-img convert -f raw  /<Path to KVM VM>/<KVM VM>.img -O qcow2  /<Path to KVM VM>/<KVM VM>.qcow 
  • Example
$ sudo qemu-img convert -f raw Vista.img -O qcow2 Vista.qcow


Using Virtual Machine Manager to import image

  •  Open 'Virtual Machine Manager'
  •  Right Click on 'localhost (QEMU) and select 'New' 

  • Select 'Import existing file disk image' as highlighted above
  • Select image at location file was converted
  • Define remaining options as required and start the VM from KVM
  • When the VM is OK you can delete the RAW format file 

iftop : bandwidth monitoring tool


'iftop' is a great tool for monitoring Bandwidth usage. Like the classic process monitoring tool 'top' it allows you to monitor bandwidth usage by hosts. Iftop displays a table of current bandwidth usage by pairs of hosts and has many configuration options.

The hosts with the highest bandwidth usage data is at the top.


Installation


  • On Linux Mint/Ubuntu the install is  
  $ sudo apt-get -y install iftop

Running the Tool


  • Require root access :
$ sudo iftop 
  •  Uses the first interface by default but can specify the interface
$ sudo iftop -i eth0 
  • iftop looks up the hostnames associated with addresses it finds in packets. This can cause substantial traffic so can be good to disable
 $ sudo iftop -i eth0 -n
  • Show ports as well as hosts
$ sudo iftop -i eth0 -n -P
  • Don't convert port numbers to services e.g. 80 to http
$ sudo iftop -i eth0 -n -P -N
  •  Display Bandwidth in Bytes
 $ sudo iftop -i eth0 -n -P -N


Statistics Explained


  • Statistics output above from left to right is for data rate (both sent and received) for the last
    • 2 seconds
    • 10 seconds
    • 40 seconds

  • Cumulative and peak data above displays
    • Received
    • Transmitted
    • Total

Edit Google Docs using Vim with googlcl



Installation
  • On Ubuntu or Linux Mint : 
$ sudo apt-get install -y googlecl

Authorization
  • The first time you access the service you need to Authorise the googlecli
  • Run the following command
$ google docs list
  • You will then be prompted for your email address and a browser will open asking for Authorization from this computer
  • Enter the provided browser Authorization code to the CLI
  • After this your Google Docs will be listed
Google Docs list with grep
  •  You can grep on the list command e.g.
 $ google docs list | grep Linux
  • Other Unix commands can be used in a similar way
Configuration File

  • Once the Authorization has occurred you can review the config file :
$ cat ~/.config/googlecl/config
  • Example configuration file :
$ cat ~/.config/googlecl/config

[DOCS]
spreadsheet_format = xls
format = txt
spreadsheet_editor = openoffice.org
presentation_format = ppt
presentation_editor = openoffice.org
document_format = txt
drawing_format = png
skip_auth = True
user = cwishaw@example.com

[CALENDAR]
fields = title,when

[GENERAL]
regex = True
url_field = site
missing_field_value = N/A
fields = title,url-site
cap_results = False
max_retries = 2
hostid = example@computername
retry_delay = 0.5
date_print_format = %b %d %H:%M

[YOUTUBE]
max_results = 50

[CONTACTS]
fields = name,email

 

Set Vim as Default Editor
  • Update [DOCS] section with line in red
[DOCS]
 

editor = vim
spreadsheet_format = xls
format = txt
spreadsheet_editor = openoffice.org
presentation_format = ppt
presentation_editor = openoffice.org
document_format = txt
drawing_format = png
skip_auth = True
user = cwishaw@example.com

  • Open a Google Doc e.g.
$ google docs edit "Hello Google Docs"
  • Edit and save it as normal


  • View in Google Doc's


Alias Setup

  • It can be useful to have some alias setup e.g.
alias gvi='google docs edit $1'
alias glist='google docs list'

  • Command examples 
$ glist | grep -i hello
$ gvi "Hello Google Docs"


Further References