This file contains hidden or 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
| %matplotlib inline | |
| import time | |
| import os | |
| import glob | |
| import seaborn as sns | |
| import numpy as np | |
| import pandas as pd | |
| import matplotlib.pylab as plt | |
| from matplotlib import rcParams | |
| rcParams.update({'figure.autolayout': False}) |
This file contains hidden or 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 | |
| # Add an entry in your crontab to run this script on a timed interval | |
| logfile="/var/log/app_check.log" | |
| case "$(pidof app | wc -w)" in | |
| 0) echo "App found not running, (re)starting app: $(date)" >> $logfile | |
| DISPLAY=:0 /home/jdoe/app_script & |
This file contains hidden or 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
| #Pulls FIRST.LAST from a description field. Useful for Cisco phone description fields where the format is: LAST, FIRST XXXXX | |
| =IF(D2=0,"",SUBSTITUTE((TRIM(LOWER(RIGHT(LEFT(D2,(LEN(D2)-6)),LEN(LEFT(D2,(LEN(D2)-6)))-FIND(", ",LEFT(D2,(LEN(D2)-6)),1)))&"."&(LOWER(LEFT(LEFT(D2,(LEN(D2)-6)),FIND(", ",D2,1)-1)))))," csf","")) | |
| #Lower Case version | |
| =LOWER(MID(A2,SEARCH(", ",A2)+2, SEARCH(" ",MID(A2&" ", SEARCH(", ",A2)+4,200))+1)&"."&IF(LEN(A2)=0,"",IF(ISERR(FIND(" ",A2)),A2,LEFT(A2,FIND(" ",A2)-2)))) |
This file contains hidden or 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
| =IF(A2=0,"",IFERROR(INDEX(EIDDBXXHR!$D:$D,MATCH(A2,EIDDB!D:D,0)),"X")) |
This file contains hidden or 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
| =IF(A2=0,"",IFERROR(INDEX(EIDDB!$A:$A,MATCH(A2,EIDDB!D:D,0)),"-")) |
This file contains hidden or 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
| =IF(A2=0, "", EXACT(UPPER(A2),A2)) |
This file contains hidden or 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
| Sub Refresh() | |
| ' THE FOLLOWING CODE ALL DUE TO EXCEL 2013 BUG ... force the window to shrink and restore back to get the ribbon etc painted correctly... | |
| wk_Curr_Window_State = Application.WindowState | |
| wk_Curr_Window_Width = Application.Width | |
| wk_Curr_Window_Height = Application.Height | |
| Application.WindowState = xlNormal 'Collapse the excel window | |
| Application.Width = 225 ' make the window really small to force Excel rethink ribbon content ... | |
| Application.Height = 271.5 ' both vertically and horizontally | |
| ' now restore the original window settings | |
| Application.Width = wk_Curr_Window_Width |
This file contains hidden or 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
| Sub Auto_Close() | |
| ThisWorkbook.Saved = True | |
| End Sub |
This file contains hidden or 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
| Option Explicit | |
| Sub CLEARDATA() | |
| On Error GoTo ErrHandler | |
| Dim arrSHEETS As Variant | |
| Dim wsheets As Variant | |
| arrSHEETS = Split("Alpha,Bravo,Charlie,Delta,Echo,Foxtrot,Golf,Hotel", ",") | |
This file contains hidden or 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
| # Useful for purging security camera folders | |
| # 1 0 * * * = Run at 12:01a every day | |
| # -name '2018*' just means - find all folders that start with 2018 | |
| # -type d = folders | |
| # -mtime +20 = modified 20 days ago | |
| 1 0 * * * /bin/find /home -maxdepth 3 -name '2018*' -type d -mtime +20 -exec rm -rf {} \; -print >> /root/purge.log |