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
INFO global: Vagrant version: 1.8.1 | |
INFO global: Ruby version: 2.2.3 | |
INFO global: RubyGems version: 2.4.5.1 | |
INFO global: VAGRANT_OLD_ENV_SSH_TTY="/dev/ttys000" | |
INFO global: VAGRANT_OLD_ENV_MAIL="/var/mail/vagrant" | |
INFO global: VAGRANT_OLD_ENV_PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" | |
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded" | |
INFO global: VAGRANT_OLD_ENV_SSH_CONNECTION="192.168.2.1 60992 192.168.2.133 22" | |
INFO global: VAGRANT_OLD_ENV_SSH_CLIENT="192.168.2.1 60992 22" | |
INFO global: VAGRANT_OLD_ENV_OLDPWD="/Users/vagrant" |
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
# Remove trailing whitespace | |
find . -not \( -name .git -prune \) -type f -print0 | LC_ALL=C xargs -0 sed -i '' -E "s/[[:blank:]]+$//" | |
# Add newline @ eof if missing | |
find . -type f -print0 | LC_ALL=C xargs -0 sed -i -e '$a\' file | |
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
# When you want the original versions of files during a rebase | |
git status | awk '/(both added|both modified):/ { | |
sub(/(both added|both modified):/, ""); print $1 | |
}' | xargs -n1 git checkout $(git show | awk ' /commit/ { print $2 }') | |
# When you don't want files added during a rebase | |
git status | awk '/added by them:/ { | |
sub(/added by them:/, ""); print $1 | |
}' | xargs -n1 git rm |
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
import math | |
def update(partial, total): | |
measurement_heuristic = int(math.floor(math.log10(total)) - 1)/3 | |
unit, divisor = { | |
0: ('B', 1), | |
1: ('kB', 1000), | |
2: ('MB', 1e6), | |
3: ('GB', 1e9), | |
4: ('TB', 1e12) |
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
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key | |
# that enables you to choose a character from a menu of options. If you are on Lion | |
# try it by pressing and holding down 'e' in any app that uses the default NSTextField | |
# for input. | |
# | |
# It's a nice feature and continues the blending of Mac OS X and iOS features. However, | |
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode, | |
# as it means you cannot press and hold h/j/k/l to move through your file. You have | |
# to repeatedly press the keys to navigate. |
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
CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install -v 3.4.3 |
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
CFLAGS="-I$(xcrun --show-sdk-path)/usr/include -I$(brew --prefix openssl)/include" LDFLAGS="-L$(brew --prefix openssl)/lib" pyenv install 3.4.3 |
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
# Show hidden files | |
defaults write -g AppleShowAllFiles -bool true | |
killall Finder | |
# Hide desktop | |
defaults write com.apple.finder CreateDesktop false | |
killall Finder |
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
# discover what programs are still connected to a db | |
select sid,serial#,program from v$session where username = '<your_schema>'; | |
# and forcibly disconnect them | |
select 'alter system kill session ''' || sid || ',' || serial# || ''';' from v$session where username = '<your_schema>' | |
#Shutdown and restart cdb and pdb | |
shutdown; | |
#then | |
startup; |
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
split_path = path.split('/') | |
split_path.each_with_index.map do | _, index | | |
# Reconstruct each path that makes up the target path and ensure they are created | |
partial_path = ::File.join split_path.slice(0, index + 1) | |
next if partial_path == '' | |
directory partial_path do | |
owner node[:oracle][:database][:install_user] | |
group node[:oracle][:database][:install_group] | |
mode 0775 | |
end |
NewerOlder