Skip to content

Instantly share code, notes, and snippets.

View RusimbiPatrick's full-sized avatar
🎯
Focusing

Rusimbi Patrick RusimbiPatrick

🎯
Focusing
View GitHub Profile
#!/bin/bash
# Ensure inotify-tools is installed
# sudo apt-get update
sudo apt-get install -y inotify-tools
# Initialize Student ID and directory parameters
STUDENT_ID="22059"
MONITOR_DIR="${1:-.}" # Directory to monitor; defaults to the current directory if not provided
LOG_DIR="${2:-.}" # Directory for logs; defaults to the current directory if not provided
#hello
touch ~/FALL24/Linux/GroupA/StudentsProfiles/${studentID}_${timestamp} >> log.txt
He must edit the /etc/hosts file manually and update the hostname there.
Hello Buddy The system time and date is: [Current Date & Time] Your username is: zedefender
student_TIMESTAMP for each iteration, where the student ID is always student and only the timestamp varies.
https://drive.google.com/file/d/1YKJnrir2-lRoJaSs89pxG2RUsJD_Ig09/view
--1
SELECT dept_no, dept_name, CONCAT(E.first_name,' ', E.last_name) AS MNG
FROM departments
LEFT JOIN dept_manager DM USING(dept_no)
LEFT JOIN employees E USING(emp_no);
--2
SELECT emp_no, first_name, last_name, D.dept_name
FROM employees e
JOIN dept_emp DE USING(emp_no)
@RusimbiPatrick
RusimbiPatrick / testdata.sql
Last active July 23, 2023 05:00
Assignment Dummy Data
DROP DATABASE assignment;
CREATE DATABASE assignment;
USE assignment;
CREATE TABLE Customers (
CustomerID INT AUTO_INCREMENT PRIMARY KEY,
CustomerName VARCHAR(100),
Email VARCHAR(100)
);
@RusimbiPatrick
RusimbiPatrick / FB-PE-InterviewTips.md
Created May 9, 2021 23:11 — forked from ameenkhan07/FB-PE-InterviewTips.md
Facebook Production Engineering Interview

What to Expect and Tips

• 45-minute systems interview, focus on responding to real world problems with an unhealthy service, such as a web server or database. The interview will start off at a high level troubleshooting a likely scenario, dig deeper to find the cause and some possible solutions for it. The goal is to probe your knowledge of systems at scale and under load, so keep in mind the challenges of the Facebook environment.
• Focus on things such as tooling, memory management and unix process lifecycle.

Systems

More specifically, linux troubleshooting and debugging. Understanding things like memory, io, cpu, shell, memory etc. would be pretty helpful. Knowing how to actually write a unix shell would also be a good idea. What tools might you use to debug something? On another note, this interview will likely push your boundaries of what you know (and how to implement it).

Design/Architecture 

Interview is all about taking an ambiguous question of how you might build a system and letting

@RusimbiPatrick
RusimbiPatrick / validation.js
Created October 2, 2019 14:09
Custom validators/sanitizers
const { body } = require('express-validator');
app.post('/user', body('email').custom(value => {
return User.findUserByEmail(value).then(user => {
if (user) {
return Promise.reject('E-mail already in use');
}
});
}), (req, res) => {
// Handle the request
@RusimbiPatrick
RusimbiPatrick / validation.js
Created October 2, 2019 14:07
Epress validator customm error messages
const { check } = require('express-validator');
app.post('/user', [
// ...some other validations...
check('password', 'The password must be 5+ chars long and contain a number')
.not().isIn(['123', 'password', 'god']).withMessage('Do not use a common word as the password')
.isLength({ min: 5 })
.matches(/\d/)
], (req, res) => {
// Handle the request somehow