Skip to content

Instantly share code, notes, and snippets.

View jm66's full-sized avatar

JM Lopez jm66

  • University of Toronto
  • Toronto
View GitHub Profile

Image for Prep Photon OS for Photon Platform

Change password to never expire

chage –I -1 –m 0 –M 99999 –E -1 root

Update repository sources

tdnf update

@jm66
jm66 / osx_automount_nfs.md
Created January 29, 2020 03:13 — forked from L422Y/osx_automount_nfs.md
Automounting NFS share in OS X into /Volumes

I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

#
# Automounter master map
#

+auto_master # Use directory service

@jm66
jm66 / settings-sync
Created November 6, 2019 16:32
settings-sync
settings-sync
@jm66
jm66 / 1-setup.md
Created September 12, 2019 17:26 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing with either GPG or Krypt.co.

Installing Python 3.7.0 on Raspbian

As of July 2018, Raspbian does not yet include the latest Python release, Python 3.7.0 This means we will have to build it ourselves, and here is how to do it.

  1. Install the required build-tools (some might already be installed on your system).
@jm66
jm66 / server.badbots
Created April 17, 2018 21:36 — forked from hans2103/server.badbots
NGINX to block bad bots. (add Twenga|TwengaBot if you want to exclude them too)
if ($http_user_agent ~* (360Spider|80legs.com|Abonti|AcoonBot|Acunetix|adbeat_bot|AddThis.com|adidxbot|ADmantX|AhrefsBot|AngloINFO|Antelope|Applebot|BaiduSpider|BeetleBot|billigerbot|binlar|bitlybot|BlackWidow|BLP_bbot|BoardReader|Bolt\ 0|BOT\ for\ JCE|Bot\ mailto\:craftbot@yahoo\.com|casper|CazoodleBot|CCBot|checkprivacy|ChinaClaw|chromeframe|Clerkbot|Cliqzbot|clshttp|CommonCrawler|comodo|CPython|crawler4j|Crawlera|CRAZYWEBCRAWLER|Curious|Curl|Custo|CWS_proxy|Default\ Browser\ 0|diavol|DigExt|Digincore|DIIbot|discobot|DISCo|DoCoMo|DotBot|Download\ Demon|DTS.Agent|EasouSpider|eCatch|ecxi|EirGrabber|Elmer|EmailCollector|EmailSiphon|EmailWolf|Exabot|ExaleadCloudView|ExpertSearchSpider|ExpertSearch|Express\ WebPictures|ExtractorPro|extract|EyeNetIE|Ezooms|F2S|FastSeek|feedfinder|FeedlyBot|FHscan|finbot|Flamingo_SearchEngine|FlappyBot|FlashGet|flicky|Flipboard|g00g1e|Genieo|genieo|GetRight|GetWeb\!|GigablastOpenSource|GozaikBot|Go\!Zilla|Go\-Ahead\-Got\-It|GrabNet|grab|Grafula|GrapeshotCrawler|GTB5|GT\:\:WWW|Guzz
@jm66
jm66 / uncommitLastCommit.md
Created February 9, 2018 14:26 — forked from alexislucena/uncommitLastCommit.md
Git: How to uncommit my last commit in git

To keep the changes from the commit you want to undo

$ git reset --soft HEAD^

To destroy the changes from the commit you want to undo

$ git reset --hard HEAD^

You can also say

@jm66
jm66 / docker-compose.yml
Created November 18, 2016 18:21
Portworx Lighthouse
version: "2"
services:
influxdb:
image: tutum/influxdb:latest
restart: always
env_file:
- influxdb.env
web:
image: portworx/px-lighthouse
@jm66
jm66 / docker-compose.yml
Last active November 18, 2016 18:19
Portworx Lighthouse
version: "2"
services:
influxdb:
image: tutum/influxdb:latest
restart: always
env_file:
- influxdb.env
web:
image: portworx/px-lighthouse
restart: always
@jm66
jm66 / create_virtual_disk.py
Created September 18, 2015 14:48
pyVmomi: create_virtual_disk function
def create_virtual_disk(capacity, controller_key, unit_number, in_bytes=False):
"""
:param capacity: Capacity of new disk in Bytes
:param unit_number: device unit
:return:
"""
virtual_disk = vim.vm.device.VirtualDisk()
if in_bytes:
virtual_disk.capacityInBytes = capacity
else: