Skip to content

Instantly share code, notes, and snippets.

@SunnyRaj
SunnyRaj / crimes-install.sh
Last active September 29, 2017 16:12
CRIMES 4.9 install script with support for Remus
#!/bin/bash
####################################################
# CRIMES 4.9 install script with support for Remus #
# NOT YET TESTED - Use gcc-6 #
####################################################
set -e
CRIMESDIR=""
#! /bin/sh
set -e
sudo apt-add-repository -y ppa:brightbox/ruby-ng
sudo add-apt-repository -y ppa:danielrichter2007/grub-customizer
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
# sudo add-apt-repository -y ppa:jonathonf/vim
sudo apt-get update
sudo apt-get -y upgrade

Keybase proof

I hereby claim:

  • I am sunnyraj on github.
  • I am sunnyraj (https://keybase.io/sunnyraj) on keybase.
  • I have a public key ASAw4T5cdSHaGAdt26tYt7yqouJyLTUBAQb14jdxNpZsdAo

To claim this, I am signing this object:

@SunnyRaj
SunnyRaj / track_remote_and_merge.sh
Last active February 6, 2017 12:16
Git track remote and merge
# This will track all remote branches
for remote in `git branch -r | grep -v /HEAD`; do git checkout --track $remote ; done
git checkout <your_branch>
git merge <branch_you_want_to_merge_into_yours>
# If you want to automatically select their version on conflict
# git merge --strategy-option theirs <branch_you_want_to_merge_into_yours>
@SunnyRaj
SunnyRaj / Makefile
Last active June 7, 2016 20:06
Makefile for compiling latex documents
target = paper
.PHONY: ${target}.pdf all clean
all: ${target}.pdf
# CUSTOM BUILD RULES
# In case you didn't know, '$@' is a variable holding the name of the target,
# and '$<' is a variable holding the (first) dependency of a rule.
@SunnyRaj
SunnyRaj / consolas.sh
Last active June 7, 2016 20:07
Install consolas font on mac
#!/bin/zsh
brew install cabextract
cd ~/Downloads
mkdir consolas
cd consolas
curl -O http://download.microsoft.com/download/f/5/a/f5a3df76-d856-4a61-a6bd-722f52a5be26/PowerPointViewer.exe
cabextract PowerPointViewer.exe
cabextract ppviewer.cab
open CONSOLA*.TTF
@SunnyRaj
SunnyRaj / configure_muliple_gcc.sh
Last active October 10, 2023 09:17
Configure multiple GCC versions on ubuntu
#!/usr/bin/env bash
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt update
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo apt-get install -y gcc-4.8 g++-4.8 gcc-4.9 g++-4.9 gcc-5 g++-5 gcc-6 g++-6 gcc-7 g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10
kill "$@" $(jobs -p)
@SunnyRaj
SunnyRaj / percent_calculator
Created March 29, 2015 21:56
Calculate the percentage completed while processing a input file using carriage return
import sys
import os
from time import sleep
path = "text"
file_size = os.stat(path).st_size
f = open(path, 'r', 1)
bytes_read = 0
for line in f:
bytes_read += len(line)