Skip to content

Instantly share code, notes, and snippets.

View MACscr's full-sized avatar

Mark Chaney MACscr

View GitHub Profile
<script>
$(function(){
$('#edit').froalaEditor({
enter: $.FroalaEditor.ENTER_P,
fileUploadToS3: {
bucket: '<?php echo $bucket; ?>',
region: '<?php echo $region; ?>',
keyStart: '<?php echo $keyStart; ?>',
params: {
acl: '<?php echo $acl; ?>',
<?php
// Set date timezone.
date_default_timezone_set('Europe/Bucharest');
// important variables that will be used throughout this example
$bucket = 'froala-dev';
$region = 's3';
$keyStart = 'editor/';
$acl = 'public-read';
<?php
// Set date timezone.
date_default_timezone_set('Europe/Bucharest');
// important variables that will be used throughout this example
$bucket = 'froala-dev';
$region = 's3';
$keyStart = 'editor/';
$acl = 'public-read';
// these can be found on your Account page, under Security Credentials > Access Keys
$accessKeyId = $_SERVER['AWS_ACCESS_KEY'];
<script>
$(function(){
$('#edit').froalaEditor({
enter: $.FroalaEditor.ENTER_P,
imageUploadToS3: {
bucket: '<?php echo $bucket; ?>',
region: '<?php echo $region; ?>',
keyStart: '<?php echo $keyStart; ?>',
params: {
acl: '<?php echo $acl; ?>',
@MACscr
MACscr / pxe_creator.php
Last active December 19, 2015 21:00
create default pxe menus for each cluster host
#!/usr/bin/php -q
<?php
// Report all errors except E_NOTICE
error_reporting(E_ALL & ~E_NOTICE);
function foreman_api($request) {
$username = 'apiuser';
$password = '##########';
root@gluster1:/mnt/glusterfs# gluster volume heal volume1 info
Brick gluster1:/var/gluster-storage
/stor1.img
<gfid:0c926d4c-295d-41b2-9e72-344c0d7fc2bd>
/host5.img
/host1.img
/host4.img
/host2.img
/stor2.img
/host3.img
test
#!/bin/bash
working_dir="/var/www/media/podcasts/"
file1="feed.xml.attempt"
file2="feed.xml"
generator="feed.php"
cd "$working_dir"
php "$generator" > "$file1"
@MACscr
MACscr / gist:91d1fc4fd36b99633e38f523064471cc
Created January 12, 2017 05:17
armbian A20 wlan missing
root@pcduino3nano:~# lsmod
Module Size Used by
sun4i_codec 11391 3
r8188eu 419937 0
snd_soc_core 130295 1 sun4i_codec
snd_pcm_dmaengine 3455 1 snd_soc_core
snd_pcm 77587 2 snd_soc_core,snd_pcm_dmaengine
snd_timer 19477 1 snd_pcm
evdev 12164 1
input_leds 2676 0
@MACscr
MACscr / gist:d04350782b2270719151d6785ec4c8bc
Created January 14, 2017 10:00
sun7i-a20-pcduino3.dts.stock - Linux pcduino3 4.9.3-sunxi
/dts-v1/;
/ {
#address-cells = <0x1>;
#size-cells = <0x1>;
interrupt-parent = <0x1>;
model = "LinkSprite pcDuino3";
compatible = "linksprite,pcduino3", "allwinner,sun7i-a20";
chosen {