This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash - | |
########################## DEFINE GLOBALS ############################## | |
PROGRAM="${0##*/}" # Program name | |
HOLE="." # Hole for peg | |
PEG="o" # Peg token | |
MOVE=0 # Move counter | |
BO=$(tput smso) # Bold on | |
LD=$(tput rmso) # Bold off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash - | |
which mediainfo >/dev/null || { | |
echo mediainfo is not installed | |
exit 1 | |
} | |
[ $# -eq 0 ] && set -- * | |
for i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash - | |
ram_info=/proc/meminfo | |
total_ram=$(bc <<< "scale=2; $(cat $ram_info | grep MemTotal | tr -d a-zA-Z:)/1024/1024") | |
free_ram=$(bc <<< "scale=2; $(cat $ram_info | grep MemFree | tr -d a-zA-Z:)/1024/1024") | |
used_ram=$(bc <<< "$total_ram-$free_ram") | |
echo "Total Ram: $total_ram G" | |
echo "Free Ram: $free_ram G" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash - | |
PROGRAM="${0##*/}" | |
IFS="." | |
for i in $(cat /proc/uptime) | |
do | |
UPTIME=$i | |
break | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bc -q | |
# | |
# PURPOSE: This script calculates sine, cosine and tangent using | |
# the Taylor series. | |
scale=6 | |
pi = 3.14159265358979323844 | |
define factorial(a) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash - | |
short_weekdays=$(locale -c LC_TIME | sed -n '2p') | |
long_weekdays=$(locale -c LC_TIME | sed -n '3p') | |
short_months=$(locale -c LC_TIME | sed -n '4p') | |
long_months=$(locale -c LC_TIME | sed -n '5p') | |
unset gweek_header | |
unset jweek_header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### make loopback filesystem | |
exit | |
# must be superuser | |
sudo su | |
# write file.img - 10M | |
dd if=/dev/zero of=file.img bs=10M count=1 | |
# make ext4 filesystem with file.img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash - | |
# | |
# PROGRAM: fl | |
# AUTHOR: Luciano D. Cecere | |
# | |
# This program is a wrapper for egrep to find BASH | |
# functions in files. | |
# | |
# This program searchs only functions in the style of: | |
# myfunc() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{_main} {lcal} {104} | |
{_is_year_valid} {lcal} {417} | |
{_is_month_valid} {lcal} {433} | |
{_is_day_valid} {lcal} {444} | |
{_is_date_valid} {lcal} {459} | |
{_parse_month} {lcal} {526} | |
{_month_len} {lcal} {549} | |
{_is_leap} {lcal} {572} | |
{_day_of_week} {lcal} {585} | |
{_gregorian_array} {lcal} {603} |
OlderNewer