Jason Meridth's Blog Learn, Converse, Share

Details HTML Section In Github Issues and Gists

I recently became aware of using the <details></details> and <summary>...</summary> tags in Github issues and Gists.

Here is an example.

I will definitely be using this more when posting big logs or stack traces.

Kudos:

  • Laura Frank for showing me this feature
  • Keith Dahlby for letting me know it doesn’t currently work in Firefox
  • Matt Hinze for showing me this gist where I learned of <summary>...</summary>
  • Eric Clemmons for the awesome gist that does a great job explaining the feature

Stop and Remove All Docker Containers

Command remove all docker containers:

docker stop '$(docker ps -a -q)' && docker rm '$(docker ps -a -q)'

docker ps -a -q lists all container IDs

Get Repository Root Path

I needed to find a way to get the path to the root of my Git repository. I found the answer in the following command:

git rev-parse --show-toplevel

Example:

->$ git rev-parse --show-toplevel
/Users/jmeridth/dev/jmeridth.github.io

Vim Tagbar Plugin

I found the tagbar Vim plugin last night and finally tried it out this morning. I like it. I mapped ,tb to showing it in my .vimrc.

One of the requirements is Exuberant Ctags. Since I’m on OSX I installed it with Homebrew:

brew install ctags

In a Python file it will group/fold all of your imports, classes, methods, etc in one view. It is very nice and when you press enter on one of them it takes you to that item in the current buffer.

Here are the screenshots from the github repo screenshots (C++ files):

screenshot 1

screenshot 2

I’m really liking it so far.

Information Shown After Logging Into Ubuntu

Afer you log into an ubuntu instance you’ll usually see something like this:

Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.13.0-88-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Fri Jul  1 21:17:15 UTC 2016

  System load:  0.0               Processes:           100
  Usage of /:   20.1% of 7.74GB   Users logged in:     0
  Memory usage: 28%               IP address for eth0: 172.30.0.115
  Swap usage:   0%

  Graph this data and manage this system at:
    https://landscape.canonical.com/

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

7 packages can be updated.
7 updates are security updates.


Last login: Fri Jul  1 21:17:15 2016 from 1.2.3.4

I have logged into many ubuntu servers in my time and today I finally looked up how the information that displays gets generated and displayed. I’ve used /etc/motd aka message of the day many times before but I noticed tha file doesn’t exist in a vanilla Ubuntu install. There are two main commands that are populating the information shown at login.

For system information:

landscape-sysinfo

example output:

->$ landscape-sysinfo
  System load:  0.0               Processes:           99
  Usage of /:   20.1% of 7.74GB   Users logged in:     1
  Memory usage: 28%               IP address for eth0: 10.10.10.10
  Swap usage:   0%

  Graph this data and manage this system at:
    https://landscape.canonical.com/

For packages status:

/usr/lib/update-notifier/update-motd-updates-available

example output:

->$ /usr/lib/update-notifier/update-motd-updates-available

7 packages can be updated.
7 updates are security updates.