Skip to content

Instantly share code, notes, and snippets.

View richard457's full-sized avatar
🎯
Focusing

Muragijimana richard457

🎯
Focusing
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@richard457
richard457 / example.nginx
Created May 14, 2022 18:40 — forked from gsanders5/example.nginx
Automatic nginx virtual subdomains with sub-folders or sub-directories
# Automatic nginx virtual subdomains with sub-folders or sub-directories
#
# Since the original source where I found this code is now offline, I have decided to mirror it here.
# All credit goes to: http://web.archive.org/web/20150307193208/http://www.messaliberty.com/2010/10/automatic-nginx-virtual-subdomains-with-sub-folders-or-sub-directories
#
# Description: In my web root directory I wanted create a folder called photos, and another called
# music using a sftp program. Without manually going back to the config file or to the shell I like to
# be able to access them at photos.nginxdomain.com and music.nginxdomain.com. That is what this config does.
# Redirect visitors from http://nginxdomain.com/ to http://www.nginxdomain.com/
<?php
// GET
$request = $client->get($url, array('Accept' => 'application/json'));
$response = $request->send();
if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) {
// Error
}
@richard457
richard457 / migration.php
Created March 19, 2019 09:55 — forked from jakzaizzat/migration.php
Update ENUM value in Laravel Migration
DB::statement("ALTER TABLE roles CHANGE COLUMN role role ENUM('system admin', 'super admin', 'admin staff', 'instructor', 'customer', 'gym member', 'swim member')");
@richard457
richard457 / ssh-chroot-jail.sh
Created March 10, 2019 07:30 — forked from floudet/ssh-chroot-jail.sh
Chroot Jail for SSH Access
# Chroot Jail for SSH Access
# Tested on Ubuntu 14.04.2 LTS and Debian GNU/Linux 8 (jessie)
# Reference : http://allanfeid.com/content/creating-chroot-jail-ssh-access
#
# Had to add/change several things to make it work, including:
# - create lib64 folder
# - copy whoami dependencies that ldd doesn't show to fix 'I have no name!'
# in the customized prompt + create passwd file
#