Skip to content

Instantly share code, notes, and snippets.

View thewellington's full-sized avatar

W. S. Wellington thewellington

View GitHub Profile
@thewellington
thewellington / start-the-day.sh
Last active November 10, 2016 12:01
This is a simple script I use to start my day in OS X
#!/bin/bash
#
# start-the-day.sh
# I use this script to start all the programs I need to "start my day"
#
# v1.7 2013-01-12 by bill@wellingtonnet.net
source ~/bin/switch.sh
open -a "TotalTerminal" -F -g
@thewellington
thewellington / log
Created September 27, 2013 22:33
I use this script to log everything I do throughout the day
#!/usr/bin/env python
# myLogger.py by bill@wellingtonnet.net - 2012-11-14
# This module takes additional commandline arguments, concatenates them into a
# string, and then appends that string to a defined output file.
#
# Intended to be an easy to access work log for all things that I have completed
#
# import necessary modules
@thewellington
thewellington / flushdns
Last active January 18, 2023 02:10
Flush DNS in OS X
#!/bin/bash
#
# flushdns
# This script will flush your DNS cache on Mac OS X 10.1 - 13.x
# The method for doing this chages it seems in every version of OS X,
# and I can never remember the correct command, so I wrote this script
# and gave it a name I could remeber.
#
# v.2022-11-03 by bill@wellingtonnet.net
# https://gist.github.com/thewellington/6736175
@thewellington
thewellington / upload-my-key.sh
Created September 27, 2013 22:36
I use this to upload my key to servers
#!/bin/sh
# KEY="$HOME/.ssh/id_dsa.pub"
KEY="$HOME/.ssh/id_rsa.pub"
if [ ! -f ~/.ssh/id_rsa.pub ];then
echo "private key not found at $KEY"
echo "* please create it with "ssh-keygen -t [rsa|dsa]" *"
echo "* to login to the remote host without a password, don't give the key you create with ssh-keygen a password! *"
exit
@thewellington
thewellington / upload-authorized-keys.sh
Last active December 24, 2015 03:19
Used to upload keys to specific accounts usage: upload-authorized-keys.sh shellacct@hostname /path/to/key.pub
#!/bin/sh
#
# upload-authorized-keys.sh
# by bill@wellingtonnet.net
#
# This script will take a key provided as an argument on the commandline and
# add it to the authorized_keys file on a remote server. It can be used to
# upload many keys in a short time, particularly once your key is already loaded.
#
# Usage: upload-authorized-keys.sh shellacct@hostname /path/to/local/copy/of/key.pub
@thewellington
thewellington / osx-welcome.sh
Last active December 24, 2015 03:19
After building an OS X image, start the mac at the welcome screenSo... I needed to deploy a number of macs to a great number of people... and they all needed to have an "out of box" experience with the machine whereby they set up their own account and all the happy stuff that Apple gives you when you take a Mac out of the box. This script allowe…
#!/bin/bash
#
# v.1.1 by bill@wellingtonnet.net
# adapted from instructions posted at
# http://www.macgurulounge.com/easily-prep-mac-resale/
#
# This script sets a Mac up to start at the welcome screen.
# It must be run from single user mode, so put it somewhere on
# the file system, make it executable, then reboot and hold down cmd-s
#
@thewellington
thewellington / no_password_expire.sql
Last active December 25, 2015 04:49
Oracle: Prevent password from expiring in the future
/* Set Oracle to prevent password form expiring */
alter profile default limit password_life_time unlimited;
@thewellington
thewellington / account_status.sql
Last active December 25, 2015 04:49
Oracle: Whose password have expired?
/* shows the account status of every user */
select username, account_status, expiry_date, sysdate, profile from dba_users;
/* shows the account status of a specific user */
select username, account_status, expiry_date, sysdate, profile from dba_users where username='username'
@thewellington
thewellington / mod_sysctl.sh
Created October 10, 2013 20:50
Modify sysctl.conf for Oracle
#!/bin/bash
#
# Change Linux kernel parameters prior to installing Oracle 11g R2 on RHEL 6.3
# v2.0 by bwellington@fulcrum.net 2012.11.20
#
f='/etc/sysctl.conf'
# Get Total Memory in KB
@thewellington
thewellington / oracle_iops.sql
Last active December 25, 2015 05:39
Get Oracle iops
select 'orcl', sample_hour, (rps+wps) IOPS
from (
with snaps as (
select hiof1.snap_id, sum(hiof1.value) reads, sum(hiof2.value) writes
from sys.WRH$_SYSSTAT HIOF1, sys.WRH$_SYSSTAT HIOF2
where HIOF1.stat_id in (select stat_id from v$statname where name like '%physical read total IO%')
and HIOF2.stat_id in (select stat_id from v$statname where name like '%physical write total IO%')
and HIOF1.snap_id=hiof2.snap_id
group by hiof1.snap_id
),