Skip to content

Instantly share code, notes, and snippets.

Failures:
1) Admin::PresalesController#show redirects if not logged in
Failure/Error: get :show, id: Presale.last.id

systemd

systemd is a proocess management solution to manage running processes (daemons) on *nix based systems. It is used to set what services run in the background, how they start up, what resources they have access to and more.

These daemons are controlled via .service files. We can look at the easel-driver systemd file at https://github.com/inventables/iris/blob/master/build/linux/easel-driver.service to see an example. Service files live in /etc/systemd/system or /etc/systemd/user folders and this is where we put easel-driver into https://github.com/inventables/iris/blob/7f1c7bf96a59d46f030b3b3b3d32a1df5797d918/build/ci_build_linux.sh#L12 To control deamons we use systemctl utility https://github.com/inventables/iris/blob/7f1c7bf96a59d46f030b3b3b3d32a1df5797d918/build/linux/DEBIAN/postinst#L30

# on a local *nix box
sudo systemctl status easel-driver
#
# systemd unit file for CentOS 7, Ubuntu 15.04
#
# Customize this file based on your bundler location, app directory, etc.
# Put this in /usr/lib/systemd/system (CentOS) or /lib/systemd/system (Ubuntu).
# Run:
# - systemctl enable sidekiq
# - systemctl {start,stop,restart} sidekiq
#
# This file corresponds to a single Sidekiq process. Add multiple copies
@kmarcisz
kmarcisz / gist:d2f442c2476d89ae2f602869e72947ae
Created September 11, 2019 18:57
Sidekick systemd file
#
# systemd unit file for CentOS 7, Ubuntu 15.04
#
# Customize this file based on your bundler location, app directory, etc.
# Put this in /usr/lib/systemd/system (CentOS) or /lib/systemd/system (Ubuntu).
# Run:
# - systemctl enable sidekiq
# - systemctl {start,stop,restart} sidekiq
#
# This file corresponds to a single Sidekiq process. Add multiple copies
# /etc/init/sidekiq.conf - Sidekiq config
# This example config should work with Ubuntu 12.04+. It
# allows you to manage multiple Sidekiq instances with
# Upstart, Ubuntu's native service management tool.
#
# See workers.conf for how to manage all Sidekiq instances at once.
#
# Save this config as /etc/init/sidekiq.conf then manage sidekiq with:
# sudo start sidekiq index=0
@kmarcisz
kmarcisz / fbolt-mysql-5.6-upgrade.md
Last active September 20, 2019 20:41
mysql 5.6 upgrade

Note that all commands should be run locally unless otherwise noted.

Take a database snapshot

aws rds create-db-snapshot \
    --db-snapshot-identifier fbolt-mysql-56-upgrade \
    --db-instance-identifier fbolt-production

Email fulltime@invetnables.com that maintenance is about to start.

@kmarcisz
kmarcisz / gist:dfbff762a6157a404468359813d5f383
Created August 13, 2019 15:52
fbolt-production mysql upgrade (5.6)
Note that all commands should be run locally unless otherwise noted.
Take a database snapshot
```
aws rds create-db-snapshot \
--db-snapshot-identifier fbolt-mysql-56-upgrade \
--db-instance-identifier fbolt-production
```
Turn maintenance mode on on Fbolt
// http://[old-solr-domain-and-port]/solr/select?q=instant&fq=type%3ATechnology&fl=*+score&wt=json&indent=true&defType=edismax&qf=name_texts+description_text+teaser_text+patent_info_text+origin_skus_text+category_names_text+sample_skus_text&stopwords=true&lowercaseOperators=true
{
"responseHeader":{
"status":0,
"QTime":1,
"params":{
"lowercaseOperators":"true",
"indent":"true",
"qf":"name_texts description_text teaser_text patent_info_text origin_skus_text category_names_text sample_skus_text",
// http://[new-solr-domain-and-port]/solr/staging/select?q=instant&fq=type%3ATechnology&fl=*+score&wt=json&indent=true&defType=edismax&qf=name_texts+description_text+teaser_text+patent_info_text+origin_skus_text+category_names_text+sample_skus_text&stopwords=true&lowercaseOperators=true
{
"responseHeader":{
"status":0,
"QTime":1},
"response":{"numFound":52,"start":0,"maxScore":226.24033,"docs":[
{
"id":"Technology 19927",
"name_texts":["Instant Cappuccino"],
@kmarcisz
kmarcisz / gist:3db8b16b03c64ad23a64a407a9c3b2aa
Created June 17, 2019 15:23
Current rails-4 rspec failures (2019-06-17)
Failures:
1) Admin::ShipmentsController rates uses the shipments factory to get a result
Failure/Error: get :rates, web_params
ActionController::UnknownFormat:
ActionController::UnknownFormat
# ./app/controllers/admin/shipments_controller.rb:100:in `rates'
# ./spec/controllers/admin/shipments_controller_spec.rb:50:in `block (3 levels) in <top (required)>'
2) Api::V1::EaselProProductKeysController POST #activate should activate a valid product_key