Skip navigation

Category Archives: Uncategorized

var Remote = require('ripple-lib').Remote;
var Amount = require('ripple-lib').Amount;

var MY_ADDRESS = 'public_key';
var MY_SECRET = 'private_key';

var SPURKLE = 'gateway_public_key';

var remote = new Remote({
// trace: true,
trusted: true,
local_signing: true,
secure: true,
servers: [
{
host : 's1.Ripple.com',
port : 443,
ssl : true
}]
});

console.log( 'Starting: %s', JSON.stringify( remote.servers ) );

remote.connect( function() {

console.log( 'Connected.' );

// remote.on('transaction_all', transactionListener);

// remote.on('ledger_closed', ledgerListener);

remote.set_secret( MY_ADDRESS, MY_SECRET );

var transaction = remote.transaction();

transaction.offer_create({
from: MY_ADDRESS,
taker_pays: { currency: 'EUR', value: '1', issuer: SPURKLE },
taker_gets: { currency: 'USD', value: '1.3', issuer: SPURKLE }
});

transaction.submit( function( err, res ) {

console.log( JSON.stringify( err, null, 4 ) );

console.log( JSON.stringify( res, null, 4 ) );
});

});

function transactionListener (transaction_data) {
// handle transaction_data
// see https://ripple.com/wiki/RPC_API#transactions_stream_messages for the format of transaction_data
console.log(transaction_data);
}

function ledgerListener (ledger_data) {
// handle ledger_data
// see https://ripple.com/wiki/RPC_API#ledger_stream_messages for the format of ledger_data
console.log(ledger_data);
}

https://ripple.com/wiki/Arbitrage

https://ripple.com/wiki/Example_API_Transactions


git push origin 7b60af4738e866eb3ddbcb1073ef8f2946db9f9c:master

Note that all commits before the specified one are also pushed. If you want to push just one commit, rebase -i first and then move the wanted commit at the top of the queue.

https://help.github.com/articles/using-ssh-agent-forwarding


git checkout [commit hash]
git checkout -b new_branch

You can then rebase that against your mainline when you are ready to merge those changes:


git checkout new_branch
git rebase master
git checkout master
git merge new_branch


vcaruso@vcaruso-mba:~/workspace$ git clone https://github.com/ripple/ripple-rest
vcaruso@vcaruso-mba:~/workspace$ cd ripple-rest/
vcaruso@vcaruso-mba:~/workspace/ripple-rest$ npm install

Note that if DATABASE_URL is not defined, you’ll get the following:
No DATABASE_URL specified, defaulting to sqlite3 in memory. DO NOT USE THIS FOR A PRODUCTION SYSTEM

which means that ripple-rest will run with sqlite3, which is perfectly fine for dev purposes. However, you still need to create a config.js to explicitly say that you want to run sqlite3:

vcaruso@vcaruso-mba:~/workspace/ripple-rest$ cat config.json
{
"config_version": "0.0.1",
"PORT": 5990,
"NODE_ENV": "development",
"HOST": "localhost",
"DATABASE_URL": ""
"ssl": {
"key_path": "./certs/server.key",
"cert_path": "./certs/server.crt"
},
"rippled_servers": [
{
"host": "localhost",
"port": 443,
"secure": true
}
]
}

At this point, you can start the web server:

Install dependencies with home-brew:

$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
$ brew update
$ brew install git scons ctag pkg-config protobuf openssl boost
$ ln -s /usr/local/lib/libboost_thread-mt.a /usr/local/lib/libboost_thread.a
$ ln -s /usr/local/lib/libboost_thread-mt.dylib /usr/local/lib/libboost_thread.dylib

Clone and build rippled:

$ git clone git@github.com:ripple/rippled.git
$ cd rippled
$ git checkout master
$ scons

Run tests:

$ brew install node.js
$ npm install
$ npm test

git branch --set-upstream arcpatch-D614 origin/master


git checkout --theirs path/to/file.cpp
git add path/to/file.cpp

1. create feature branch from master:

git checkout -b new_branch

2. commit in local branch…

git add...
git commit...

3. pull into master from remote

git checkout master && git pull

4. rebase master into new_branch

git checkout new_branch && git rebase -i master

5. push changes directly to remote

git push origin HEAD:master

5. OR rebase new_branch into master (or merge)

git checkout master && git rebase new_feature

6. push from local/master to origin/master

git push

Running multiple heads with multiple video cards has usually been a pain under Linux. The only viable option was Xinerama which is a full software solution of awful performances, specially when driving 3 or 4 displays at 2560×1600 resolution each.

After lots of digging around and infinite Xorg reboots I found that Nvidia drivers offers this “Mosaic” mode that allows screen composition natively. Here’s my Xorg.conf that uses this feature:

Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
HorizSync 28.0 - 33.0
VertRefresh 43.0 - 72.0
Option "DPMS"
EndSection

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "Quadro NVS 295"
BusID "PCI:3:0:0"
EndSection

Section "Device"
Identifier "Device1"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "Quadro NVS 295"
BusID "PCI:4:0:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "BaseMosaic" "True"
Option "MetaModes" "GPU-0.DFP-2: 2560x1600 +0+0, GPU-1.DFP-2: 2560x1600 +2560+0 {rotation=90}, GPU-1.DFP-3: 2560x1600 +4160+0 {rotation=90}"
SubSection "Display"
Depth 24
EndSubSection
EndSection

Section "Screen"
Identifier "Screen1"
Device "Device1"
Monitor "Monitor0"
DefaultDepth 24
Option "BaseMosaic" "True"
Option "MetaModes" "GPU-0.DFP-2: 2560x1600 +0+0, GPU-1.DFP-2: 2560x1600 +2560+0 {rotation=90}, GPU-1.DFP-3: 2560x1600 +4160+0 {rotation=90}"
SubSection "Display"
Depth 24
EndSubSection
EndSection

This is a triple head with the left most display in landscape mode and the two central displays are in portrait mode. I have a right most display attached to a mac mini to keep my view symmetric.

vcaruso@zeus: ~ $ ./a.out
100000 system calls in 13590810 ticks (135.9 ticks/syscall)

vcaruso@zeus: $ netstat -anp | grep 44499
udp 0 0 0.0.0.0:44499 0.0.0.0:* 28282/exec.bin

vcaruso@zeus: $ lsof -i -n | grep 44499
exec.bin 28282 vcaruso 77u IPv4 25738300 0t0 UDP *:44499

http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel

look out for RX-ERR RX-DRP and RX-OVR counters:

netstat -i

http://beyond-syntax.com/blog/2011/03/diving-into-linux-networking-i/

In /usr/share/vte/termcap/xterm

change the following line

:co#80:it#8:li#24:\

to something like:

:co#197:it#8:li#35:\

to change it from 80×24 to 197×35

gawk '/^r[0-9]+/ { lines[$3]+=$13 } END { for(j in lines) print lines[j],j }' svn.log | sort -n

http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html

netstat –tcp –udp –numeric-ports –listening –program

http://jaqque.sbih.org/kplug/apt-pinning.html


tshark -r enxt_drops.pcap -qz io,stat,0,"COUNT(tcp.analysis.retransmission)tcp.analysis.retransmission","COUNT(tcp.analysis.duplicate_ack)tcp.analysis.duplicate_ack","COUNT(tcp.analysis.lost_segment)tcp.analysis.lost_segment","COUNT(tcp.analysis.fast_retransmission)tcp.analysis.fast_retransmission"


-z io,stat,interval[,filter][,filter][,filter]...
Collect packet/bytes statistics for the capture in intervals of interval seconds. Interval can be specified either as a whole or fractional second and can be specified with ms
resolution. If interval is 0, the statistics will be calculated over all packets.
NOTE: One important thing to note here is that the field that the calculation is based on MUST also be part of the filter string or else the calculation will fail.

So: -z io,stat,0.010,AVG(smb.time) does not work. Use -z io,stat,0.010,AVG(smb.time)smb.time instead. Also be aware that a field can exist multiple times inside the same
packet and will then be counted multiple times in those packets.


-q When capturing packets, don't display the continuous count of packets captured that is normally shown when saving a capture to a file; instead, just display, at the end of the
capture, a count of packets captured. On systems that support the SIGINFO signal, such as various BSDs, you can cause the current count to be displayed by typing your "status"
character (typically control-T, although it might be set to "disabled" by default on at least some BSDs, so you'd have to explicitly set it to use it).

When reading a capture file, or when capturing and not saving to a file, don't print packet information; this is useful if you're using a -z option to calculate statistics and
don't want the packet information printed, just the statistics.

1. install sysstat

2. enable data collection in /etc/default/sysstat

3. start the service: /etc/init.d/sysstat start

4. run the tool:

root@host: ~ # sar -s 13:01:21 -e 13:01:40 -w
Linux 2.6 03/01/12 _x86_64_ (12 CPU)

13:01:21 proc/s cswch/s
13:01:22 52.00 57557.00
13:01:23 0.00 75695.00
13:01:24 0.00 122679.00
13:01:25 0.00 80109.00
13:01:26 0.00 55006.00
13:01:27 0.00 42990.00
13:01:28 0.00 51180.00
13:01:29 0.00 59459.00
13:01:30 0.00 85123.00
13:01:31 0.00 55906.00
13:01:32 0.00 163697.00
13:01:33 0.00 99772.00
13:01:34 0.00 79942.00
13:01:35 0.00 38069.00
13:01:36 0.00 54133.00
13:01:37 0.00 57068.00
13:01:38 0.00 59709.00
13:01:39 0.00 63427.00
13:01:40 0.00 62869.00
Average: 2.74 71810.00

Delay not, Caesar. Read it instantly.
— Shakespeare, “Julius Caesar” 3,1

Here is a letter, read it at your leisure.
— Shakespeare, “Merchant of Venice” 5,1

[Quoted in “VMS Internals and Data Structures”, V4.4, when
referring to I/O system services.]

=A1/86400+DATEVALUE(“1/1/1970”)

http://www.alexonlinux.com/msi-x-the-right-way-to-spread-interrupt-load

You’ll find plenty of guides on the web to root your HTC Desire 2.2.2 with Unrevoked.

I followed one of them and I got stuck with the “Error: failed to get root. Is your firmware too new?”.

This seems to be a recurrent error happening with Unrevoked version 3.32 and HTC Desire with stock firmware.

I got around the problem just by using Unrevoked 3.21. You can get the older version of Unrevoke by searching it on google, or just use the one uploaded here: http://www.filecrop.com/unrevoked-3.21.html

Good luck!

http://www.parashift.com/c++-faq-lite/index.html

Over the past few years I’ve tried many combination: console svn + eclipse, subeclipse, subversive, etc…

With eclipse indigo I think I’ve found the perfect combination: subversive 2.2.2 + subversive java HL connector + java hl 1.6 + svn 1.6.

Installation procedure:

1. Install svn (apt-get install svn)
2. Install the java svn bridge (apt-get install libsvn-java)
3. Install eclipse helios (from http://www.eclipse.org)
4. Install the subversive plug-in for eclipse (Help->Install New Software->Indigo Repository->Collaboration->Subversive SVN)

Tweaks:
1. Add libjavasvn to the JVM library path: add ‘-Djava.library.path=/usr/lib/jni’ to the ‘-vmargs’ section of eclipse.ini
2. Fix the gnome keyring access violation: add ‘password-stores =’ to the ‘[auth]’ section of ~.subversion/config

Enjoy!

gawk -F"[= ]" '{ sum = sum + $NF; count = count + 1; if ($NF > max) max = $NF; } END { printf"count=%d avg=%d max=%d\n", count, sum/count, max}'

This script:

  1. specifies the delimiter as a regex
  2. filters input line based on a regex ( regex right after the first single quote)
  3. cycles through fields
  4. tests a field against a regex (if block in the loop)

gawk -F"[=\x01]" '/35=AE.*150=F/ { for (i=1; i<=NF; i=i+2) { if ($i ~/^(52|55|32|31|1117|1121|782|785)$/) { printf "%s,",$(i+1)} } printf "\n" }' file_to_parse.log

http://software.intel.com/en-us/articles/intel-performance-counter-monitor/


root@vcaruso-ubuntu-t5500:/home/vcaruso/src/IntelPerformanceCounterMonitorV1.7# ./pcm.x 1

EXEC : instructions per nominal CPU cycle
IPC : instructions per CPU cycle
FREQ : relation to nominal CPU frequency='unhalted clock ticks'/'invariant timer ticks' (includes Intel Turbo Boost)
AFREQ : relation to nominal CPU frequency while in active state (not in power-saving C state)='unhalted clock ticks'/'invariant timer ticks while in C0-state' (includes Intel Turbo Boost)
L3MISS: L3 cache misses
L2MISS: L2 cache misses (including other core's L2 cache *hits*)
L3HIT : L3 cache hit ratio (0.00-1.00)
L2HIT : L2 cache hit ratio (0.00-1.00)
L3CLK : ratio of CPU cycles lost due to L3 cache misses (0.00-1.00), in some cases could be >1.0 due to a higher memory latency
L2CLK : ratio of CPU cycles lost due to missing L2 cache but still hitting L3 cache (0.00-1.00)
READ : bytes read from memory controller (in GBytes)
WRITE : bytes written to memory controller (in GBytes)
Core (SKT) | EXEC | IPC | FREQ | AFREQ | L3MISS | L2MISS | L3HIT | L2HIT | L3CLK | L2CLK | READ | WRITE

0 1 0.03 0.25 0.12 1.04 319 4131 0.92 0.04 0.07 0.17 N/A N/A
1 1 1.19 1.14 1.05 1.06 105 2803 0.96 0.96 0.00 0.01 N/A N/A
2 1 0.01 0.24 0.06 1.04 208 1152 0.82 0.04 0.08 0.09 N/A N/A
3 1 0.01 0.28 0.04 1.04 18 783 0.98 0.00 0.01 0.11 N/A N/A
4 0 0.03 0.37 0.07 0.48 566 2359 0.76 0.12 0.20 0.13 N/A N/A
5 0 0.12 0.55 0.22 0.76 591 4982 0.88 0.37 0.07 0.11 N/A N/A
6 0 0.01 0.32 0.03 0.48 13 753 0.98 0.00 0.01 0.12 N/A N/A
7 0 0.02 0.37 0.06 0.48 210 1666 0.87 0.08 0.09 0.16 N/A N/A
------------------------------------------------------------------------------------------------------------
SKT 0 0.02 0.43 0.04 0.56 1920 17 K 0.89 0.18 0.09 0.15 0.00 0.00
SKT 1 0.20 0.85 0.24 1.05 15 K 25 K 0.39 0.73 0.26 0.04 0.00 0.00
------------------------------------------------------------------------------------------------------------
TOTAL * 0.17 0.96 0.18 0.96 17 K 47 K 0.63 0.84 0.09 0.03 0.00 0.00

Instructions retired: 32 M ; Active cycles: 34 M ; Time (TSC): 7144 Kticks ; C0 (active,non-halted) core residency: 18.46 %

PHYSICAL CORE IPC : 0.96 => corresponds to 23.94 % utilization for cores in active state
Instructions per nominal CPU cycle: 0.17 => corresponds to 4.22 % core utilization over time interval

Intel(r) QPI data traffic estimation in bytes (data traffic coming to CPU/socket through QPI links):

QPI0 QPI1
----------------------------------------------------------------------------------------------
SKT 0 178 K 380 K
SKT 1 221 K 42 K
----------------------------------------------------------------------------------------------
Total QPI incoming data traffic: 823 K QPI data traffic/Memory controller traffic: 0.62

when calling java from a native thread via jni you may run into a synthetic stack overflow exception thrown by the jvm leading to a jvm crash. This may happen if the native’s thread remaining stack size is lower (stack grows downwards) than the reserved stack size defined by the jvm’s options -XXStackYellowPages -XXStackRedPages -XXStackShadowPages. Obviously the native thread doesn’t know of this constraint so it grows its stack until the limit and you may run into troubles if you’re allocating big arrays on the stack.
To solve this issue you may either increase the native thread stack size or decrease the amount of pages reserved by the jvm by tweaking those parameters above.

tcpdump -ieth2 -C1 -s0 host 194.110.100.1 -w capture.pcap

less -R

(F to follow the tail)



Welcome to the desert, originally uploaded by Vincenzo Caruso.

This is a test post from flickr, a fancy photo sharing thing.

Ho appena installato questo pacchetto in debian, gnome-blogger. E’ una piccola applet per gnome-panel, basta registrare l’indirizzo del blog e le credenziali e con due click puoi inviare un nuovo post sul tuo blog. Facile, provare per credere!