passwd # change "chip" account's password
sudo passwd -l root # lock the root account from direct login
sudo sed -i.old /etc/ssh/sshd_config -e'/PermitRootLogin/s/yes/no/' # configure sshd to not allow root
sudo service ssh restart
This file contains 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
# list files, grab the file name, and print only up to the first underscore | |
# example: W555666777_19761028_30.xml | |
ll | awk {'print $9'} | awk -F_ {'print $1'} | uniq | awk -F. {'print $1'} | uniq | grep '^W' |
This file contains 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
class GildedRose | |
attr_accessor :items | |
def initialize(items) | |
@items = items | |
end | |
def update_quality | |
end | |
end |
This file contains 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
function Yatzy(dice) { | |
const callDirectory = { | |
ones: 1, | |
twos: 2, | |
threes: 3, | |
fours: 4, | |
fives: 5, | |
sixes: 6 | |
} | |
const sum = function(dice, num) { |
This file contains 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
module DecimalRebase | |
# Breaks the decimal down into increments of the difference of the increment and the base number until the result is zero | |
# The resulting increments are accumulated and when the rebased value reaches zero, their modulos are mapped, reversed, and converted | |
# | |
# Example: | |
# value: 75 converted to base: 8 | |
# rebase(75, 8) | |
# 75 / 8 = 9 => rebase(9, 8, [75]) | |
# 9 / 8 = 1 => rebase(1, 8, [75,9]) | |
# 1 / 8 = 0 => rebase(0, 8, [75,9,1] |
This file contains 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
sudo killall VDCAssistant |
This file contains 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
=FILTER(QUERY('DATA IMPORT'!$A:$C, "select A,C"), EQ('DATA IMPORT'!$B:$B, "Value-To-Filter-Against")) |
This file contains 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
SmallThings::Application.routes.draw do | |
namespace :core do | |
resources :things, param: :name, only: [:create, :show] do | |
member do | |
resource :component, only: :create, module: :things, as: :things_component | |
end | |
end | |
end | |
end |