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
<?php | |
$DBHOST = 'localhost'; | |
$DBNAME = 'test'; | |
$DBUSER = 'username'; | |
$DBPASS = 'password'; | |
$compression = TRUE; | |
$dst_dir = '/tmp'; | |
$DBH = new PDO("mysql:host=".$DBHOST.";dbname=".$DBNAME."; charset=utf8", $DBUSER, $DBPASS); |
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
<?php | |
/********************* START CONFIGURATION *********************/ | |
$DB_SRC_HOST='localhost'; | |
$DB_SRC_USER='root'; | |
$DB_SRC_PASS='password'; | |
$DB_SRC_NAME='database1'; | |
$DB_DST_HOST='localhost'; | |
$DB_DST_USER='root'; | |
$DB_DST_PASS='password'; |
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 | |
# | |
# Copyright 2016 - Matteo Mattei <[email protected]> | |
# This script is intended to be used to shrink raspberry pi images | |
# created with dd client command. | |
# Check if you are root | |
if [ ! $(id -u) -eq 0 ]; then | |
echo "ERROR: This program must run as root" | |
exit 1 |
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 | |
TOTAL_MEMORY=$(grep "^MemTotal:" /proc/meminfo | awk '{print $2}') | |
MYSQL_MEMORY=$(ps aux | grep mysql | grep -v "grep" | grep "^mysql" | awk '{print $6}' | sort | head -n 1) | |
APACHE_MEMORY_PROCESSES=$(ps aux | grep 'apache' | grep -v "grep" | awk '{print $6}' | sort) | |
APACHE_INSTANCES=0 | |
APACHE_TOTAL_MEMORY=0 | |
for i in ${APACHE_MEMORY_PROCESSES} | |
do |
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
#!/usr/bin/env python3 | |
# This script performs a GET and a POST request through HTTP/HTTPS using | |
# builtin python3 moudules. There is also a class to encode files for upload! | |
import urllib.request | |
import http.client | |
import mimetypes | |
import codecs | |
import uuid | |
import binascii |
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 | |
VERSION="1.17" | |
if [ ! -f wget-${VERSION}.tar.xz ]; then | |
wget http://ftp.gnu.org/gnu/wget/wget-${VERSION}.tar.xz | |
fi | |
rm -rf wget-${VERSION} build | |
tar xJf wget-${VERSION}.tar.xz |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Ajax upload example</title> | |
<link type="text/css" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" /> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" /> | |
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script> | |
<script type="text/javascript"> | |
function TransferCompleteCallback(content){ |
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
<?xml version="1.0" encoding="utf-8"?> | |
<DieCutLabel Version="8.0" Units="twips"> | |
<PaperOrientation>Portrait</PaperOrientation> | |
<Id>Small30332</Id> | |
<PaperName>30332 1 in x 1 in</PaperName> | |
<DrawCommands> | |
<RoundRectangle X="0" Y="0" Width="1440" Height="1440" Rx="180" Ry="180" /> | |
</DrawCommands> | |
<ObjectInfo> | |
<TextObject> |
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 | |
SERVER="web1" | |
DAYS_TO_BACKUP=7 | |
WORKING_DIR="/root/backup_tmp_dir" | |
BACKUP_MYSQL="true" | |
MYSQL_USER="root" | |
MYSQL_PASSWORD="your_db_root_password" | |
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 | |
SERVER="servername" | |
DAYS_TO_BACKUP=7 | |
WORKING_DIR="/root/backup_tmp_dir" | |
BACKUP_MYSQL="true" | |
MYSQL_USER="root" | |
MYSQL_PASSWORD="MyRootPassword" |
NewerOlder