This file has been truncated, but you can view the full file.
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
Jan 11 01:54:31 ip-172-31-1-163 sshd[1106]: Server listening on 0.0.0.0 port 22. | |
Jan 11 01:54:31 ip-172-31-1-163 sshd[1106]: Server listening on :: port 22. | |
Jan 11 01:55:59 ip-172-31-1-163 sshd[1301]: Connection closed by 127.213.25.139 [preauth] | |
Jan 11 01:56:37 ip-172-31-1-163 sshd[1303]: Accepted publickey for ubuntu from 127.213.25.139 port 65087 ssh2: RSA 0a:78:92:3c:c8:27:13:d3:f7:ee:d5:ac:75:45:31:5c | |
Jan 11 01:56:37 ip-172-31-1-163 sshd[1303]: pam_unix(sshd:session): session opened for user ubuntu by (uid=0) | |
Jan 11 01:58:12 ip-172-31-1-163 sudo: ubuntu : TTY=pts/0 ; PWD=/var/log ; USER=root ; COMMAND=/usr/bin/apt-get update | |
Jan 11 01:58:12 ip-172-31-1-163 sudo: pam_unix(sudo:session): session opened for user root by ubuntu(uid=0) | |
Jan 11 01:58:18 ip-172-31-1-163 sudo: pam_unix(sudo:session): session closed for user root | |
Jan 11 01:59:05 ip-172-31-1-163 sudo: ubuntu : TTY=pts/0 ; PWD=/var/log ; USER=root ; COMMAND=/usr/bin/apt-get install unattended-upgrades | |
Jan 11 01:59:05 ip-172-31-1-163 sudo: pam_un |
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
FROM ruby:2.5.1-slim | |
RUN apt-get update && apt-get install -qq -y --no-install-recommends \ | |
build-essential \ | |
libsqlite3-dev \ | |
nodejs \ | |
sqlite3 \ | |
&& rm -rf /var/lib/apt/lists/* | |
RUN mkdir /app |
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
require 'rspec' | |
require 'json' | |
require 'pry' | |
def convert_json(json) | |
JSON.parse(json) | |
end | |
def evaluate_json(input) | |
key = input.keys.first |
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
# Fail2Ban configuration file. | |
# | |
# This file was composed for Debian systems from the original one | |
# provided now under /usr/share/doc/fail2ban/examples/jail.conf | |
# for additional examples. | |
# | |
# Comments: use '#' for comment lines and ';' for inline comments | |
# | |
# To avoid merges during upgrades DO NOT MODIFY THIS FILE | |
# and rather provide your changes in /etc/fail2ban/jail.local |
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
hardstatus alwayslastline | |
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]' | |
# Default screens | |
screen -t shell1 0 | |
screen -t shell2 1 | |
screen -t server 2 ssh me@myserver |
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
################### | |
# Prefix key setup | |
################### | |
set -g prefix C-a # remap prefix to Control + a --> i'm old that way. | |
# bind 'C-a C-a' to type 'C-a' | |
bind a send-prefix # send 'C-a' into terminal app by typing: 'C-a a' | |
bind C-a last-window # bounce between windows just by typing 'C-a C-a' | |
unbind C-b # get rid of C-b as prefix | |
######################## |
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
gem 'stripe', '1.31.0' | |
require 'stripe' | |
Stripe.api_key = <insert API key here> | |
token = Stripe::Token.create( | |
:card => { | |
:number => "4242424242424242", | |
:exp_month => 3, | |
:exp_year => 2017, | |
:cvc => "314" |
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
def refund | |
self.items | |
ActiveRecord::Base.transaction do | |
self.items.each { |i| i.update!(refund: true) } | |
end | |
end | |
def refund_v2 | |
refundable_items = self.items.where(refund: false) |
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
pg_restore: executing SEQUENCE SET key_configurations_id_seq | |
pg_restore: processing data for table "kiosk_scans" | |
out of memory |
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
def set_new_name_on_items? | |
success = ActiveRecord::Base.transaction do | |
model.items.each do |i| | |
i.name = 'new name' | |
i.save or raise ActiveRecord::Rollback | |
end | |
!!success | |
end |
NewerOlder