Skip to content

Instantly share code, notes, and snippets.

View wagura-maurice's full-sized avatar
🏠
Working from home

Maurice Wagura wagura-maurice

🏠
Working from home
View GitHub Profile
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install postgresql postgresql-contrib
sudo adduser postgres
sudo passwd postgres
usermod -a -G sudo postgres
su - postgres
psql -d template1 -c "ALTER USER postgres WITH PASSWORD 'Rtcv39$$';"
createuser montanabay --pwprompt
@wagura-maurice
wagura-maurice / structure.sh
Created September 20, 2023 13:40
script to only create the folder structure and respective .vue and .ts files in the current directory
#!/bin/bash
# Determine file extension for Vue.js with TypeScript
FILE_EXTENSION=".vue"
# Set up the desired project directory structure for Vue
DIRECTORIES=(
"src/assets/images"
"src/assets/styles"
"src/components/common"
@wagura-maurice
wagura-maurice / setup_vue_app.sh
Last active September 20, 2023 13:34
setup vue js app
#!/bin/bash
# Prompt the user for the application name
echo "Enter your application name:"
read APP_NAME
# Determine file extension for Vue.js with TypeScript
FILE_EXTENSION=".vue"
# Initialize the Vite app using the specified name with the Vue TypeScript template
@wagura-maurice
wagura-maurice / postman_installation.md
Created September 9, 2023 15:58 — forked from Akhil-Suresh/postman_installation.md
Installing Postman on Ubuntu/Debian

Installing Postman

Step 1

If any version of postman is installed we need to remove it

sudo rm -rf /opt/Postman

Step 2

@wagura-maurice
wagura-maurice / modify-dom.txt
Created May 1, 2023 21:51 — forked from ahliang85/modify-dom.txt
Chrome Extension - Modify DOM
Background page is kind of like you own mini server - it is a completely isolated page that has nothing to do with pages a user visits. It is used for controlling the rest of extension components as it is always running in background.
Content scripts are pieces of javascript code that are getting injected into actual pages a user visits and can access and modify parent page's DOM.
So to get your extension working you need to remove
<script src="jquery.min.js"></script>
<script src="content.js"></script>
from background page, and inject jquery as a content script either through manifest:
@wagura-maurice
wagura-maurice / remote_mysql.txt
Last active January 4, 2023 17:37
MySQL root access from all hosts
sudo ufw allow from any to any port 3306 proto tcp
sudo apt update
sudo apt install mysql-server
sudo mysql_secure_installation
sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Rtcv39$$';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost';
CREATE USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Rtcv39$$';
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Rtcv39$$';
@wagura-maurice
wagura-maurice / USSD_CASE.md
Created October 9, 2022 01:04
USSD logic for rent

PART 1; is what new tenants interact with when they dial our ussd for the first time. is also what existing tenants interact with when applying to new property unit tenancy.

(*) NEW TENANCY MENU
    [INPUT] PROPERTY UNIT CODE
    [SELECTION] CONFIRMATION
        1) CONTINUE -> send to tenant onboarding and property unit assigning action
        2) BACK -> send to property unit code input
  1. EXIT -> send to session termination
@wagura-maurice
wagura-maurice / AbstractController.php
Created August 2, 2022 08:19 — forked from dinhquochan/AbstractController.php
Abstract Controller for Laravel (version 8.x)
<?php
namespace App\Http\Controllers;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Http\JsonResponse;
use Illuminate\Routing\Controller as BaseController;
@wagura-maurice
wagura-maurice / git.txt
Last active July 30, 2022 12:44
Configuring Git
git config --global color.ui true
git config --global user.name "Wagura Maurice"
git config --global user.email "business@waguramaurice.com"
git config --global user.signingkey [secret-gpg-key-id]
git config --global commit.gpgsign true
git config --global gpg.program $(which gpg)
ssh-keygen -t rsa -b 4096 -C "business@waguramaurice.com"
cat ~/.ssh/id_rsa.pub
@wagura-maurice
wagura-maurice / AppServiceProvider.php
Created July 18, 2022 12:07 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()