Skip to content

Instantly share code, notes, and snippets.

View ngdinhtoan's full-sized avatar
:octocat:

Toán Nguyễn ngdinhtoan

:octocat:
View GitHub Profile
@ngdinhtoan
ngdinhtoan / .travis.gofmt.sh
Created April 26, 2017 04:03
Script to check gofmt for travis
#!/bin/bash
if [ -n "$(gofmt -s -l .)" ]; then
echo "Go code is not formatted:"
gofmt -s -d -e .
exit 1
fi
@ngdinhtoan
ngdinhtoan / runasroot
Created December 31, 2015 07:32
make command run as root user (on MacOS)
#!/bin/bash
# This tool is to make an application can run as root user,
# even it is started by non-root user.
# check if command run under root privilege
if [ `whoami` != root ]; then
echo "This command need to be run under root privilege: 'sudo runasroot file_path'"
exit 1
fi