Tag name:ubuntu

Sleeping until top of the minute (Jun 2017)

I recently wanted my bash script (running on Ubuntu) to sleep until the top of the minute. The suggested code snippet from goggling is:

sleep $((60 - $(date +%S) ))

This works well, unless the current seconds count is 08 or 09. Bash interprets numbers starting with 0 as octal and 08 (and 09) are not valid octal numbers. I fixed this in my script as follows:

sleep $((160 - 1$(date +%S) ))

Setting up ubuntu (Apr 2017)

Since I'm in the progress of setting up an Ubuntu machine on another older machine as a server I want to record my steps...

All based on Ubuntu 16.04.2 LTS

  1. To ensure latest level of Ubuntu:
    1. sudo apt-get update
    2. sudo apt-get dist-upgrade
  2. To select 2D graphic effects instead of 3D:
    1. Add the older UI via:

      sudo apt-get install gnome-session-flashback

    2. logout, and then in the login window, click on the Ubuntu logo next to your user name and select "GNOME Flashback (Metacity)".
  3. Modify Brightness and Lock to adjust the screen saver timeouts

running popfile as a daemon process (Feb 2016)

This is just a note to myself in case I need it 🙂

To run popfile as a daemon process on Ubuntu. I did the following:

  1. Created a popfile user and home directory and gave it a copy of the popfile executables and copied across its data into /var/popfile.
  2. Created a /etc/init.d/popfile file
  3. Issued
    sudo /etc/init.d/popfile start

It's worth noting that popfile has data in /var/lib/popfile when it comes to backing it up. When restoring/transferring these files I also needed to ensure that the popfile userid owns these files.

running fossil as a daemon process (Feb 2016)

This is just a note to myself in case I need it 🙂

To run fossil as a daemon process on Ubuntu. I did the following:

  1. Created a fossil user and home directory and gave it a copy of the fossil executable and the website fossil file
  2. Created a fossil/etc/init.d/fossil file
  3. Issued
    sudo /etc/init.d/fossil start
  4. Run sudo update-rc.d fossil defaults to get the init.d script run at system start.

This /etc/init.d/fossil runs multiple fossils.