Set values in:
/etc/security/limits.conf
Needs to be enabled in:
/etc/pam.d/common-session
/etc/pam.d/common-session-noninteractive
by adding:
| {-# LANGUAGE OverloadedStrings #-} | |
| -- | Hello world Wai+Warp applicaion server. Used GHC 7.4, Wai 1.1, Warp 1.1 versions. | |
| module Main where | |
| import Network.HTTP.Types (status200) | |
| import Network.Wai (Application,responseLBS) | |
| import Network.Wai.Handler.Warp (run) | |
| -- | Hello word Wai application. |
| {-# LANGUAGE OverloadedStrings #-} | |
| -- | Converts a matrix represented as text to Hmatrix Matrix. Used GHC 7.4, Hmatrix 0.14. | |
| module Main where | |
| import qualified Data.Text as T | |
| import qualified Data.Text.IO as TIO | |
| import Data.Text (Text,splitOn,lines) | |
| import Data.Text.Read (double) | |
| import Data.Packed.Matrix (Matrix,fromLists) |
| {-# LANGUAGE OverloadedStrings #-} | |
| -- | Wai+Warp file server. Used GHC 7.4, Wai 1.1, Warp 1.1 versions. | |
| module Main where | |
| import Network.Wai.Handler.Warp (run) | |
| import Network.Wai.Application.Static | |
| ( StaticSettings(..) | |
| , staticApp | |
| , fileSystemLookup |
| {-# LANGUAGE OverloadedStrings #-} | |
| -- | Wai+Warp file server with routes. Used GHC 7.4, Wai 1.1, Warp 1.1 versions. | |
| module Main where | |
| import Network.HTTP.Types (status200) | |
| import Network.Wai (Application,responseLBS) | |
| import Network.Wai.Middleware.Router (router,dir) | |
| import Network.Wai.Handler.Warp (run) | |
| import Network.Wai.Application.Static |
| # Use white space as delimiter and return the 1st | |
| # field and all fields including and after the | |
| # 7th field. | |
| cut -d' ' -f1,7- |
Set values in:
/etc/security/limits.conf
Needs to be enabled in:
/etc/pam.d/common-session
/etc/pam.d/common-session-noninteractive
by adding:
| #!/bin/bash | |
| USR=$1 | |
| su $USR --shell /bin/bash --comman "ulimit -n" |
| // Copyright 2014 The go-gl Authors. All rights reserved. | |
| // Use of this source code is governed by a BSD-style | |
| // license that can be found in the LICENSE file. | |
| package main | |
| import ( | |
| "fmt" | |
| "runtime" |
| package main | |
| import ( | |
| "fmt" | |
| "runtime" | |
| "github.com/go-gl/gl" | |
| glfw "github.com/go-gl/glfw3" | |
| ) |
| // Copyright 2012, Google Inc. All rights reserved. | |
| // Use of this source code is governed by a BSD-style | |
| // license that can be found in the LICENSE file. | |
| // Write file to temp and atomically move when everything else succeeds. | |
| func WriteFileAtomic(filename string, data []byte, perm os.FileMode) error { | |
| dir, name := path.Split(filename) | |
| f, err := ioutil.TempFile(dir, name) | |
| if err != nil { | |
| return err |