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 | |
| set -e | |
| FLAG="$HOME/.lidsleep" | |
| if [[ -f $FLAG ]]; then | |
| sudo pmset -a disablesleep 0 | |
| rm $FLAG | |
| echo "lidsleep: enabled sleep on lid close" | |
| else |
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
| SLOT_FUEL, SLOT_PRODUCT, SLOT_SEED, SLOT_COVER = 1, 2, 4, 5 | |
| FUEL_TRESHOLD = 400 | |
| INTERVAL = 180 | |
| INIT = true | |
| START_CLK = os.clock() | |
| function move(action, count) | |
| count = count or 1 -- defaults param to 1 | |
| local ACT = { | |
| ["f"] = turtle.forward, |
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
| -- wget https://gist.github.com/daystram/1750d01b262e9fe236288bae036bb215/raw/dd.lua | |
| local prog_name = ... | |
| local gists = { | |
| autotree = "https://gist.github.com/daystram/f9eac6357f2ff245af3fb997019b0daf/raw/autotree.lua", | |
| autofarm = "https://gist.github.com/daystram/4fea7e3036383306d21e42fed8e0edb6/raw/autofarm.lua", | |
| automob = "https://gist.github.com/daystram/d14883a5e5b1e6f8cb6021a04a603375/raw/automob.lua", | |
| master = "https://gist.github.com/daystram/9805a84ee8a10f9d21f104f7a9fe8610/raw/master.lua", | |
| devmaster = "https://gist.github.com/daystram/27aa05e5d8c8ef6349b4ec0755a9ee7f/raw/devmaster.lua", | |
| devslave = "https://gist.github.com/daystram/a52fa122e849e559bc15bb83e36b979f/raw/devslave.lua" | |
| } |
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
| SLOT_FUEL, SLOT_SAPLING, SLOT_FERTILIZER, SLOT_LOG = 1, 2, 3, 4 | |
| FUEL_TRESHOLD = 400 | |
| init = true | |
| START_CLK = os.clock() | |
| function refuel(qty) | |
| turtle.select(SLOT_FUEL) | |
| local fuel = turtle.refuel(qty) | |
| turtle.select(SLOT_LOG) | |
| return fuel |
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
| up: | |
| @docker-compose pull | |
| @docker-compose up -d | |
| down: | |
| @docker-compose down | |
| pull: | |
| @docker-compose pull |
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
| which ssh-agent || ( apk add --update openssh ) | |
| eval $(ssh-agent -s) | |
| echo "[init] agent started" | |
| echo "$DEPLOY_KEY" | ssh-add - || true | |
| echo "init] key added" | |
| mkdir -p ~/.ssh | |
| echo "[init] .ssh dir created" | |
| chmod 700 ~/.ssh | |
| echo "[init] dir chmod" | |
| [[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config |
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
| export GOPATH=${CI_PROJECT_DIR}/go | |
| mkdir -p ${GOPATH}/src/${GOPROJECT} | |
| mv * ${GOPATH}/src/${GOPROJECT} > /dev/null || true | |
| cd ${GOPATH}/src/${GOPROJECT} |
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 redis | |
| import time | |
| count = 5000 | |
| r = redis.Redis(host='localhost', port=6379, db=0) | |
| line = '{\ | |
| "OrderID":"%d",\ | |
| "LastTime":"2019-11-14T20:06:48.0202697+07:00",\ |
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 time | |
| import gevent | |
| from websocket import create_connection | |
| from locust import HttpLocust, TaskSet, task | |
| from locust.events import request_success | |
| class UserTaskSet(TaskSet): | |
| @task(1) |
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
| // initialization | |
| redisHost := conf.AppConfig.RedisHost | |
| redisConn := &redis.Pool{ | |
| Dial: func() (redis.Conn, error) { | |
| return redis.Dial("tcp", redisHost) | |
| }, | |
| MaxIdle: 5, | |
| IdleTimeout: 0, | |
| MaxConnLifetime: 0, | |
| } |
NewerOlder