Skip to content

Instantly share code, notes, and snippets.

@ashishraste
ashishraste / install_ros_melodic_ubuntu_bionic.sh
Created February 12, 2021 00:01
Installs ROS Melodic in a vanilla Ubuntu 18.04 (Bionic Beaver) OS
#!/bin/bash
do_install() {
set -e
# Setting up sources.list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu bionic main" > /etc/apt/sources.list.d/ros-latest.list'
# Setting up keys
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
@ashishraste
ashishraste / java_snippets.md
Last active June 24, 2019 05:12
Snippets for Java based repos

Java Snippets

Packaging SpringBoot App in a Docker Image

Requires a repackage goal in the spring-boot-maven plugin, as given below.

<build>
    <plugins>
      <plugin>
@ashishraste
ashishraste / python_snippets.md
Last active June 24, 2019 05:07
Python Snippets
@ashishraste
ashishraste / install_opencv2.4_ubuntu16.04.sh
Created April 27, 2017 03:37
Installation of OpenCV 2.4.13 on Ubuntu 16.04
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install build-essential -y
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev -y
sudo apt-get install python3-numpy python3-pip python3-scipy python3-matplotlib python-dev python-matplotlib python-numpy python-scipy -y
sudo apt-get install python-pip python-tk libqt4-dev libqt4-opengl-dev libeigen3-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev default-jdk ant -y
@ashishraste
ashishraste / xkcd-plots.md
Last active March 21, 2024 16:29
Steps to plot xkcd-style graphs using Matplotlib and Python

System details : Ubuntu 14.04, python-2.7.


  1. Download Humor-Sans ttf font from here.
  2. Place it in /usr/share/fonts/truetype/. For OSx systems, you'd just need to double-click the font file to install.
  3. Run the following commands, to refresh your system's font cache and to delete Maplotlib's font cache.
 sudo fc-cache -f -v
 cd ~/.cache/matplotlib; rm fontList.cache; cd #for OSx systems, this file resides in ~/.matplotlib/
@ashishraste
ashishraste / quotes.md
Last active March 11, 2017 14:42
Quotes and thoughts
@ashishraste
ashishraste / compilation_tweaks.md
Last active March 1, 2017 06:38
Tweaks for compiling certain libraries
  1. MRPT
  2. OMPL

On building MRPT

System details : Ubuntu 14.04, has boost-1.55, boost-1.66, pcl-1.8 (without visualization objects) in /usr/local/lib, pcl-1.7 and vtk-5.8 in /usr/lib.
Following edits were made in CMakeLists.txt for resolving map-related-binary-builds of MRPT.

@ashishraste
ashishraste / better_programmer.md
Created October 12, 2016 10:12
Design methodologies and tips to become a better programmer

The Joel Test


Listing out the points suiting to a single programmer.

  • Do you use source control?
    • There's a single script you can run that does a full checkout from scratch, rebuilds every line of code, makes the executables, in all their various versions, languages, creates the installation package, and creates the final media.
@ashishraste
ashishraste / Training.py
Created February 18, 2012 12:29 — forked from rohitdholakia/Training.py
This is for training the Bayesian model
#This is for training. Calculate all probabilities and store them in a vector. Better to store it in a file for easier access
from __future__ import division
import sys,os
'''
1. The spam and non-spam is already 50% . So they by default are 0.5
2. Now we need to calculate probability of each word , in spam and non-spam separately
2.1 we can make two dictionaries, defaultdicts basically, for spam and non-spam
2.2 When time comes to calculate probabilities, we just need to substitute values
'''
from collections import *