Suspend then hibernate in systemd 239

In systemd 239, they have added a new service that handles suspending then hibernating after a given amount of time. This is easier than using external scripts since it comes built-in with this version of systemd. You can check systemd version with systemctl --version.

More …

Minesweeper using HTML5

Obviously, everyone was born before the year 2000 knows the famous classic game ‘Minesweeper’. To me, I knew this game when I was little at the time where Windows XP was ruling everywhere. It is funny because at that time I did not know exactly how the game is played. That time the game was some kind of a luck game to me where you try to eliminate all the squares except the ones with mines until you either win or lose :laughing:.

More …

Sync Google calendar using Vdirsyncer and Orage

For a long time I wanted to have all my calendars and todo lists synchronized with my current desktop setup. Currently, I am using XFCE software, like Thunar, with Openbox to manage everyday stuff. Yes, I know with Gnome DE you can achieve that easily, but Gnome has a HUGE package dependencies. XFCE on the other hand is very light-weight and simple.

More …

Dropbox client on Ubuntu server 16.04

Dropbox, in my opinion, is the best cloud service available. I wanted to have one shared dropbox folder that is accessible from all my virtual machines running on the server. I am using a ZFS drive as a storage drive, the dropbox folder is located in the ZFS drive. Dropbox service is running as a normal user, not the root, and the server is using systemd to start the service after booting the system.

First, you have to have the libxxf86vm library, in Ubuntu 16.04 you can install it using sudo apt install libxxf86vm1 then download Dropbox.

wget -O dropbox-x86_64.tar.gz https://www.dropbox.com/download?plat=lnx.x86_64

and if you are running a 32-bit system use:

wget -O dropbox-x86.tar.gz https://www.dropbox.com/download?plat=lnx.x86

Now choose where you want to put Dropbox binaries and extract the files, in my case I used /opt/dropbox

sudo mkdir -p /opt/dropbox
sudo tar xzfv dropbox-x86_64.tar.gz --strip 1 -C /opt/dropbox

and because we are using a /opt/dropbox we have to link it to ~/.dropbox-dist

ln -s /opt/dropbox ~/.dropbox-dist

Run dropbox as a normal user /opt/dropbox/dropboxd this will give you a link to login to your account or if you are running a GUI it will open your default browser with a link to authenticate your account. Ctrl-c to stop dropboxd. As I said earlier, I want to put my Dropbox files on my storage drive. In my case I am using a ZFS drive located at /pool/shared/ I moved the Dropbox folder from my home folder to /pool/shared/Dropbox then linked the Dropbox folder to my home folder.

mv ~/Dropbox /pool/shared/Dropbox
ln -s /pool/shared/Dropbox ~/Dropbox

Now if you want to control dropbox from the command-line you can use this tool

wget -O dropbox-cli.py https://www.dropbox.com/download?dl=packages/dropbox.py

You can move it to your PATH for easy access. You have to have ~/.dropbox-dist, ~/.dropbox, and ~/Dropbox to use this tool. You can start/stop and check the status of the Dropbox service. The ~/.dropbox folder is created after you start dropboxd. For systemd to autostart Dropbox service simply create a new service at /etc/systemd/system/dropbox@.service with these configurations:

[Unit]
Description=Dropbox
After=local-fs.target network.target

[Service]
Type=simple
ExecStart=/opt/dropbox/dropboxd -p /home/%I/.dropbox/dropbox.pid
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
User=%I

[Install]
WantedBy=multi-user.target

This is basically a systemd service that can control Dropbox daemon from command-line. You can enable/start Dropbox from systemd sudo systemctl start dropbox@$USER.service or if you want to enable it to start on boot sudo systemctl enable dropbox@$USER.service

What is Jekyll?

Jekyll is a static website builder, it assembeles and combines multiple pages to form one unified HTML page. Jekyll uses YAML language to organize the structure of the page. Markdown language, which is a text-to-HTML converter, makes webpages easy to write and adapt.

Jekyll is writen in Ruby and can be installed using gem. On a Linux machine that already has Ruby installed, Jekyll can be installed as the following:

gem install jekyll bundler
jekyll new my-awesome-site
cd my-awesome-site
bundle exec jekyll serve

Now you can visualize the page using http://localhost:4000