Skip to content

Instantly share code, notes, and snippets.

@MOZGIII
MOZGIII / start.sh
Last active March 20, 2016 16:13
Start script for RVM + Thin + unix socket. Should be located in the project's root directory.
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
sudo -u www-data touch $DIR/tmp/sockets/thin.sock
rvmsudo -u www-data bundle exec thin start -C thin.yml --socket $DIR/tmp/sockets/thin.sock
@MOZGIII
MOZGIII / msm.conf
Created January 8, 2013 07:10
Minecraft Server Manager config
#
# Minecraft Server Manager Configuration File
# ===========================================
#
#
# User
# ----
# The user which Minecraft Server Manager commands will be executed as.
@MOZGIII
MOZGIII / mcpinger
Last active June 17, 2023 22:14
Minecraft Server Pinger for server hang detection written on Bash
#!/bin/bash
# Minecraft Server Pinger
#
# If the server is pining successfully exits with 1,
# else (if server hangs) exits with 0.
HOST=$1
PORT=$2
if [[ "x$HOST" == "x" || "x$PORT" == "x" ]]; then
@MOZGIII
MOZGIII / langdirfix.sh
Last active December 11, 2015 11:59
Disable Ubuntu user direcories localization. Just run it and press Update Names to change the names to english.
#!/bin/bash
if [ ! -f "${HOME}/.config/user-dirs.dirs" ]; then
echo "No user-dirs.dirs found, will not proceed"
exit
fi
if [ ! -f "${HOME}/.config/user-dirs.locale" ]; then
echo "No user-dirs.locale found, forcing generation of current-locale one"
xdg-user-dirs-update --force
@MOZGIII
MOZGIII / README.md
Last active December 17, 2015 13:09
Sublime Text 3 (or 2 or any) context-menu integration for Windows. For x64 version.

Usage

Create theese files and run them. You'll have "Open with Sublime Text" in the explorer's context menu.

@MOZGIII
MOZGIII / qt_plugins_deps_filter
Created June 9, 2013 13:06
Filter Qt plugins by dependencies
#!/usr/bin/env ruby
allowed_libs = %w{
libQtCore.so.4
libQtNetwork.so.4
libQtWebKit.so.4
libQtGui.so.4
}
puts "Allowed libs: "
@MOZGIII
MOZGIII / lettersmixer.rb
Last active December 23, 2015 22:19
LettersMixer - simple letters mixing
# encoding: UTF-8
module LettersMixer
REGEXP = /[A-zА-я]{2,}/
DEFAULT_MODE = :shuffle
module Modes
def self.full_shuffle(word, options = {})
word.split("").shuffle(options).join
end
@MOZGIII
MOZGIII / swipl-linkage.pri
Last active December 26, 2015 08:39
qmake helper to link swipl with qt
# Set swipl binary
isEmpty(SWIPL_BINARY) {
SWIPL_BINARY="swipl"
}
# Load options from swipl
isEmpty(PLDUMP) {
PLDUMP = $$system(\"$$SWIPL_BINARY\" --dump-runtime-variables)
}
@MOZGIII
MOZGIII / gist:7574210
Created November 21, 2013 01:00
A Path variable from clean Windows 7 system
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
@MOZGIII
MOZGIII / run-minecraft.sh
Last active March 27, 2022 21:58
A templete script to launch Minecraft with Forge without using launcher when playing offline
#!/bin/bash
MINECRAFT_USERNAME="MOZGIII"
MINECRAFT_SESSION="-"
MINECRAFT_RAM_MAX_HEAP_SIZE=4G
MINECRAFT_RAM_STARTING_HEAP_SIZE=1G
MINECRAFT_RAM_GC_MAX_PERM_SIZE=256M
MINECRAFT_ROOT="$APPDATA/.minecraft"
MINECRAFT_JAVA="C:/Program Files/Java/jre7/bin/java.exe"