Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Failing to plan is planning to fail

Ryan Khasky khasky

💭
Failing to plan is planning to fail
View GitHub Profile
@khasky
khasky / mysql-backup.sh
Last active Feb 21, 2021
Bash MySQL backup for all databases
View mysql-backup.sh
#!/bin/bash
USER=root
PASSWORD=root
DATE_NOW="`date '+%Y-%m-%d_%H-%M-%S'`"
DIR=/var/local/backup
DATABASES=`mysql -u$USER -p$PASSWORD -e "SHOW DATABASES;" | tr -d "| " | grep -v Database`
echo "Databases found: $DATABASES"
@khasky
khasky / khasky.com-reverse-proxy.conf
Created Jul 22, 2020
Apache2 reverse proxy for NodeJS server
View khasky.com-reverse-proxy.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
# ...config
# NodeJS server start
ProxyRequests Off
ProxyPreserveHost On
ProxyVia Full
<Proxy *>
@khasky
khasky / khasky.com-le-ssl.conf
Created Jul 22, 2020
Apache2 VPS https conf
View khasky.com-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin hello@khasky.com
ServerName khasky.com
ServerAlias www.khasky.com
DocumentRoot /var/www/khasky.com/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/khasky.com/fullchain.pem
@khasky
khasky / khasky.com.conf
Created Jul 22, 2020
Apache2 VPS http conf
View khasky.com.conf
<VirtualHost *:80>
ServerAdmin hello@khasky.com
ServerName khasky.com
ServerAlias www.khasky.com
DocumentRoot /var/www/khasky.com/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =khasky.com [OR]
@khasky
khasky / mysql-backup-tar-gz.sh
Last active Feb 21, 2021
Bash MySQL backup to tar.gz for single database
View mysql-backup-tar-gz.sh
#!/bin/bash
MYSQL_USER=root
MYSQL_PASS=root
MYSQL_DB=test
BACKUP_DIR=/var/local/backup
LOGS_DIR=/var/log
# Equals to 3 last days
@khasky
khasky / build.gradle
Created Dec 9, 2018
Gradle build task for Killing Floor Server Watcher (https://github.com/khasky/killingfloor-server-watcher)
View build.gradle
apply plugin: 'java'
def buildVersion = '0.4.0'
repositories {
mavenCentral()
}
dependencies {
compile 'mysql:mysql-connector-java:5.1.40'
@khasky
khasky / ucc_make.cmd
Last active Feb 21, 2021
Backup, compile and compress Killing Floor mutator using UCC (UnrealScript)
View ucc_make.cmd
rem # Created by poosh (https://github.com/poosh) and edited by Khasky (https://github.com/khasky)
rem # PLEASE NOTE: For compile mutator using this batch you should append your package to EditPackages of /System/KillingFloor.ini
@echo off
color 07
setlocal
set MUT=CuzusXSPTest
set KFDIR=C:\kfdev
@khasky
khasky / unrealscript.xml
Created Mar 19, 2017
Notepad++ UnrealScript syntax highlighting
View unrealscript.xml
<NotepadPlus>
<UserLang name="UnrealScript" ext="uc" udlVersion="2.1">
<Settings>
<Global caseIgnored="yes" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">03/* 03/** 04*/ 00// 01 02</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>