Skip to content

Instantly share code, notes, and snippets.

View runeksvendsen's full-sized avatar

Rune K. Svendsen runeksvendsen

View GitHub Profile
@runeksvendsen
runeksvendsen / gist:ab60ccfa6c941f2df851
Created May 20, 2014 19:17
subliminal CLI debug output for the single file "House.of.Cards.2013.S02E03.1080p.NF.WEBRip.DD5.1.x264-NTb.mkv"
INFO [subliminal.video-scan_videos:315] Scanning directory u'/media/thesafe/Torrents/House.of.Cards.2013.S02.Season.2.1080p.NF.WEBRip.DD5.1.x264-NTb [PublicHD]/tmp'
INFO [subliminal.video-scan_video:202] Scanning video u'House.of.Cards.2013.S02E03.1080p.NF.WEBRip.DD5.1.x264-NTb.mkv' in u'/media/thesafe/Torrents/House.of.Cards.2013.S02.Season.2.1080p.NF.WEBRip.DD5.1.x264-NTb [PublicHD]/tmp'
DEBUG [stevedore.extension-_load_plugins:156] found extension EntryPoint.parse('guess_idnumber = guessit.transfo.guess_idnumber:GuessIdnumber')
DEBUG [stevedore.extension-_load_plugins:156] found extension EntryPoint.parse('guess_bonus_features = guessit.transfo.guess_bonus_features:GuessBonusFeatures')
DEBUG [stevedore.extension-_load_plugins:156] found extension EntryPoint.parse('guess_date = guessit.transfo.guess_date:GuessDate')
DEBUG [stevedore.extension-_load_plugins:156] found extension EntryPoint.parse('split_path_components = guessit.transfo.split_path_components:SplitPathComponents')
DEBUG [
@runeksvendsen
runeksvendsen / gist:60c6b180a51c91c86404
Created May 20, 2014 19:20
subliminal CLI debug output for entire season 2 ("House.of.Cards.2013.S02.Season.2.1080p.NF.WEBRip.DD5.1.x264-NTb [PublicHD]")
rune@pc:~/Programming/subliminal/subliminal$ subliminal --debug -l en -- "/media/thesafe/Torrents/House.of.Cards.2013.S02.Season.2.1080p.NF.WEBRip.DD5.1.x264-NTb [PublicHD]/"
INFO [subliminal.video-scan_videos:315] Scanning directory u'/media/thesafe/Torrents/House.of.Cards.2013.S02.Season.2.1080p.NF.WEBRip.DD5.1.x264-NTb [PublicHD]'
INFO [subliminal.video-scan_video:202] Scanning video u'House.of.Cards.2013.S02E07.1080p.NF.WEBRip.DD5.1.x264-NTb.mkv' in u'/media/thesafe/Torrents/House.of.Cards.2013.S02.Season.2.1080p.NF.WEBRip.DD5.1.x264-NTb [PublicHD]'
DEBUG [stevedore.extension-_load_plugins:156] found extension EntryPoint.parse('guess_idnumber = guessit.transfo.guess_idnumber:GuessIdnumber')
DEBUG [stevedore.extension-_load_plugins:156] found extension EntryPoint.parse('guess_bonus_features = guessit.transfo.guess_bonus_features:GuessBonusFeatures')
DEBUG [stevedore.extension-_load_plugins:156] found extension EntryPoint.parse('guess_date = guessit.transfo.guess_date:GuessDate')
DEBUG [
@runeksvendsen
runeksvendsen / gist:c9fc65d1241cd3d348b3
Created August 6, 2014 05:13
Fix sed error when $1, $2 or $3 contain special characters
diff --git a/scripts/debian-update-versions b/scripts/debian-update-versions
index ae24849..dcdc76c 100755
--- a/scripts/debian-update-versions
+++ b/scripts/debian-update-versions
@@ -20,8 +20,11 @@ get_timestamp_commit()
}
do_subst() {
- sed -e "0,/^mpv (.*)/s/(.*)/($1)/" \
- -e "s/^ \* local build.*/ \* local build with ffmpeg $2, libass $3/" \
@runeksvendsen
runeksvendsen / bitcoinjServer.log
Created April 26, 2016 09:37
Terminal output of "org.bitcoinj.examples.ExamplePaymentChannelServer --net TEST"
11:07:08 1 Context.<init>: Creating bitcoinj 0.15-SNAPSHOT context.
11:07:08 12 WalletAppKit.startUp: Starting up with directory = .
11:07:09 12 MnemonicCode.toSeed: PBKDF2 took 582.9 ms
11:07:09 12 KeyChainGroup.addAndActivateHDChain: Creating and activating a new HD chain: org.bitcoinj.wallet.DeterministicKeyChain@477e4ddd
11:07:09 12 DeterministicKeyChain.maybeLookAhead: 1 keys needed for M/0H/0 = 1 issued + 0 lookahead size + 0 lookahead threshold - 0 num children
11:07:09 12 DeterministicKeyChain.maybeLookAhead: Took 1.149 ms
11:07:09 12 DeterministicKeyChain.maybeLookAhead: 133 keys needed for M/0H/0 = 1 issued + 100 lookahead size + 33 lookahead threshold - 1 num children
11:07:09 12 DeterministicKeyChain.maybeLookAhead: Took 75.28 ms
11:07:09 12 DeterministicKeyChain.maybeLookAhead: 133 keys needed for M/0H/1 = 0 issued + 100 lookahead size + 33 lookahead threshold - 0 num children
11:07:09 12 DeterministicKeyChain.maybeLookAhead: Took 65.74 ms
Sending message: 0000000c080112080802100020808c15
Received data: 0000000808021a0408021000
Received data: 00000034080322300a2103481803ab27a0db118ba45b29eced7c4967cdff207181352215cfbfa26a3e3ea410a08d06188ef391b905208827
Sending message: 0000015908063ad4020adf010100000001e87a49ef35d8bce2e186460cbda3f0bf984cc3bd2cd1a99202514d85d083faaf010000006a47304402206dea75fa23119ecedec4b73d2bac29b5002172d8df3cb5e7574f4fbca41cd7830220211b782e0acaa0f36d5f2827b7b326e1a2eb37af2f147967d3c4a80b1760d678012102fdf8c92a5d427e5d228210498d4292bc7ceb3d1364970544c6db00fbb9c537f4feffffff02a08601000000000017a9148f24d8af37d756a2ea56f24d48480760b17a305887dcbef000000000001976a914f175e34ce7809211e9ec613ecb0f162a3db2e0ca88ac00000000124d0898e6051247304402203a4ce299aff45107d357890c1f96531822e896796433128003472f9ed964969d0220103aa2ee08102e6f24be7dec20167fa596d939d3ccf7bb14e1621015ace81904831a2102e82f7581f4f3b5c45457a9dbe8e38be469eaf35bc242ed73dfc3c7ecd044c22f
Received data: 000000020807
Sending payment <ChannelPayment: senderValueLeft=CMoneyAmount
16:40:05 12 WalletProtobufSerializer.loadExtensions: Loading wallet extension org.bitcoinj.protocols.channels.StoredPaymentChannelClientStates
16:40:05 13 StoredPaymentChannelClientStates.updatedChannel: Stored client channel 1425854689 was updated
16:40:08 15 ConnectionHandler.handleKey: Error handling SelectionKey: java.nio.channels.CancelledKeyException
Client payment channel states:
16:40:13 15 NioClientManager.handleKey: Failed to connect with exception: java.nio.channels.ClosedChannelException: null
16:40:15 15 NioClientManager.handleKey: Failed to connect with exception: java.nio.channels.ClosedChannelException: null
16:40:16 15 NioClientManager.handleKey: Failed to connect with exception: java.nio.channels.ClosedChannelException: null
16:40:19 15 NioClientManager.handleKey: Failed to connect with exception: java.nio.channels.ClosedChannelException: null
16:40:19 15 NioClientManager.handleKey: Failed to connect with exception: java.nio.channels.ClosedChannelException: null
16:40:30 1 ExamplePaymentChan
2016-05-06 14:40:30.554969 (127.0.0.1:53395): Connection open
2016-05-06 14:40:30.555797 (127.0.0.1:53395): Received channel open request of duration 86340 seconds
2016-05-06 14:40:30.555917 (127.0.0.1:53395): Sent message: COpenResponse {receiverVersion = CVersion {versionMajor = 2, versionMinor = 0}, receiverPubKey = PubKey "033085a57b9a295b544a271293cb4d8e8fd6fca380b9bc89d3a0777daa5ce7a880", minChannelSize = 5000 satoshis, channelExpiration = 2016-05-07 14:39:30 UTC, channelOpenPrice = 5000 satoshis}
2016-05-06 14:40:30.723043 (127.0.0.1:53395): Received message: COpenFinalize {fundingTx = Tx "0100000002f5a2cce8ed1618dbd6eeb83c2774450b870d0168754d16388d93f233ec54df83010000006b483045022100a203a905a3e84f5308fcd4e4e9e8a74604b8913f858ececc939afa1285ec6aae022039e0d10d86094d305b4c5aa5d4bd47c94c28fbe6258ebafc184bc723bb4d4ce4012103d14174fc05a92cae990312c6f7979963d675532275a6d8644ef468e800aa4950ffffffff1fca742b7570d05d6be47d6b54aa9fd1084e2624c6ad576302744d1852286d9d000000006a4730440220133f46a562ac7b8a36700eefe61cbc
swagger: '2.0'
info:
version: "0.1.0"
title: Bitcoin payment channel REST protocol
description: |
A RESTful protocol for opening, closing and making payments over a Bitcoin payment channel. The payment server speaking this protocol is the recipient of value, operating on behalf of a content delivery server who receives value from a customer/client.
The content delivery server passes requests supplied by the client (payer) to the payment server, and delivers content to the client dependent on the response from the payment server. The client, on its side, derives a state object from the supplied arguments, using a client-side payment channel library, which is used to format messages and create payments.'
host: localhost
var bitcoin = require('bitcoinjs-lib');
var keyPair = bitcoin.ECPair.makeRandom( { compressed: true } ); // create new key pair to be used for signing payment channel payments
var chanState = new PaymentChannel("https://paychan.runeks.me", keyPair, expTime);
chanState.getFundingInfo(function (fundingAddress, openPrice, fundingTxMinConf) {
// pay to 'fundingAddress' here
// wait for 'fundingTxMinConf' confirmations before proceeding to open step
});
var chanState = new PaymentChannel(serverURL, ecKeyPair, expirationUnixTimestamp);
chanState.getFundingInfo(function (fundingAddress, openPrice, fundingTxMinConf) {
// pay to 'fundingAddress' here
// wait for 'fundingTxMinConf' confirmations before proceeding to open step
});
var fi = blockchain_GetTxInfoFromAddress(fundingAddress) // get information about the transaction paying to the funding address
chanState.setFundingSource( fi.txid, fi.vout, fi.value ); // register this information with the state object