Skip to content

Instantly share code, notes, and snippets.

@ticchen
ticchen / Makefile
Created July 7, 2020 04:14
Makefile to help install flex server
INSTALL_DIR=/usr/local/flexlm/licenses
#get hostname from license file
licensed_hostname=$(shell cat license.dat | grep ^SERVER | awk '{print $$2}')
licensed_macaddr=$(shell cat license.dat | grep ^SERVER | awk '{print $$3}' | sed -e 's/../\0:/g' -e 's/:$$//' )
help:
# Usage:
# make install # install license server
# make uninstall # uninstall license server
@ticchen
ticchen / hex_decimal_binary_coverter.sh
Created January 4, 2017 02:44
binary decimal hex coverter
################################
# generic
################################
bindechex()
{
if [ "$#" -le "1" ]; then
echo -e "Usage:\n\tbindechex <base:2/10/16> <val> ..." 2>/dev/null
return
fi
void create_new_cofg(char *usr_conf, char *def_conf)
{
int done = 0;
FILE *usr_fp = NULL, *def_fp = NULL, *temp_fp = NULL;
char buf[CONFIG_BUFFER] = {0};
//get currect sep by config name
char *fname = get_fname(usr_conf);
char *sep = find_file_sep(fname);
@ticchen
ticchen / buildroot.config
Created February 22, 2016 09:15
buildroot config for gcc 4.9.3
#
# Automatically generated file; DO NOT EDIT.
# Buildroot 2015.11.1 Configuration
#
BR2_HAVE_DOT_CONFIG=y
#
# Target options
#
BR2_SOFT_FLOAT=y
@ticchen
ticchen / gcd
Last active December 8, 2021 01:21
gcd: it's "cd" command for git. It would change working directory based on git top directory.
#!/bin/bash
#
# gcd: It's "cd" command based on git top directory.
# It support fallback mode when current directory is no in a git repo.
# In fallback mode, it works as like as "cd" command.
#
# How to Use:
# enable gcd command by source this file in your ".bash_aliases" or ".bashrc".
# . gcd
# -- OR --