#Nginx Redirect Template This config will redirect a given request from "http://IP:PORT/THE/PATH/" to a choosen webservice. To get it work, you only have to edit "/THE/PATH/" and "IP:PORT".
This file contains 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
#install latest node | |
sudo add-apt-repository --yes ppa:chris-lea/node.js | |
sudo apt-get update | |
sudo apt-get install --yes nodejs | |
# java | |
sudo apt-get -y install openjdk-7-jdk | |
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 | |
export PATH=${PATH}:${JAVA_HOME}/bin |
This file contains 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
class TidyHtml5 < Formula | |
desc "" | |
homepage "" | |
url "https://github.com/htacg/tidy-html5/archive/5.0.0.RC1.tar.gz" | |
version "1" | |
sha256 "3b1f51ec0d445af99f9c36c46a621b6374a3ea22866d29375e3af5d8d0e960b2" | |
depends_on "cmake" => :build | |
def install |
This file contains 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 | |
# Check if user is root | |
if [ $(id -u) != "0" ]; then | |
echo "Error: You must be root to run this script, please use root to install the software." | |
exit 1 | |
fi | |
apt-get remove libtidy-0.99-0 tidy -y | |
wget -O /tmp/tidy-5.0.0-64bit.deb http://www.htacg.org/binaries/binaries/tidy-5.0.0.RC1/tidy-5.0.0-64bit.deb |
This file contains 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 directory will be zipped and pushed to the ftp server. | |
LOCAL_BACKUP="/srv/www" | |
### MySQL credentials | |
MYSQL_USER="root" | |
MYSQL_PASS="password" | |
### FTP credentials |
This file contains 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
import Foundation | |
import UIKit | |
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let refreshControl = UIRefreshControl() | |
refreshControl.addTarget(self, action: #selector(refresh), for: .valueChanged) |
This file contains 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
extension MKMapView { | |
func fitMapViewToAnnotaion(withEdgePadding edgePadding:UIEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20), andLocation givenLocation:CLLocationCoordinate2D?) -> Void { | |
var zoomRect:MKMapRect = MKMapRect.null | |
for annotation in annotations { | |
let aPoint:MKMapPoint = MKMapPoint(annotation.coordinate) | |
let rect:MKMapRect = MKMapRect(x: aPoint.x, y: aPoint.y, width: 0.1, height: 0.1) | |
if zoomRect.isNull { | |
zoomRect = rect |
To backup all databases in one file.
./mysql_backup.sh
To back up a particular database to a directory named the database.
./mysql_backup.sh DB_NAME
This file contains 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
captureConsole() { | |
let console = window.console | |
if(!console) return | |
function intercept(method) { | |
let original = console[method] | |
console[method] = function() { | |
if(original.apply) { | |
// do something with arguments |
This file contains 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
const mysql = require('mysql') | |
const { curly } = require('node-libcurl'); | |
const querystring = require('querystring'); | |
const host = 'URL_TO_KEYCLOAK' | |
const realm = 'REALM_NAME' | |
async function migrate() { | |
var connection = mysql.createConnection({ | |
host: 'HOST', // Insert your database host. |
OlderNewer