This file contains hidden or 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
import scala.io.Source._ | |
import java.lang.Character.{isWhitespace => isSpace} | |
import scala.annotation.tailrec | |
def parseLine(s: String): (String, Seq[String]) = { | |
parseCommand(s.iterator) | |
} | |
def parseCommand(s: Iterator[Char]): (String, Seq[String]) = { | |
val elements = parseElements(s) |
This file contains hidden or 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
rtmp { | |
server { | |
listen 0.0.0.0:1935; | |
chunk_size 4096; | |
# The collection server, streaming allowed from standard local /16 subnets | |
# Stream to rtmp://<server ip>/collect/<stream key> |
This file contains hidden or 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
public class ShellPong { | |
private static final int width = 80; | |
private static final int height = 24; | |
private static final char CORNER = '+'; | |
private static final char H_WALL = '-'; | |
private static final char V_WALL = '|'; | |
private static final char PADDLE = '#'; | |
private static final char BALL = 'O'; |
This file contains hidden or 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 | |
gitlab_user="git" | |
if [[ "$(whoami)" == "$gitlab_user" ]] | |
then | |
echo "Searching for errors and corecting them" | |
else | |
echo "Nope, wrong user. Trying to login as $gitlab_user" | |
su "$gitlab_user" -c "$0" |
This file contains hidden or 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
key=${1?No domain key given!} | |
domain=${2?No domain name given!} | |
opendkim_base="/etc/opendkim" | |
opendkim_user="opendkim" | |
opendkim_group="opendkim" | |
key_path="${opendkim_base}/keys/${domain}" | |
mkdir -p "$key_path" |
This file contains hidden or 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 | |
app_path="${1?No app source path given}" | |
app_name="$(basename "$app_path" | sed -r "s/\.app$//g")" | |
echo "$app_name" | |
dmg_size="$(du -ms "$app_path" | grep -oP "^\d+")" | |
dmg_path=$(sed -r "s/\.app\/?$/.dmg/g" <<< "$app_path") |
This file contains hidden or 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 | |
# REDMINE | |
# Maintainer: @thanhhh | |
# App Version: 2.3.1 | |
APP_ROOT="/home/redmine/redmine" | |
APP_USER="redmine" | |
DAEMON_OPTS="-C $APP_ROOT/config/puma.rb" | |
PID_PATH="$APP_ROOT/tmp/pids" |
This file contains hidden or 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 puma | |
# Start Puma with next command: | |
# RAILS_ENV=production bundle exec puma -C ./config/puma.rb | |
# uncomment and customize to run in non-root path | |
# ENV['RAILS_RELATIVE_URL_ROOT'] = "/redmine" | |
application_path = '/home/redmine/redmine' |
This file contains hidden or 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
Add config/puma.ruby | |
-------------------- | |
cd /home/redmine/redmine | |
sudo -u redmine -H curl --output config/puma.rb https://gist.github.com/quickwango/6043161/raw/fdfe2a865c3a0afe912c8784c971ea7ca3e64cfd/puma.rb | |
Install Init Script | |
-------------------- | |
Download the init script (will be /etc/init.d/redmine): | |
This file contains hidden or 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
permissions: | |
essentials: | |
heal: | |
- create | |
- remove | |
sell: | |
- create | |
commands: | |
- * |