Skip to content

Instantly share code, notes, and snippets.

View hmasila's full-sized avatar
🚀
T-minus ...

Hannah Masila hmasila

🚀
T-minus ...
View GitHub Profile
@hmasila
hmasila / ubuntu.md
Last active September 12, 2024 19:15

Create deploy user

$ sudo adduser deploy

Privileges

Sudoer

add "deploy" user to sudo group if you want deploy to be a sudoer

$ sudo usermod -aG sudo deploy

@hmasila
hmasila / sidekiq.service.md
Last active September 14, 2023 14:39
Sidekiq.service for production deployment

$ sudo vim /lib/systemd/system/sidekiq.service

#
# This file tells systemd how to run Sidekiq as a 24/7 long-running daemon.
#
# Customize this file based on your bundler location, app directory, etc.
# Customize and copy this into /usr/lib/systemd/system (CentOS) or /lib/systemd/system (Ubuntu).
# Then run:
#   - systemctl enable sidekiq

Install nginx

$ sudo apt-get install nginx

$ sudo apt-get install -y dirmngr gnupg apt-transport-https ca-certificates curl

$ curl https://oss-binaries.phusionpassenger.com/auto-software-signing-gpg-key.txt | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/phusion.gpg >/dev/null

Add APT repository

$ sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger jammy main > /etc/apt/sources.list.d/passenger.list'

@hmasila
hmasila / sets.py
Created November 20, 2017 20:10
sets created by andela_hmasila - https://repl.it/@andela_hmasila/sets
# Sets revisited in python
def union(list1, list2):
result = list(set(list1 + list2))
print("Union of {} and {} is {}".format(list1, list2, result))
def intersect(list1, list2):
result = [x for x in list1 if x in list2]
print("Intersection of {} and {} is {}".format(list1, list2, result))
@hmasila
hmasila / sets.py
Created November 20, 2017 20:10
sets created by andela_hmasila - https://repl.it/@andela_hmasila/sets
# Sets revisited in python
def union(list1, list2):
result = list(set(list1 + list2))
print("Union of {} and {} is {}".format(list1, list2, result))
def intersect(list1, list2):
result = [x for x in list1 if x in list2]
print("Intersection of {} and {} is {}".format(list1, list2, result))
@hmasila
hmasila / sets.py
Created November 20, 2017 20:09
sets created by andela_hmasila - https://repl.it/@andela_hmasila/sets
# Sets revisited in python
def union(list1, list2):
result = list(set(list1 + list2))
print("Union of {} and {} is {}".format(list1, list2, result))
def intersect(list1, list2):
result = [x for x in list1 if x in list2]
print("Intersection of {} and {} is {}".format(list1, list2, result))