Skip to content

Instantly share code, notes, and snippets.

View btihen's full-sized avatar

Bill Tihen btihen

  • Switzerland
View GitHub Profile
@btihen
btihen / baseos.sh
Created May 30, 2013 14:52
baseos config
sudo launchctl load -w /System/Library/LaunchDeamons/com.apple.locate.plist
sudo /usr/sbin/scutil --set HostName baseos
sudo /usr/sbin/scutil --set ComputerName baseos
sudo /usr/sbin/scutil --set LocalHostName baseos
sudo /usr/sbin/networksetup -setcomputername baseos
defaults write com.apple.finder ShowHardDrivesOnDesktop TRUE
killall Finder
# install XCode from the app store
# updates by Elliot -- https://gist.github.com/MittchoBaroco/bf6516e4b03ba6803808f046084feb4d
#
# Install xcode cmdline tools
sudo xcodebuild -license
sudo xcode-select --install
#
# NOTICE
# brew 'rbenv-gem-rehash' is DEPRECATED
@btihen
btihen / gist:9327698
Created March 3, 2014 15:45
Brew Management
brew doctor
brew update
brew upgrade
brew cleanup
@btihen
btihen / gist:9327773
Last active August 29, 2015 13:56
MacOSX 10.9.2 upgrade fix
sudo diskutil repairPermissions /
sudo softwareupdate -dia
sudo diskutil repairPermissions /
sudo reboot
@btihen
btihen / gist:9714335
Last active August 29, 2015 13:57
.vimrc
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
cat <<EOF >> .vimrc
set tabstop=2 shiftwidth=2 expandtab
:set invlist
set listchars=eol:¬,tab:->,trail:~,extends:>,precedes:<
:set list
@btihen
btihen / gist:10048345
Last active August 29, 2015 13:58
Inventory DB updates
USE inventory;
#ALTER TABLE computers ADD fleet_id INT(11) AFTER id;
#UPDATE computers SET fleet_id=date_made WHERE date_made REGEXP '^-?[0-9]+$';
#SELECT fleet_id FROM computers;
ALTER TABLE computers ADD fleetid TEXT AFTER id;
UPDATE computers SET fleetid=fleet_id;
#ALTER TABLE computers DROP fleet_id;
@btihen
btihen / gist:11363359
Last active August 29, 2015 14:00
Retire via DB
use inventory;
UPDATE computers SET status='Retired' WHERE id='96';
UPDATE computers SET status='Retired' WHERE id='104';
UPDATE computers SET status='Retired' WHERE id='108';
UPDATE computers SET status='Retired' WHERE id='119';
UPDATE computers SET status='Retired' WHERE id='181';
UPDATE computers SET status='Retired' WHERE id='187';
@btihen
btihen / gist:f2cef87050bc29a83d2d
Last active August 29, 2015 14:02
Return Analysis - needs colors, line graph (box plots too)
----------------
# returns analysis
# Start in Bash
# METHOD 1
curl -k https://inventory.las.ch/serial.csv?scope=computers > laptop-inventory.csv
cat laptop-inventory.csv | cut -d';' -f44 | grep 2014 | cut -d'"' -f2 > return-data.csv
@btihen
btihen / gist:745aef5c2b3fedf6955a
Last active August 29, 2015 14:02
Utilization Analysis
# returns analysis
# Utilization
# Bash
echo "count day hour techs" > util-by-hr.csv
cat laptop-inventory.csv | cut -d';' -f44 | grep 2014 | cut -d'"' -f2 | sed 's/:[0-9][0-9]:[0-9][0-9]$/:00/g' | grep '2014-05' | sed 's/2014-05-//g' | grep '2[0-9]' | sort | uniq -c | awk ' {print $1, $2, $3, 1}' >> util-by-hr.csv
echo "count day time techs" > util-by-10min.csv