Skip to content

Instantly share code, notes, and snippets.

View omkar-dsd's full-sized avatar
:octocat:
Life 2.0

Omkar Deshpande omkar-dsd

:octocat:
Life 2.0
View GitHub Profile
@omkar-dsd
omkar-dsd / download_es_sha.sh
Created May 23, 2021 11:20
Download ES SHA512
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.12.1-arm64.deb.sha512
@omkar-dsd
omkar-dsd / install_pip_packages_from_dir.sh
Created August 8, 2020 06:30
Install Packages from Directory
#!/bin/bash
source venv/bin/activate;
for filename in internal_packages/*; do
pip install $filename
done

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@omkar-dsd
omkar-dsd / redis_cheatsheet.bash
Created October 14, 2019 15:20 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@omkar-dsd
omkar-dsd / db_size.sql
Created August 19, 2019 10:01
Check Database Size MySQL / MariaDB
SELECT table_schema AS "Database Name",
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size in (MB)"
FROM information_schema.TABLES
GROUP BY table_schema;
@omkar-dsd
omkar-dsd / clean_migrations.sh
Last active August 17, 2020 13:30
Empty Migrations
find . -name __pycache__ -exec rm -rf {} \; ; find . -name '00*.py' -delete;
@omkar-dsd
omkar-dsd / clean_my_branches.sh
Created February 1, 2019 07:41
Script to SAFE delete all existing branches
for b in `git branch`
do
`git branch -d $b`
done
@omkar-dsd
omkar-dsd / dracarys.sh
Created January 14, 2019 07:20
Cleaning Cache in Ubuntu
sudo apt-get clean
sudo apt-get autoremove --purge
# Copy this file to ~/bin/
# Add PATH to bashrc export PATH=$PATH:~/bin
try:
import json
except ImportError:
import simplejson as json
import time
import pprint
# Import the necessary methods from "twitter" library
from twitter import Twitter, OAuth, TwitterHTTPError, TwitterStream
from pymongo import MongoClient
if __name__ == '__main__':
cricfile = codecs.open("cricketbat.txt", 'r', "utf-8")
sent2 = cricfile.read().lower()
vampirefile = codecs.open("vampirebat.txt", 'r', 'utf-8')
sent1 = vampirefile.read().lower()
sent3 = "start"
# FOR TEST , replace the above variables with below sent1 and sent 2