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/sh | |
# This script creates daily backups of the root and user's bash history file. This backup | |
# is non-destructive. | |
# Typical usage in a bash profile: | |
# | |
# Forked from https://lukas.zapletalovi.com/2013/03/never-lost-your-bash-history-again.html | |
# | |
# How many lines do you want to save? | |
KEEP=1000 |
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 | |
HDDS="/dev/sda /dev/sdb /dev/sdc" | |
HDT=/usr/sbin/hddtemp | |
LOG=/usr/bin/logger | |
DOWN=/sbin/shutdown | |
ALERT_LEVEL=55 | |
for disk in $HDDS | |
do | |
if [ -b $disk ]; then | |
HDTEMP=$($HDT $disk | awk '{ print $4}' | awk -F '°' '{ print $1}') |
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/sh | |
#February 09, 2008 Vincent Danen | |
usage() { | |
echo "${0} -w [warn] -c [crit] [drives]" | |
} | |
if [ "${1}" == "-h" -o "${1}" == "--help" ]; then | |
usage | |
exit 0 |
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 | |
# Use this to pull in up to 5 weather stations and grep the temp reading from them. Average only the ones | |
# that you get dater back from and then dump that to a file. Use Conky to read it or dump it to a db | |
# | |
#Change the station id's to valid stations in your area | |
wAvg=0 | |
wSum=0 | |
n=0 | |
weatherA=0 |
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 | |
#using: awk '{print $1/1000 * 1.8 + 32}' /sys/class/thermal/thermal_zone0/temp | |
CPUSOURCE=`cat /sys/class/thermal/thermal_zone0/temp` | |
GPUSOURCE=`vcgencmd measure_temp | cut -c 6-9` | |
CPUCALC=`expr $CPUSOURCE / 1000` | |
CPU=`echo “scale=2;((9/5) * $CPUCALC ) + 32”| bc` | |
GPU=`echo “scale=2;((9/5) * $GPUSOURCE ) + 32”| bc` | |
#Or use |
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 a backup: | |
cp /etc/rc.local /etc/rc.local.bac | |
#Edit: | |
nano /etc/rc.local | |
#Add following lines before "exit 0 ": |
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
Function cleanPhoneNumber(thisNumber As String) As String | |
' this function aspires to clean any phone number format | |
' to standard format (+9999) 999-999-9999 or 999-999-9999 | |
' works with almost all phone number formats stored in text | |
Dim retNumber As String | |
For i = 1 To Len(thisNumber) | |
If Asc(Mid(thisNumber, i, 1)) >= Asc("0") And Asc(Mid(thisNumber, i, 1)) <= Asc("9") Then | |
retNumber = retNumber + Mid(thisNumber, i, 1) |
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
=LEFT(CONCATENATE("+1(",SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE((SUBSTITUTE(C2,"(","")),")","")," ",""),"-",""),".",""),"x",";ext=")),6) |
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
=CONCATENATE("+1",SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE((SUBSTITUTE(C2,"(","")),")","")," ",""),"-",""),".",""),"x",";ext=")) | |
Adds leading parenthesis | |
=CONCATENATE("+1(",SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE((SUBSTITUTE(C2,"(","")),")","")," ",""),"-",""),".",""),"x",";ext=")) |
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
last.first | |
=LOWER(IF(LEN(A12)=0,"",IF(ISERR(FIND(" ",A12)),A12,LEFT(A12,FIND(" ",A12)-2)))&"."&MID(A12,SEARCH(", ",A12)+2, SEARCH(" ",MID(A12&" ", SEARCH(", ",A12)+4,200))+1))))) | |
first.last | |
=LOWER(MID(A14,SEARCH(", ",A14)+2, SEARCH(" ",MID(A14&" ", SEARCH(", ",A14)+4,200))+1)&"."&IF(LEN(A14)=0,"",IF(ISERR(FIND(" ",A14)),A14,LEFT(A14,FIND(" ",A14)-2)))) |
OlderNewer