Skip to content

Instantly share code, notes, and snippets.

View alexmzirai's full-sized avatar
🎯
Focusing

Alex Mzirai alexmzirai

🎯
Focusing
  • Phoenix_IT Ltd
  • Nairobi, Kenya
View GitHub Profile
@alexmzirai
alexmzirai / mongodb_mongo_shell.md
Created October 11, 2017 20:47 — forked from leommoore/mongodb_mongo_shell.md
MongoDB - Mongo Shell

#MongoDB - Mongo Shell

###Single Task You can run commands in MongoDB from the command prompt by feeding the command into the mongo shell using:

mongo server1/admin --eval "db.runCommand({logRotate:1})"

mongo localhost:30000/admin --eval "db.runCommand({logRotate:1})"

This example will rotate the log file without remaining in the mongo shell. Note: admin refers to the admin database. Executing the command returns:

@alexmzirai
alexmzirai / sublime.sh
Created November 23, 2017 18:58 — forked from amatellanes/sublime.sh
Install Sublime Text 3 on Ubuntu 14.04 LTS (Trusty Tahr)
sudo add-apt-repository ppa:webupd8team/sublime-text-3;
sudo apt-get update;
sudo apt-get install sublime-text-installer;
sudo ln -s /usr/lib/sublime-text-3/sublime_text /usr/local/bin/sublime;
@alexmzirai
alexmzirai / gcloud_docker_setup.md
Created July 9, 2019 16:09 — forked from pratos/gcloud_docker_setup.md
Installing gcloud on Ubuntu 16.04 LTS

Installing it using cURL

$ curl https://sdk.cloud.google.com | bash

When the first time you run the above statement, it might be that you'll get the following error if python2 is not installed in your system.

Welcome to the Google Cloud SDK!
Traceback (most recent call last):
  File "/home/pratos/google-cloud-sdk/lib/third_party/enum/__init__.py", line 364, in __getattr__
@alexmzirai
alexmzirai / gcloud_commands
Created August 20, 2019 10:15 — forked from frntn/gcloud_commands
all gcloud commands
gcloud auth
gcloud auth activate-refresh-token
gcloud auth activate-service-account
gcloud auth git-helper
gcloud auth list
gcloud auth login
gcloud auth print-access-token
gcloud auth print-refresh-token
gcloud auth revoke
gcloud components
@alexmzirai
alexmzirai / gmail_signature_editing.py
Created March 23, 2021 12:25 — forked from timrichardson/gmail_signature_editing.py
Modern way to edit gmail signatures with python3 and the gmail API
from string import Template
import time
import pytest
from google.oauth2 import service_account
from googleapiclient.discovery import build
from googleapiclient.errors import *
from google.auth.exceptions import *
import easygui
import pandas as pd
@alexmzirai
alexmzirai / pipenv_cheat_sheet.md
Created May 13, 2021 13:12 — forked from bradtraversy/pipenv_cheat_sheet.md
Pipenv cheat sheet for common commands

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell