Skip to content

Instantly share code, notes, and snippets.

View neeraj9's full-sized avatar
🎯
Focusing

Neeraj neeraj9

🎯
Focusing
  • Microsoft
View GitHub Profile

Linux and Unix operating systems comes in a wide range of flavors often bundled as different distributions by different vendors. Every one of these distribution also comes with an often pre-defined and latest version of the Linux kernel. Sometimes you need to know the exact name and version of your operating system, machine as well as the kernel, be it to install the correct version of a software, find if a hardware is compatible or be it to upgrade your OS itself. There are several ways to check your operating system and linux kernel versions. As each distribution (or distros) are slightly different some of the commands might work in some distros while some maynot.

uname

uname is the linux command which prints out the name, versions and other details of the machine and kernel running on the machine. It is basically short for Unix Name. This is usually part of the core-utils package and should be available on almost all distros. There are several options available to print out just the kernel detail

@neeraj9
neeraj9 / build_otp.sh
Created October 18, 2021 06:11 — forked from gburd/build_otp.sh
Shell script to build a debug or valgrind enabled Erlang OTP release and other helpful notes.
#!/usr/bin/env bash
# Note: erlang depends on ncurses, openssl at a minimum
usage ()
{
echo "usage: $0 <release> <type>"
echo " release: R14B01|R14B02|R14B03|R14B04|R15B|R15B01|R15B02|R15B03|R16B|R16B01|R16B02"
echo " type: normal, opt, gcov, gprof, debug, valgrind, or lcnt"
@neeraj9
neeraj9 / refactor_1_strike_cpp.diff
Last active September 9, 2019 15:54
Refactor Part 1 Strike .NET Core Diagnostics Strike.cpp
diff --git a/src/SOS/Strike/strike.cpp b/src/SOS/Strike/strike.cpp
index f14b8c4..fe30347 100644
--- a/src/SOS/Strike/strike.cpp
+++ b/src/SOS/Strike/strike.cpp
@@ -153,6 +153,7 @@ const UINT kcMaxMethodDescsForProfiler = 100;
#include <set>
#include <vector>
#include <map>
+#include <tuple>
@neeraj9
neeraj9 / test_maps_order.erl
Created May 23, 2019 05:23
Erlang Maps Traversal Order Test
#!/usr/bin/env escript
%%% @author neerajsharma
%%% @copyright (C) 2019, Neeraj Sharma <neerajsharma.9@outlook.com>
%%% @doc
%%%
%%% @end
-module(test_maps_order).
%% -*- erlang -*-
%%
@neeraj9
neeraj9 / py_beamparticle_testing_runeditor
Created May 5, 2018 03:02
BeamParticle sample python program which is to be used for evaluation via runeditor
#!python
from pymongo import MongoClient
import pandas as pd
from datetime import datetime
from datetime import timedelta
import requests
import sys
import json
@neeraj9
neeraj9 / building_microsoft_graphengine_from_source.sh
Created April 23, 2018 01:56
Build Microsoft GraphEngine from source on Ubuntu 16.04
# Author: Neeraj Sharma
#
# https://www.graphengine.io/docs/manual/index.html
# https://www.microsoft.com/net/learn/get-started/linux/ubuntu16-04
setup_dot_net() {
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
@neeraj9
neeraj9 / bandwidth_monitoring.c
Created March 29, 2018 12:57
Simple Bandwidth monitoring in Gnu Linux
/*
* Copyright (c) 2015 Neeraj Sharma. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@neeraj9
neeraj9 / basic_application_logging.c
Created March 29, 2018 12:40
Demonstrate Application Logging in C Programming Language
/*
* Copyright (c) 2015 Neeraj Sharma. All rights reserved.
*
* Licensed under GNU GPL v3 License.
* License: https://www.gnu.org/licenses/gpl-3.0.txt
*
* Code style based on the Linux Kernel, see
* https://www.kernel.org/doc/Documentation/CodingStyle
* for more details.
*
@neeraj9
neeraj9 / web_retrieve_url_and_summarize.erl.fun
Last active February 9, 2019 21:08
BeamParticle retrieve website and extract readable text
#!erlang
%% @doc Fetch content from internet and summarize
%% @author Neeraj Sharma
%%
%% run web_retrieve_url_and_summarize(<<"http://beamparticle.org/about.html">>, 5000, 5000)
%%
fun(Url, ConnectTimeoutMsec, TimeoutMsec) when (is_binary(Url) orelse is_list(Url))
andalso is_integer(ConnectTimeoutMsec)
andalso is_integer(TimeoutMsec) ->
Headers = [],
@neeraj9
neeraj9 / py_text_readability.py.fun
Created March 29, 2018 10:01
BeamParticle clean up data received from website
#!python
#
# py_text_readability
#
# see https://github.com/buriy/python-readability#python-readability
#
# Dependencies:
#
# sudo pip3 install readability-lxml
#