Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonathan Rosewood Jonathan-Rosewood

View GitHub Profile
View gist:d23d553e88e3d9863c9507c0f51add99
[root@plex ~]# cat /etc/systemd/system/minecraft@.service
[Unit]
Description=Minecraft Server %i
[Service]
WorkingDirectory=/opt/minecraft-%i
User=mcserver
ExecStart=/usr/bin/screen -DmS mc-%i /bin/java -Xmx2048M -jar minecraft_server.jar nogui
@Jonathan-Rosewood
Jonathan-Rosewood / README.md
Created Jun 9, 2017 — forked from zenorocha/README.md
A template for Github READMEs (Markdown) + Sublime Snippet
View README.md

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@Jonathan-Rosewood
Jonathan-Rosewood / README-Template.md
Created Jun 9, 2017 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@Jonathan-Rosewood
Jonathan-Rosewood / lxc-prep
Created May 28, 2017 — forked from starkers/lxc-prep
Install SSH keys into lxc containers
View lxc-prep
#!/usr/bin/env bash
if [ "X$1" == X ]; then
echo "prepares a new container does the following:"
echo "- installs ssh keys from $KEYS"
echo "- sets random root passwords"
echo "- deletes the 'ubuntu' user"
echo
echo "usage: 'lxc-prep <container_name>'"
echo
@Jonathan-Rosewood
Jonathan-Rosewood / gist:e8cdf891c08e1e38e0ed322462f70d50
Created Apr 9, 2017
Hazel external application directory symlinker
View gist:e8cdf891c08e1e38e0ed322462f70d50
#!/bin/bash
application="$1"
internal_applications_dir="/Applications"
external_applications_dir="/Volumes/Storage/Applications"
if [ ! -L "$internal_applications_dir/$application" ]; then
ln -s $external_applications_dir/$application $internal_applications_dir/
fi
View Preferences.sublime-settings
{
"tab_size": 4,
"translate_tabs_to_spaces": true,
"fallback_encoding": "Cyrillic (Windows 1251)",
"overlay_scroll_bars" : "enabled",
"highlight_line" : true,
"highlight_modified_tabs" : true,
"trim_trailing_white_space_on_save" : true,
"line_padding_top" : 3,
@Jonathan-Rosewood
Jonathan-Rosewood / rgba_argb.pwn
Created Oct 7, 2015 — forked from brbsh/rgba_argb.pwn
Functions to operate RGBA & ARGB hex colors in PAWN
View rgba_argb.pwn
cutAlphaRGBA(rgbacolor) return (rgbacolor >>> 8); // вернет цвет с вырезанной прозрачностью
cutAlphaARGB(argbcolor) return (argbcolor & 0xFFFFFF);
setAlphaRGBA(rgbacolor, alpha = 0xFF) return (cutAlphaRGBA(rgbacolor) | alpha); // вернет цвет с установленной прозрачностью
setAlphaARGB(argbcolor, alpha = 0xFF) return (cutAlphaARGB(argbcolor) | (alpha << 24));
getAlphaRGBA(rgbacolor) return (rgbacolor & 0xFF); // вернет альфу
getAlphaARGB(argbcolor) return (argbcolor >>> 24);
bool:hasAlphaRGBA(rgbacolor) return (getAlphaRGBA(rgbacolor) != 0 && ((rgbacolor >>> 24) != 0));
bool:hasAlphaARGB(argbcolor) return (getAlphaARGB(argbcolor) != 0 && ((argbcolor >>> 8) != 0));
torgba(rgbacolor, &r, &g, &b, &a) // разобьет цвет на состовляющие (red, green, blue, alpha)
You can’t perform that action at this time.