Skip to content

Instantly share code, notes, and snippets.

View dvtalk's full-sized avatar
🎯
Focusing

dvtalk dvtalk

🎯
Focusing
View GitHub Profile
"
"
" ███████████████████████████
" ███████▀▀▀░░░░░░░▀▀▀███████
" ████▀░░░░░░░░░░░░░░░░░▀████
" ███│░░░░░░░░░░░░░░░░░░░│███
" ██▌│░░░░░░░░░░░░░░░░░░░│▐██
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH="/home/hungvn/local/bin:$PATH"
# Path to your oh-my-zsh installation.
export ZSH="/home/hungvn/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
"
" ███████████████████████████
" ███████▀▀▀░░░░░░░▀▀▀███████
" ████▀░░░░░░░░░░░░░░░░░▀████
" ███│░░░░░░░░░░░░░░░░░░░│███
" ██▌│░░░░░░░░░░░░░░░░░░░│▐██
" ██░└┐░░░░░░░░░░░░░░░░░┌┘░██
" ██░░└┐░░░░░░░░░░░░░░░┌┘░░██
" ██░░┌┘▄▄▄▄▄░░░░░▄▄▄▄▄└┐░░██
" ██▌░│██████▌░░░▐██████│░▐██
#set-environment -g PATH ""
set -g prefix M-Space
set-window-option -g mode-keys vi
set -g default-terminal "xterm-256color"
set-window-option -g aggressive-resize on
setw -g window-status-activity-style none
setw -g window-status-bell-style none
set-option -g status-position top
#!/bin/bash
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
for fgbg in 38 48 ; do # Foreground / Background
for color in {0..255} ; do # Colors
@dvtalk
dvtalk / vimsend.zsh
Last active August 15, 2020 04:38
Use when inside vim terminal, zsh function to send file from vim terminal to open in current vim.
function vimsend() {
local path=""
if [ -e ./$1 ]; then
path="$PWD/${1}"
echo "$path"
elif [ -e $1 ]; then
path=$1
echo "$path"
else
echo "Oops, file not found yo!! $1"
@dvtalk
dvtalk / vimsend.sh
Last active January 24, 2021 14:19
Use when inside vim terminal, sh script to send file from vim terminal to open in current vim.
#!/bin/sh
pathdir="$( pwd )"
if [ -e ./$1 ]; then
pathdir="${pathdir}/${1}"
elif [ -e $1 ]; then
pathdir=$1
else
pathdir="${pathdir}/${1}"
fi
@dvtalk
dvtalk / sv_convert2string_vs_do_print.sv
Last active May 30, 2022 08:05
Example of using UVM convert2string() and do_print();
// https://dvtalk.me
// Example of using UVM convert2string() and do_print();
//
// convert2string() prints only the variables information
// do_print() adds decorative information for log file
//
// Especially useful when extending base class and adding new variables
//
class aes_data;
@dvtalk
dvtalk / perf_min_max_avg.csh
Last active June 6, 2022 02:56
example csh script for filtering, get average, max, min value of a input log file
#!/bin/csh
##############################
#Usage: perf_min_max_avg.csh perf_log.csv
#Usage: unit is ps
# example log of perf_log.csv is as below
# ip, loop_idx, obj_id, start_time, end_time, processing_time
# UART, 1, 577694555, 387336768.000 ps, 390426774.000 ps, 3090006.000 ps,
# UART, 2, 1477172896, 390792775.000 ps, 405858805.000 ps, 15066030.000 ps,
# UART, 3, 2120155115, 406414806.000 ps, 407434808.000 ps, 1020002.000 ps,
@dvtalk
dvtalk / openssl_sha.c
Last active June 6, 2022 02:57
Sha hash function operation using OpenSSL library
// https://dvtalk.me
#ifndef __SHA_HASH_C__
#define __SHA_HASH_C__
#include <openssl/conf.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>