Skip to content

Instantly share code, notes, and snippets.

@odixon
odixon / mysql_backup.sh
Created September 25, 2018 14:40 — forked from tleish/mysql_backup.sh
Bash Script to backup all MySQL databases
#!/bin/bash
#==============================================================================
#TITLE: mysql_backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am
@odixon
odixon / git_submodules.md
Created July 23, 2018 21:49 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
@odixon
odixon / ffmpeg-avchd-conversion.md
Created July 23, 2018 03:22 — forked from trisweb/ffmpeg-avchd-conversion.md
ffmpeg commands for converting AVCHD-Lite video to better format(s)

FFMpeg Commands for Transcoding MTS video (from AVCHD-Lite Cameras, like Panasonic DMC-TS1/2)

720p -> H.264 (x264) video + AAC 128kbps audio:

Medium quality 720p:

ffmpeg -i 00001.MTS -threads 3 -y -vcodec libx264 -sameq -acodec libfaac -ab 128k -ar 44100 -ac 2 -s 1280x720 -vpre normal -b 1M output.mp4

High quality 720p:

@odixon
odixon / upgrade-php7.sh
Created June 29, 2018 15:12 — forked from heathdutton/upgrade-php7.sh
Upgrade PHP 7.0 to 7.1 on Amazon Linux (specifically for Elastic Beanstalk but should work elsewhere)
#!/usr/bin/env bash
# Upgrade an Amazon Linux PHP 7.0 EC2 to PHP 7.1
#
# Must be ran as sudo:
# sudo bash upgrade-php71.sh
#
# Can be added to ./.ebextensions/20_php.config like so:
# container_commands:
# 20_php71_upgrade:
# command: sudo bash scripts/upgrade-php71.sh
@odixon
odixon / git-overwrite-branch.sh
Created June 8, 2018 19:49 — forked from ummahusla/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of seotweaks branch (seotweaks > master)
git checkout seotweaks # source name
git merge -s ours master # target name
git checkout master # target name
git merge seotweaks # source name
@odixon
odixon / laravel-connection.php
Last active May 19, 2018 04:26 — forked from pekhee/connection.php
Setup database connection for Eloquent outside of Laravel.
<?php // Namespace DB;
use Illuminate\Database\Capsule\Manager as Capsule;
class Connection {
public function __construct()
{
$this->capsule = new Capsule;
// Same as database configuration file of Laravel.
@odixon
odixon / captcha.php
Created April 2, 2018 22:26 — forked from noidsit/captcha.php
uppercase alphanumeric CAPTCHA class with imagettftext
<?php
// captcha class by noidsit
// generate captcha uppercase alphanumeric
// if you want to use upper/lower case alphanumeric add lower case alphabet
// usage string = new Captcha(16,230,32,6); //fontwidth, image witdh, image height, how many characters
// string->captgen(); to generate captcha
class Captcha {
private $fontwidth;
private $width;
private $height;
@odixon
odixon / tools.sh
Created March 29, 2018 16:35 — forked from thegallagher/tools.sh
Install web development tools on Ubuntu 16.04
#!/bin/bash
# Git
sudo apt-get -y install git
# Node.js
sudo apt-get -y install nodejs
sudo apt-get -y install npm
sudo ln -s /usr/bin/nodejs /usr/bin/node
@odixon
odixon / make_api_calls_php.php
Created January 16, 2018 17:14 — forked from joashp/make_api_calls_php.php
Make API Calls in PHP
<?php
function CallAPI($method, $url, $data = false) {
$curl = curl_init();
switch ($method)
{
case "POST":
curl_setopt($curl, CURLOPT_POST, 1);
@odixon
odixon / PushNotifications.php
Created January 16, 2018 17:12 — forked from joashp/PushNotifications.php
Simple PHP script to send Android Push Notification, iOS Push Notification and Windows Phone 8 Push Notification
<?php
// Server file
class PushNotifications {
// (Android)API access key from Google API's Console.
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI';
// (iOS) Private key's passphrase.
private static $passphrase = 'joashp';
// (Windows Phone 8) The name of our push channel.
private static $channelName = "joashp";