I'm trying to figure out how to use rebar to:
- create erlang project
- add a dependency on an erlang module from github
- start the app via the erl console
- create a release and start the app from the release (via the generated scripts)
| obj-m += tcp_svr_sample.o | |
| all: | |
| make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules | |
| clean: | |
| make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clea |
| # my copy redis.conf | |
| # changes | |
| # 1. dir | |
| # 2. daemonize yes | |
| # 3. maxmenory 100MB | |
| # 4. logfile /var/log/redis.log | |
| # | |
| # | |
| # Redis configuration file example | |
| # |
| #!/bin/sh | |
| # http://vm-192-168-11-21.shengyun.grandcloud.cn/topics/2437 | |
| # redis - this script starts and stops the redis-server daemon | |
| # | |
| # chkconfig: 2345 90 10 | |
| # description: Redis is a persistent key-value database | |
| # processname: redis-server | |
| # config: /etc/redis.conf | |
| # config: /etc/sysconfig/redis | |
| # pidfile: /var/run/redis.pid |
| 1.CentOS 6.3 | |
| #yum install make gcc | |
| #cd /opt | |
| $wget http://redis.googlecode.com/files/redis-2.x.xx.tar.gz | |
| $tar zxf redis-2.x.xx.tar.gz | |
| $cd redis-2.x.xx | |
| $make | |
| $make install | |
| ////// |
| #!/bin/bash | |
| # Install fake erlang packages, then the ESL package | |
| # Afterwards, installing packages that depend on erlang, like rabbitmq, | |
| # will use the ESL packaged erlang without installing the older disto ones | |
| # | |
| apt-get install equivs | |
| # Create fake erlang packages, since we are using esl-erlang instead | |
| cd /tmp | |
| apt-get install -y equivs |
| def to_tbcd(binary_string): | |
| """ | |
| tbcd decoding in one line | |
| function takes argument in a form "0b10110101001" and translates it into a string | |
| presentation of integer by tbcd standards | |
| http://en.wikipedia.org/wiki/Binary-coded_decimal#Telephony_Binary_Coded_Decimal_.28TBCD.29 | |
| """ | |
| return "".join(str(int(binary_string[index: index + 4], 2)) if int(binary_string[index + 4:index + 8], 2) == 15 else "%s%s" % (int(binary_string[index + 4:index + 8], 2), int(binary_string[index: index + 4], 2)) for index in range(2, len(binary_string), 8)) |
| #!/bin/bash | |
| # As the "bufferbloat" folks have recently re-discovered and/or more widely | |
| # publicized, congestion avoidance algorithms (such as those found in TCP) do | |
| # a great job of allowing network endpoints to negotiate transfer rates that | |
| # maximize a link's bandwidth usage without unduly penalizing any particular | |
| # stream. This allows bulk transfer streams to use the maximum available | |
| # bandwidth without affecting the latency of non-bulk (e.g. interactive) | |
| # streams. |
| %% @author Masahito Ikuta <cooldaemon@gmail.com> [http://d.hatena.ne.jp/cooldaemon/] | |
| %% @copyright Masahito Ikuta 2008 | |
| %% @doc UDP Server Behaviour. | |
| %% Copyright 2008 Masahito Ikuta | |
| %% | |
| %% Licensed under the Apache License, Version 2.0 (the "License"); | |
| %% you may not use this file except in compliance with the License. | |
| %% You may obtain a copy of the License at | |
| %% |
| ## This file is not now part of Scapy | |
| ## Look iniqua.com for more informations | |
| ## ffranz <ffranz@iniqua.com> | |
| ## This program is published under a GPLv2 license | |
| import time | |
| import logging | |
| from scapy.packet import * | |
| from scapy.fields import * |