Skip to content

Instantly share code, notes, and snippets.

Avatar

Gemma Black gemmadlou

View GitHub Profile
@gemmadlou
gemmadlou / parse_dotenv.bash
Created Sep 26, 2020 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
View parse_dotenv.bash
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@gemmadlou
gemmadlou / entrypoint.sh
Created Sep 9, 2020
My docker entrypoint example (Node)
View entrypoint.sh
#!/bin/sh -e
# https://medium.com/swlh/five-use-cases-for-docker-entry-points-a5eb6661dac6
case $1 in
server)
if [ "$ENVIRONMENT" == "production" ]; then
node /app/server.js
else
@gemmadlou
gemmadlou / auth.js
Created Aug 6, 2020
Nuxt Auth0 Vuex Store
View auth.js
import auth from 'auth0-js'
let auth0
let user
export const state = () => ({
isAuthenticated: false,
loggingIn: true,
requiresAuth: false
})
@gemmadlou
gemmadlou / 01.md
Created Jul 21, 2020
Kubernetes Filebeat,Elasticsearch and Kibana
View 01.md
  • Filebeat will live on the Kubernetes clusters with the applications as a daemonset
  • Elasticsearch will live on its own cluster
@gemmadlou
gemmadlou / gist:56abc88be51f8629bf2c5bf5ed6c7870
Created Apr 15, 2020 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:56abc88be51f8629bf2c5bf5ed6c7870

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@gemmadlou
gemmadlou / store-auth.js
Created Apr 12, 2020
Auth0 Vuex based Authentication
View store-auth.js
import createAuth0Client from '@auth0/auth0-spa-js'
import deepEqual from 'deep-equal'
/**
* A singleton auth0 variable that defines the Auth0 client for single use across the store
*
* @var {Auth0Client}
*/
let auth0 = undefined
@gemmadlou
gemmadlou / .autorc
Last active Apr 5, 2020
Auto docker image release
View .autorc
{
"plugins": [
"git-tag",
"conventional-commits",
[
"exec",
{
"afterVersion": "publish"
}
]
@gemmadlou
gemmadlou / .bash_profile
Last active Jul 10, 2020
AWS reassigning IP addresses automatically
View .bash_profile
function renew_aws_ip {
SECURITY_GROUP=$1
NAME_OF_RULE=$2
REGION="--region=eu-west-1"
if [ ! -z "$3" ]; then
REGION="--region=$3"
fi
@gemmadlou
gemmadlou / db-connect-test.php
Created Mar 12, 2020 — forked from M165437/db-connect-test.php
Script for a quick PHP MySQL DB connection test.
View db-connect-test.php
<?php
# Fill our vars and run on cli
# $ php -f db-connect-test.php
$dbname = 'name';
$dbuser = 'user';
$dbpass = 'pass';
$dbhost = 'host';
$link = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
View mysql_imports.sh
mysql --defaults-group-suffix=_products --database data_analysis -e "load data local infile 'data/file.csv' into table table_name fields terminated by ',' enclosed by '\"' lines terminated by '\n'"
mysql --defaults-group-suffix=_products --database data_analysis < file.sql
# Dump
mysqldump --defaults-group-suffix=_local_products --column-statistics=0 --no-create-info --set-gtid-purged=OFF --insert-ignore rentr > test.sql
You can’t perform that action at this time.