Skip to content

Instantly share code, notes, and snippets.

@sriramster
sriramster / msb.c
Created June 2, 2014 10:22
Some msb bit extraction
#include <stdio.h>
#define extract_msb(val, size) \
val >> ((size/2) * 4); \
int main()
{
int i = 0xffff;
short j = extract_msb(i,4)
printf("\n %d, %d", i, j);
@sriramster
sriramster / sr-ydis.el
Created June 3, 2014 10:03
Disable Yanking
;; No need to set arg's & optional's args to nil. Just doing it, #debug purpose
(defadvice kill-whole-line (around screwdriver-kill-wl (&optional arg))
(setq arg nil)
(message "disable kill-whole-line"))
(defadvice kill-rectangle (around screwdriver-kill-rectangle (start end &optional fill))
(setq start nil)
(setq end nil)
(message "disable kill-rectangle"))
@sriramster
sriramster / colorcodes.sh
Last active November 1, 2020 15:07
Bash color codes
#Black 0;30 Dark Gray 1;30
#Red 0;31 Light Red 1;31
#Green 0;32 Light Green 1;32
#Brown/Orange 0;33 Yellow 1;33
#Blue 0;34 Light Blue 1;34
#Purple 0;35 Light Purple 1;35
#Cyan 0;36 Light Cyan 1;36
#Light Gray 0;37 White 1;37
#No color 0;
#!/bin/bash
@sriramster
sriramster / ci.md
Last active October 27, 2015 07:01
CI configuration notes
@sriramster
sriramster / git_stuffs.md
Last active November 1, 2020 15:07
git flow

Git stuffs

Some basic commands. Ignore if you are already familiar with these stuffs.

Creating a new repo.

git init $PATH

Path needs to be empty or could have source files, except a .git folder.

Sriram Raghunathan

Projects

  • Visteon [Present]

    ** Currently working and leading a team on the development of Autonomous Framework from Bangalore. ** Ported DM-verity to one of the car embedded stacks, developed the file system manager to handle verity partitions. ** Enabled secure signing features on u-boot and ported the same onto ARM targets.

Rosbag2 Transactions v0.1

Sqlite transaction based querying model.

Things to take care off

  • Rosbag2 sqlite plugin does'nt work based on sqlite transactions.
  • To enable optimized querying or writes within sqlite transactions are the best options.

Some URL references on transactions are below:

#include <stdio.h>
#define CHAR_BIT 8
int min(int x, int y)
{
return y ^ ((x ^ y) & -(x < y)); // min(x, y)
}
int max(int x, int y)
@sriramster
sriramster / process_fork.c
Created February 16, 2021 05:46
Sys call experiments
#include <dirent.h>
#include <error.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <signal.h>
#include <stdlib.h>
#include <time.h>