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 ArticleImageUploader < ImageUploader | |
process :fix_exif_rotation | |
process :strip | |
process :convert => 'jpg' | |
process :quality => 85 # Percentage from 0 - 100 | |
version :gallery_thumb do | |
process :resize_to_fill => Settings.images.article_images.processing.gallery_thumb #44x44 | |
end |
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
mysql -h $1 -e "create database $3 CHARACTER SET $character_set" | |
TRIGGERS=`mysql -h $1 $2 -e "show triggersG" | grep Trigger: | awk '{print $2}'` | |
VIEWS=`mysql -h $1 -e "select TABLE_NAME from information_schema.tables where table_schema='$2' and TABLE_TYPE='VIEW'" -sss` | |
if [ -n "$VIEWS" ]; then | |
mysqldump -h $1 $2 $VIEWS > /tmp/${2}_views${TIMESTAMP}.dump | |
fi | |
mysqldump -h $1 $2 -d -t -R -E > /tmp/${2}_triggers${TIMESTAMP}.dump | |
for TRIGGER in $TRIGGERS; do | |
echo "drop trigger $TRIGGER" | |
mysql -h $1 $2 -e "drop trigger $TRIGGER" |
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/python | |
# Inspired by https://isc.sans.edu/forums/diary/When+Google+isnt+Google/15968/ | |
# | |
# Written in Python to reuse built-in Python batteries and not depend on | |
# presence of host and cut commands | |
# | |
import sys | |
import socket | |
def process_args(argv): |
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
ls -t /var/log/nginx/access.log.*.gz | xargs zcat | awk '{print $1}' | sort | uniq -c | sort -nr | head -n 100 |
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 | |
display_usage() { | |
echo "This script must be run with super-user privileges." | |
echo -e "\nUsage:\n$0 [es-version e.g.: "2.3.3"] \n" | |
} | |
# check whether user had supplied -h or --help . If yes display usage | |
if [[ ( $# == "--help") || $# == "-h" ]] | |
then |
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 SitemapSettings | |
DEFAULT_HOST = 'http://www.example.com' | |
PUBLIC_PATH = 'private/' | |
SITEMAPS_PATH_NEW = 'sitemapsnew/' | |
SITEMAPS_PATH_PUBLISHED = 'sitemaps/' | |
DEFAULT_PRIORITY_MAP = [0.5] | |
end |
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 | |
# Location of the nginx config file that contains the CloudFlare IP addresses. | |
CF_NGINX_CONFIG="/etc/nginx/cloudflare-real-ip.conf" | |
CF_NGINX_CONFIG_NEW="/etc/nginx/cloudflare-real-ip.conf.new" | |
# The URLs with the actual IP addresses used by CloudFlare. | |
CF_URL_IP4="https://www.cloudflare.com/ips-v4" | |
CF_URL_IP6="https://www.cloudflare.com/ips-v6" |
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"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.operatornew</groupId> | |
<artifactId>spring-boot-mysql</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<packaging>jar</packaging> |
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
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | |
<java.version>1.8</java.version> | |
<db.name>game_manager</db.name> | |
<jdbc.driverClassName>com.mysql.jdbc.Driver</jdbc.driverClassName> | |
<jdbc.url>jdbc:mysql://localhost/${db.name}?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC</jdbc.url> | |
<jdbc.username>username</jdbc.username> | |
<jdbc.password>password</jdbc.password> | |
</properties> |
OlderNewer