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
#!/bin/sh
git filter-branch --env-filter '
CORRECT_NAME="Wagura Maurice"
CORRECT_EMAIL="business@waguramaurice.com"
if [ "$GIT_COMMITTER_EMAIL" != "$CORRECT_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
@wagura-maurice
wagura-maurice / install-php7.2-mcrypt.sh
Created March 15, 2019 06:57
install-php7.2-mcrypt.sh
## How to install mcrypt in php7.2
##
## https://lukasmestan.com/install-mcrypt-extension-in-php7-2/
##
#
# Check version php and pecl
#
php -v # if default php is not 7.2 then use /usr/bin/php7.2 instead php
composer global require laravel/installer
composer global require cpriego/valet-linux
nano ~/.bashrc
export PATH="$PATH:~/.config/composer/vendor/bin"
source ~/.bashrc
Clone respected git repository
git clone https://github.com/martynbiz/human_services_finder.git
Install all dependencies
bundle install
Create db and migrate schema
rake db:create
rake db:migrate // rake db:schema:load
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
source ~/.bashrc
@wagura-maurice
wagura-maurice / update_sum_mismatch.txt
Created March 27, 2019 10:36
Hash Sum mismatch Ubuntu Server 18.04.1 LTS
sudo rm -rf /var/lib/apt/lists/*
sudo apt-get update -o Acquire::CompressionTypes::Order::=gz
sudo apt-get update && sudo apt-get upgrade
@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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC9h81rG/s+3hJ3nTEpxE78O+MFs1NtPfU+pn4/ZX9hs9PxoLkUrKmnLSqzNBlK1FKL3fz1dgL1WTh21rVb7qEmnh/7kBaiAObl/s4+M7BxZwwwIxj35LZOKoyAozcjdURpnblB8g7aUJ4Yayn466isFECo9BxDSfV07OOKOxbGC5GFgnkxU//XowGXgHzgJ3k76JBPFNV+gDQRa3As6XMqApn2aNAGs0wEwhxJa4FX0sEVcvZ84HUfjI7vDx6OueD5r8qgVsectHzNVAutUAQXOUfiahgOPKwlopqXGyvAfW2lirI1j9SPqBJquWelhODgG2WKTFE8AZGpXLhofEYtUSTgL/b8gca3xlZ+cfiqWMn0283oYoLBxNotsdGg4fY20EZBA0WmiyeTzYFo1RVCPpNxjJ7jUm+UQZ9wNaQsKxS0q1emG4lHusz26KKUjgCaoTgjrCBk2fwBsFkGKgvTDaiHelMgM7y5jSlspX1r45kZb5tfdxTDTBbQaOZDD5osjNXRlfcwXMP0WqRM69YOe+8Kv6YqQu+L3uv3y6eT9vGR3cv7LbTNEg2uKV3kgLT528fd9FT8fVpBFbmyeDoqQ2VJaOTkNFe7y4BY7o/v0XEFSomUXjYOKnavFdxHwXI2gA/ke2hmQYj3qvhBPdiIYujwB0FW/JTPdqnV0DACkw== business@waguramaurice.com
@wagura-maurice
wagura-maurice / any.txt
Created May 13, 2019 13:33
laravel any / all routes
The first method is matching (:any)/(:all?):
Route::any('(:any)/(:all?)', function($first, $rest=''){
$page = $rest ? "{$first}/{$rest}" : $first;
dd($page);
});
Not the best solution because it gets broken into multiple parameters, and for some reason (:all) doesn't work by itself (bug?)
The second solution is to use a regular expression, this is a better way then above in my opinion.
heroku login
heroku git:clone -a egranary
cd egranary
git remote add egranary git@github.com:alkarimlalani/egranary.git
git fetch egranary master
git reset --hard egranary/master
git push heroku master --force