Skip to content

Instantly share code, notes, and snippets.

View meigwilym's full-sized avatar

Mei Gwilym meigwilym

View GitHub Profile
@meigwilym
meigwilym / readme.md
Last active October 30, 2018 12:26
UK Quake Alerts
@meigwilym
meigwilym / readme.md
Created October 1, 2018 08:30
Configuring WPA2 Wifi on a Raspberry Pi

I had real trouble connecting my Raspberry Pis (v3 Model Bs) to a WPA Enterprise network.

Here's what I did to get it to work.

For this example, my wifi network name is "WiFi Network", usernames and passwords have also been swapped out. The Wifi Country is GB.

Wifi

Edit /etc/wpa_supplicant/wpa_supplicant.conf with the following (using your "real" password):

@meigwilym
meigwilym / readme.md
Last active September 26, 2018 09:31
Use array functions rather than loops for JSON objects

Use array functions rather than loops for JSON objects

Take this array of tag objects for example.

const tags = [
	{
		name: 'Studio',
		id: 'studio',
 url: '/tags/studio'
@meigwilym
meigwilym / acenion.md
Last active August 31, 2018 10:24
Acenion y Gymraeg

Pob llythyren acenog yn y Gymraeg.

Mae'r degol, hex a named ar gyfer dogfennau html.

Llythyren Côd Disgrifiad Decimal Hex Named
 U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX   Â
â U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX â â â
Ê U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX Ê Ê Ê
ê U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX ê ê ê
@meigwilym
meigwilym / readme.md
Last active July 6, 2018 12:45
Using Adminator in Laravel
@meigwilym
meigwilym / laravel-check.php
Created April 5, 2018 13:20
A PHP file that checks that your server is compatible with Laravel 5.6's requirements.
<?php
$phpversionok = false;
if(PHP_VERSION_ID >= 70103) {
$phpversionok = true;
}
$exts = ['openssl', 'pdo', 'mbstring', 'tokenizer', 'xml', 'ctype', 'json'];
$extsNotloaded = [];
foreach($exts as $i => $extension) {
@meigwilym
meigwilym / example.conf
Last active May 9, 2018 10:03
Install a web server and separate database server for Wordpress
server {
# certbot uses this to verify the SSL request
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
root /var/www/letsencrypt;
}
}
@meigwilym
meigwilym / console.php
Last active March 5, 2024 02:20
Laravel Create User Command
<?php
// routes/console.php
// quickly create an user via the command line
Artisan::command('user:create', function () {
$name = $this->ask('Name?');
$email = $this->ask('Email?');
$pwd = $this->ask('Password?');
// $pwd = $this->secret('Password?'); // or use secret() to hide the password being inputted
\DB::table('users')->insert([
@meigwilym
meigwilym / provision.sh
Last active August 16, 2023 19:51
RedHat 7.3 setup Nginx, PHP 7.1, MySQL 5.7, Composer, Supervisor. For Laravel installations.
#!/bin/bash
# setup an environment for laravel on Red Hat 7.3
# Nginx
# PHP 7.1
# optional MySQL 5.7 or PostgreSQL 9.6
# Composer
# Supervisor
# check for root user
@meigwilym
meigwilym / config.yaml
Created December 23, 2016 09:47
Puphpet config YAML file
vagrantfile:
target: local
vm:
provider:
local:
box: puphpet/centos7-x64
box_url: puphpet/centos7-x64
box_version: '0'
chosen_virtualizer: virtualbox
virtualizers: