Sync clock with Google

No Comments

If the Linux VM was running at the time the host OS (Windows) hibernated then the clock in the guest VM will be left at the time of hibernation. If NTP is configured then the clock should resync gradually but most systems do not apply a big chunk of time correction by default.

If the Linux VM was configured with a VPN that implements a system-wide configuration then the DNS resolution might be unable to resolve the NTP server since the DNS of the VPN session will be unavailable. The alternate and work-around presented hinges on two things:

  • The guest VM has internet access at the time it was resumed.
  • The google.com domain name is already resolved and cached.

   sync-clock() {
     echo Current time before sync: `date`
     echo Current time after sync : `sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 \ 
       | grep Date: | cut -d' ' -f5-8)Z"`
    }

The work-around uses the time in the google headers to provide an anchor for the correction.  This is provided as a bash function to provide user feedback if a correction was done.

Snippet execution

Fix for crashing gnome-control-center

No Comments

The GNOME control center in my Manjaro system crashed while I was tweaking the details of the mouse settings. After it crashed, I was unable to bring it up again even after a reboot.

The solution was to reset the configuration files for it using the following command:

$ dconf reset -f /org/gnome/control-center/

After that, the control center UI is up and running again. Based on the search hits, visiting the details pane can sometimes caused the state that results to a segmentation fault whenever the control center initializes.

Pushing git branches to another repository

No Comments

Leaving this here as I keep on forgetting these whenever I try to replicate a repository to a test repository:

git remote add new_repo git@gitprovider.com:/path/to/new-test-repo.git
git fetch --all --prune
git push --prune new_repo +refs/remotes/origin/*:refs/heads/* +refs/tags/*:refs/tags/*

[BftP] Deductive Reasoning FTW!

No Comments

I am lifting the image below that I sent to some colleagues to highlight the power of deductive reasoning. The image originally came from 9gag.com but I am hosting a copy since this blog has been littered with broken links.

Batman vs Sherlock Holmes

The comment that I sent to accompany the email message has already been gone from the site. It explained the comics so I replicating it below for archiving purposes, with typos and all.

It’s quite easy, my dear watson.
It is Apparant that the mask is used to disguie a well-known identity from society. a man using a double life is most clearly a famous person, most possibly a rich man who can use an expensive Cavlar suit and quirky gadgets. the square jaw indicates a good lineage, perhaps a doctor’s son. the bat-motif is most likely from a childhood trauma that branded into the man’s mind as a great truth in the power that chiroptophobia has on the common man… *puff* *puff*

Mob mentality

No Comments

The mob mentality negates the basic premise that two wrongs doesnt make a right. Being part of a mob grants both a sense of power and a degree of anonymity by blending with the crowd. The combination of both can imbue a euphoria that overrides the normal and logical reasoning, enabling a person to do things they won’t normally be expected to do.

Once a mob is fired up, it will either take a lot to subdue it. Most of the time, it will simmer down but only after leaving a lot of damage in its path. The participants of the mob usually doesn’t feel any remorse as they justify their actions as both “right” and “acceptable” since it was the actions of the mob and not their own.

The best time to stop a mob is when it is just starting up. That is easier said than done though. The best way to handle a mob is get out of its way and just hope that there is still something left in its wake.

Older Entries