Skip to content

Instantly share code, notes, and snippets.

View trohit's full-sized avatar
🎯
Focusing

Rohit trohit

🎯
Focusing
  • Bangalore
View GitHub Profile
@trohit
trohit / .bashrc
Last active January 5, 2017 06:07
historically bashful stuff
############################## Historic BASH stuff############################
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# show command before running it when you type
# !?<some text froma previously run command>
@trohit
trohit / ansiblekhichdi.txt
Last active December 27, 2016 05:07
ansiblekhichdi
# tutorials
## https://www.digitalocean.com/community/tutorials/configuration-management-101-writing-ansible-playbooks
## https://github.com/leucos/ansible-tuto
# hosts file - /etc/ansible/hosts
[uhosts]
192.168.11.101
192.168.11.105
192.168.11.107
# Videos - Hello World - Machine Learning Recipes - YouTube
# https://www.youtube.com/playlist?list=PLOU2XLYxmsIIuiBfYad6rFYQU_jL2ryal
# software to use
# http://scikit-learn.org/stable/install.html
# algos
# https://en.wikipedia.org/wiki/K-means_clustering
# http://scikit-learn.org/stable/auto_examples/cluster/plot_cluster_iris.html
# https://pythonprogramming.net/flat-clustering-machine-learning-python-scikit-learn/
@trohit
trohit / docker_khichdi.txt
Last active May 6, 2018 04:20
docker_khichdi
cat > /usr/local/bin/show_docker_ips
-------------------------------------
#/bin/bash
# shows the IPs of all the dockers on the host
# in a format that is accepted by /etc/hosts
for i in `docker ps|sed 1d|awk '{print $NF}'`;
do
DIP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $i)
echo "$DIP $i"
done
@trohit
trohit / vimkhichdi.txt
Last active January 15, 2017 06:53
vimkhichdi.txt
#To replace empty lines
# replace empty trailing lines
%s/\S\zs\s\+$//g
# replace empty lines with spaces
%s/\s\+$//g
# to add some content 'grep -v..' at the end of each line matching a a pattern (eg. that starts with zgrep...)
:g/^zgrep.*/s/$/ | grep -v ':0'
@trohit
trohit / getpy.sh
Last active September 12, 2018 03:10
to install python and ansible on coreos
#!/bin/bash
# get directly from sources
git clone https://github.com/pypa/virtualenv.git
cd virtualenv
python2.7 virtualenv.py venv
cd venv
source bin/activate
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python2.7 get-pip.py
pip install ansible
@trohit
trohit / ideas
Last active May 10, 2023 11:50
A simple bunch of ideas
1. EzHandle: Create a easy name/handle -> ph number reference registry.
A user owns the handle and can change references as and when he feels like.
He can change the visibility as and when he likes as well
The system can later be used to scale to store and pass other info as and when needed with the help of an API key
It will be audited to know who is accessing what and the user will be in complete control of that data and who can see it.
2. DoMoreWithLess: A retail furniture room in Bangalore that showcases and sells space saving furniture:
Like Murphy beds, foldable dining tables, mezzanine beds
The logo will be : Do more with less
3. A simple tracking and invoicing software to hekp small businesses keep track of their tax liabilities, P&L, etc.
4. A storage name->location indexer that will output results based on frequency of data accessed.
$ cat main
#!/bin/bash
rm -v /tmp/eject
i=0
while true
do
if [ -f /tmp/eject ]
then
exit 0
fi
# cheat sheet
https://github.com/wsargent/docker-cheat-sheet
#cmds
docker --version
docker info
docker images
docker ps
docker system prune -a
https://www.digitalocean.com/community/tutorials/how-to-install-go-1-7-on-centos-7