Skip to content

Instantly share code, notes, and snippets.

View SebastianCarroll's full-sized avatar

Sebastian Carroll SebastianCarroll

View GitHub Profile
# Install Git
# sudo yum -y install git
# Git
git config --global user.name "Sebastian Carroll"
git config --global user.email "[email protected]"
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
HW13195:receipts2_ok scarroll$ open -a Preview DSC_0310_converted.JPG
The application /Applications/Preview.app cannot be opened because its executable is missing.
HW13195:receipts2_ok scarroll$ /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f /Applications/Preview.app
HW13195:receipts2_ok scarroll$ open -a Preview DSC_0310_converted.JPG
## Ok now
#!/bin/sh -
if [ "$(id -ru)" != 0 ]; then
printf >&2 'Error: this installer needs the ability to run commands as root.\n'
printf >&2 'Install as root or with sudo\n'
exit 1
fi
my_disable_thp() {
( cat > /usr/local/sbin/ambari-thp-disable.sh <<-'EOF'
@SebastianCarroll
SebastianCarroll / clear_hadoop_logs.sh
Created October 14, 2016 17:40
Simple script to clear hadoop logs from a cluster. Not an amazing solution to the problem
#!/bin/bash
HOSTS="host1 host2 host3 host4"
RETENTION_TIME=14
echo "$(date) - Log Cleaner - $RETENTION_TIME days - $HOSTS" >> /var/log/hadoop_log_cleaner.log
for host in $HOSTS
do
ssh root@$host << ENDSSH
@SebastianCarroll
SebastianCarroll / vim-shortcuts
Created October 31, 2016 09:40
List of vim shortcuts
Spelling:
]s — move to the next mispelled word
[s — move to the previous mispelled word
zg — add a word to the dictionary
zug — undo the addition of a word to the dictionary
z= — view spelling suggestions for a mispelled word
rvm docs generate
@SebastianCarroll
SebastianCarroll / atom_highlight
Last active July 24, 2017 08:34
Highlightine in Atom (change to make it easier to see)
The highlighting on Atom is pretty bad and hard to see when using find replace. Change it by 'Atom -> Styleshee' and adding:
atom-text-editor::shadow .highlight {
&.find-result .region,
&.current-result .region,
&.current-result ~ .highlight.selection .region {
z-index: -1;
}
&.find-result .region {
background: yellow;