Skip to content

Instantly share code, notes, and snippets.

View tosin2013's full-sized avatar

Tosin Akinosho tosin2013

View GitHub Profile
@tosin2013
tosin2013 / Submit Event
Created October 2, 2012 03:14 — forked from bueltge/Submit Event
Submit Event in Frontend of Blog via Template in Theme for Plugin: EVENTS MANAGER EXTENDED
<?php
/*
Template Name: Submit Event
Author: Frank Bueltge
Author URI: http://bueltge.de/
*/
function add_errormessage_style() { ?>
<style type="text/css">
.errormessage { border: 3px solid red; padding: 5px; color: #000; }
@tosin2013
tosin2013 / README-Template.md
Created November 15, 2016 21:03 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@tosin2013
tosin2013 / downlaodimage
Created December 6, 2016 04:41
ionic framework download image to device
$scope.Download = function () {
ionic.Platform.ready(function(){
var url = "http://3.bp.blogspot.com/-XchURXRz-5c/U5ApPOrPM9I/AAAAAAAADoo/YZEj4qeSlqo/s1600/Final-Fantasy-XV-Noctis-Red-Eyes.png";
var filename = url.split("/").pop();
var targetPath = cordova.file.externalRootDirectory + filename;
@tosin2013
tosin2013 / uploadimage_ionic_dreamfactory
Last active December 6, 2016 04:44
working in progress upload ionic to dreamfactory
$scope.testFileUpload = function () {
// Function code goes here
// Destination URL
var url = "your_endpoint";
@tosin2013
tosin2013 / NOTES.md
Created December 14, 2016 19:19 — forked from DenisIzmaylov/NOTES.md
Step By Step Guide to Configure a CoreOS Cluster From Scratch

Step By Step Guide to Configure a CoreOS Cluster From Scratch

This guide describes how to bootstrap new Production Core OS Cluster as High Availability Service in a 15 minutes with using etcd2, Fleet, Flannel, Confd, Nginx Balancer and Docker.

Content

@tosin2013
tosin2013 / setup-keyless.sh
Created December 15, 2016 05:29
configure password less Secure Access
#!/bin/bash
if [[ $# < 2 ]];then
echo $0: usage: ./setup-keyless.sh username 192.168.1.5 192.168.1.6 192.168.1.7 192.168.1.8
exit 1
fi
USER=$1
cd ..
echo "create authentication ssh-keygen keys on localhost"
echo "will set up keys on $2, $3, $4, $5"
@tosin2013
tosin2013 / initialize_git_client
Created December 20, 2016 15:54
initiazile git on client
mkdir my_project
cd my_project
touch .gitignore
git init
git add .
git commit -m "Initial commit"
git remote add origin youruser@yourserver.com:/path/to/my_project.git
git push origin master
@tosin2013
tosin2013 / quick-mount.sh
Created January 20, 2017 21:47
automount in rhel/centos
#format mount point
mkfs.ext4 /dev/xvdf 2>/dev/null
#create dirctory
mkdir -p /data/db/
#mount for start up
echo '/dev/xvdf /data/db auto noatime,noexec,nodiratime 0 0' >> /etc/fstab
mount -a /dev/xvdf /data/db
@tosin2013
tosin2013 / parse_yaml.sh
Created February 28, 2017 14:58 — forked from pkuczynski/parse_yaml.sh
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}