echo '
#! /bin/bash
####### yum update is optional #####
#yum -y update
yum install firewalld -y
systemctl start firewalld
firewall-cmd --add-port=8300/tcp --add-port=8301/tcp --add-port=8302/tcp --add-port=8400/tcp --add-port=8500/tcp --add-port=80/tcp --add-port=443/tcp --permanent
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/env bash | |
echo=echo | |
for cmd in echo /bin/echo; do | |
$cmd >/dev/null 2>&1 || continue | |
if ! $cmd -e "" | grep -qE '^-e'; then | |
echo=$cmd | |
break | |
fi | |
done |
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
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.UI; | |
// attach to UI Text component (with the full text already there) | |
public class UITextTypeWriter.cs : MonoBehaviour | |
{ | |
Text txt; |
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
yum install -y epel-release | |
yum install -y bind-utils unzip jq | |
cd ~/ | |
wget https://releases.hashicorp.com/consul/1.0.2/consul_1.0.2_linux_amd64.zip | |
unzip consul_1.0.2_linux_amd64.zip | |
mv consul /usr/local/bin/ | |
adduser consul | |
mkdir /etc/consul.d | |
chown -R consul:consul /etc/consul.d/ | |
mkdir /var/consul |
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
IEnumerator Start() { | |
while(true) { | |
yield return new WaitForSeconds(1f); | |
OutputTime(); | |
} | |
} | |
void OutputTime() { | |
Debug.Log(Time.time); | |
} |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
type Language struct { | |
Id int | |
Name string |
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
one := []byte{} | |
c.SetReadDeadline(time.Now()) | |
if _, err := c.Read(one); err == io.EOF { | |
l.Printf(logger.LevelDebug, "%s detected closed LAN connection", id) | |
c.Close() | |
c = nil | |
} else { | |
var zero time.Time | |
c.SetReadDeadline(time.Now().Add(10 * time.Millisecond)) | |
} |
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
import ( | |
"github.com/launchdarkly/foundation/logger" | |
"runtime" | |
) | |
func GoSafely(fn func()) { | |
go func() { | |
defer func() { | |
if err := recover(); err != nil { |
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
### IMPROVE SYSTEM MEMORY MANAGEMENT ### | |
# Increase size of file handles and inode cache | |
fs.file-max = 2097152 | |
# Do less swapping | |
vm.swappiness = 10 | |
vm.dirty_ratio = 60 | |
vm.dirty_background_ratio = 2 |
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
# see How to Install Redis Server on CentOS 7 - http://linoxide.com/storage/install-redis-server-centos-7/ | |
# --- Compiling --- | |
$ yum install gcc make tcl | |
$ REDIS_VER=3.2.3 | |
$ wget http://download.redis.io/releases/redis-$REDIS_VER.tar.gz | |
$ tar xzvf redis-$REDIS_VER.tar.gz | |
$ cd redis-$REDIS_VER | |
$ make | |
$ make test |
NewerOlder