This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Site.Plug.Bot.Seo do | |
import Plug.Conn | |
@doc """ | |
This plug will route bots to a custom route so we can seed them with seo friendly content | |
requires (add to mix): {:ua_inspector, "~> 0.13" } | |
""" | |
@url "/to_url" | |
def init(options), do: options |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//this will test and validate your filezilla exported sites ie filezilla.xml file run this in the dir filezilla.xml is ie | |
//'php verify.php filezilla.xml' or | |
//'php verify.php filezilla.xml verify' to validate ftp details | |
//an html file called filezilla_status will contain the ftp info | |
$xml_file = $argv[1]; | |
if(isset($argv[1] && $argv[1] == "verify")){ | |
$test_ftp = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## This script will observe a directory and compress/optimize .png and .jpg files | |
## Created to optimize incoming images on ubuntu / aws server | |
## jpegoptim, jpgcompress, pngquant and inotify-tools | |
## 2016 Jason Clark ([email protected]) | |
DIRECTORY_TO_OBSERVE="/var/www/html/image/cache" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class QuickGit { | |
private $version; | |
function __construct() { | |
if(function_exists('exec')) { | |
exec('git describe --always',$version_mini_hash,$error); | |
if($error == 0 ){ | |
exec('git rev-list HEAD | wc -l',$version_number); | |
exec('git log -1',$line); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sample configuration file for smartd. See man smartd.conf. | |
# Home page is: http://smartmontools.sourceforge.net | |
# $Id: smartd.conf 3651 2012-10-18 15:11:36Z samm2 $ | |
# smartd will re-read the configuration file if it receives a HUP | |
# signal | |
# The file gives a list of devices to monitor using smartd, with one |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-2.1.4.js" data-semver="2.1.4" data-require="jquery@*"></script> | |
<script data-require="moment.js@*" data-semver="2.10.2" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script> | |
<link rel="stylesheet" href="style.css" /> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# -e means exit if any command fails | |
DBHOST=address.to.your.server | |
DBUSER=username | |
DBPASS=password # do this in a more secure fashion | |
DBNAME=DBNAME | |
GITREPO=/where/is/your/repo | |
DUMP=$GITREPO/where/you/store/dumps | |
NEW=$DUMP/schema.sql | |
OLD=$NEW.old |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while sleep 55 | |
do | |
players_list=$(gdbus call --session --dest org.freedesktop.DBus \ | |
--object-path / --method org.freedesktop.DBus.ListNames | \ | |
awk 'BEGIN { RS=","; } /org.mpris.MediaPlayer2./ { gsub(/[\[\]()\x27]/, ""); print $1; }') | |
for player in $players_list | |
do | |
state=$(gdbus call --session \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A simple script to backup an organization's GitHub repositories. | |
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files | |
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up | |
GHBU_API=${GHBU_API-"https://api.github.com"} # base URI for the GitHub API | |
GHBU_GITHOST=${GHBU_GITHOST-"<CHANGE-ME>.github.com"} # the GitHub hostname (see comments) | |
# I recommend using an API token so it is easily trackable and removable. | |
# Note that you MUST have SSH keys for a user with the access to all repos set up |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php -q | |
<?php | |
### This will convert your mysql schema to chicago boss base app, create models, controllers, and views based on the schema | |
### place under the app root ex /appname/mysqlitoboss.php | |
### run from cli ex./mysqlitoboss.php or php -f mysqlitoboss.php | |
/* Define STDIN in case if it is not already defined by PHP for some reason */ |