Skip to content

Instantly share code, notes, and snippets.

@ovidiucs
ovidiucs / example.kshrc
Created May 9, 2020 19:45 — forked from Head-on-a-Stick/example.kshrc
Sample .kshrc
# This file contains examples of some of the things you may want to
# include in a user startup file.
# handle bash/zsh SHLVL variable
(( SHLVL++ ))
# skip this setup for non-interactive shells
[[ -o interactive && -t 0 ]] || return
# disable core dumps
@ovidiucs
ovidiucs / source-template.c
Created December 15, 2019 12:57 — forked from peisenhower/source-template.c
C source file template. Code groupings and doxygen header.
/**
* @file [file name].c
* @authors [author]
* @copyright [copy write holder]
*
* @brief [description]
*/
/*******************************************************************************
* Includes
*******************************************************************************/
type # concepts
BasicValue[T] = concept v
v.value is T
MinValue[T] = concept v
v is BasicValue[T]
v.min is T
MaxValue[T] = concept v
v is BasicValue[T]
v.max is T
@ovidiucs
ovidiucs / email-when-disk-is-below-limit.sh
Created October 4, 2012 18:49 — forked from scorpio2k2/gist:3835412
Send email to when disk is below a limit
#!/bin/sh
#The limit is 30% now
limit=10
mail=contact@debian-tutorials.com
tmp_file=/tmp/diskusage
hostname=`hostname`
#Now the script will calculate the current disk usage
disk=$(df -h | awk 'FNR == 2 {print $5}' | sed 's/%//')