badass shit

BM-2cWy7cvHoq3f1rYMerRJp8PT653jjSuEdY
Oct 19 17:43 [raw]

badass bash menu and bitboard webserver deployer kewl shit <pre style='color:#1f1c1b;background-color:#ffffff;'> <span style='color:#898887;'>#!/bin/bash</span> <span style='color:#898887;'>########################################################################################</span> <span style='color:#898887;'>#</span><span style='color:#ca60ca;'>kate:</span><span style='color:#898887;'> </span><span style='color:#0095ff;'>bom</span><span style='color:#898887;'> </span><span style='color:#006e28;'>off</span><span style='color:#0095ff;'>;</span> <span style='color:#898887;'># usage example: menu pwd whoami ls ps</span> <span style='color:#898887;'># giving you a menu with 4 options to execute in bash shell / Konsole</span> <span style='color:#898887;'># call in bash as: . menu1 # if menu1 is the file name with this script in it</span> <span style='color:#898887;'># usage e.g.:</span> <span style='color:#898887;'># menu ls &quot;ls -l&quot; &quot;echo list dir ; clear ; ls -la &quot; clear</span> <span style='color:#898887;'># q, Q or 0 or empty_string i.e. ENTER-key alone always exits the menu</span> <span style='color:#898887;'># click-launch from Dolphin file-manager in KDE: associate shell script open-action command: konsole -e %f</span> <span style='color:#898887;'># under right-cick, FILE TYPE OPTIONS, ... advanced option, do not tag &quot;run in Terminal&quot;</span> <span style='color:#898887;'># so you get a &quot;open action&quot; rather than an &quot;execute action&quot; , but it does what you expect.</span> <span style='color:#898887;'># to set as a bash lib func : copy the text between the upper and lower ###### lines into your ~/.bashrc file</span> <span style='color:#898887;'># get errors after download source from https://pastebin.com/raw/HrLtCKaj which puts in Windows-style NEWLINEs</span> <span style='color:#898887;'># fix &quot; bm_menu.sh: line 4: $'\r': command not found &quot; using sed :</span> <span style='color:#898887;'># sed -i 's/\r$//' ./bm_menu.sh</span> <span style='color:#644a9b;'>ibitboard()</span> <b>{</b> <span style='color:#644a9b;'>clear</span> <b><span style='color:#644a9b;'>echo</span></b> <span style='color:#bf0303;'>&quot;install of bitboard web thingy&quot;</span> <b><span style='color:#644a9b;'>pushd</span></b> . <span style='color:#898887;'># unalias cp</span> <span style='color:#898887;'># cp</span> <span style='color:#644a9b;'>mkdir</span> bb <b><span style='color:#644a9b;'>cd</span></b> ./bb <b>(</b> <span style='color:#644a9b;'>cat</span> &lt;&lt;'EOFherefile' import base64 import json import logging as log import time import traceback import xmlrpclib from threading import Thread import config from chan_objects import ChanBoard from chan_objects import ChanPost def getBitmessageEndpoint(): username = &quot;aa&quot; #config.getBMConfig(&quot;apiusername&quot;) password = &quot;aa&quot; #config.getBMConfig(&quot;apipassword&quot;) host = &quot;127.0.1&quot; #config.getBMConfig(&quot;apiinterface&quot;) port = &quot;8442&quot; #config.getBMConfig(&quot;apiport&quot;) # return &quot;http://&quot;+username+&quot;:&quot;+password+&quot;@&quot;+host+&quot;:&quot;+port+&quot;/&quot; return &quot;http://aa:aa@127.0.0.1:8442/&quot; ''' this is file /bitboard-master/bitmessage_gateway.py lauch as daemon and curses, then the missing Qt4 stuff does not matter. python2 bitmessagemain.py --curses http://localhost:8080 kioclient5 exec 'http://localhost:8080' daemon = true dontconnect = false maxdownloadrate = 33 maxoutboundconnections = 2 maxuploadrate = 33 apienabled = true apiusername = aa apipassword = aa apiinterface = 127.0.0.1 apiport = 8442 ''' class BitMessageGateway(Thread): def __init__(self): super(BitMessageGateway, self).__init__() self._postsById = {} self._boardByChan = {} self._chanDict = {} self._refresh = True self._api = xmlrpclib.ServerProxy(getBitmessageEndpoint()) def run(self): while True: try: print &quot;Updating bitmessage info.&quot; self.updateChans() self.updateChanThreads() print `len(self._postsById)` + &quot; total messages &quot; + `len(self._chanDict)` + &quot; total chans.&quot; for i in range(0, config.bm_refresh_interval): time.sleep(i) if self._refresh: self._refresh = False break except Exception as e: log.error(&quot;Exception in gateway thread: &quot; + `e`) time.sleep(config.bm_refresh_interval) def getChans(self): return self._chanDict def deleteMessage(self, chan, messageid): try: board = self._boardByChan[chan] post = self._postsById[messageid] board.deletePost(post) del self._postsById[messageid] except Exception as e: print &quot;Exception deleting post: &quot; + `e` traceback.print_exc() return self._api.trashMessage(messageid) def deleteThread(self, chan, threadid): try: board = self._boardByChan[chan] thread = board.getThread(threadid) if thread: threadposts = thread.getPosts() for post in threadposts: self.deleteMessage(chan, post.msgid) board.deleteThread(threadid) except Exception as e: print &quot;Exception deleting thread: &quot; + repr(e) traceback.print_exc() return &quot;Thread [&quot; + repr(threadid) + &quot;] deleted.&quot; def updateChans(self): chans = {} try: straddr = self._api.listAddresses() addresses = json.loads(straddr)['addresses'] for jaddr in addresses: if jaddr['chan'] and jaddr['enabled']: chan_name = jaddr['label'] chans[chan_name] = jaddr['address'] except Exception as e: log.error(&quot;Exception getting channels: &quot; + `e`) traceback.print_exc() self._chanDict = dict(self._chanDict.items() + chans.items()) def getChanName(self, chan): for label, addr in self._chanDict.iteritems(): if addr == chan: return label def getImage(self, imageid): return self._postsById[imageid].image def updateChanThreads(self): strmessages = self._api.getAllInboxMessageIDs() messages = json.loads(strmessages)['inboxMessageIds'] for message in messages: messageid = message[&quot;msgid&quot;] if messageid in self._postsById: continue strmessage = self._api.getInboxMessageByID(messageid) jsonmessages = json.loads(strmessage)['inboxMessage'] if len(jsonmessages) &lt;= 0: continue chan = jsonmessages[0]['toAddress'] post = ChanPost(chan, jsonmessages[0]) if chan not in self._boardByChan: self._boardByChan[chan] = ChanBoard(chan) self._postsById[messageid] = post chanboard = self._boardByChan[chan] chanboard.addPost(post) def getThreadCount(self, chan): if chan not in self._boardByChan: return 0 return self._boardByChan[chan].getThreadCount() def getChanThreads(self, chan, page=1): if chan not in self._boardByChan: return [] board = self._boardByChan[chan] thread_start = int((int(page) - 1) * config.threads_per_page) thread_end = int(int(page) * config.threads_per_page) return board.getThreads(thread_start, thread_end) def getChanThread(self, chan, thread_id): if chan not in self._boardByChan: return None board = self._boardByChan[chan] return board.getThread(thread_id) def submitPost(self, chan, subject, body, image): subject = subject.encode('utf-8').strip() subjectdata = base64.b64encode(subject) msgdata = body.encode('utf-8').strip() if image: imagedata = base64.b64encode(image) msgdata += &quot;\n\n&lt;img src=\&quot;data:image/jpg;base64,&quot; + imagedata + &quot;\&quot;&gt;&quot; msg = base64.b64encode(msgdata) self._refresh = True return self._api.sendMessage(chan, chan, subjectdata, msg) def joinChan(self, passphrase): self._refresh = True try: result = self._api.createChan(base64.b64encode(passphrase)) except Exception as e: result = repr(e) return result def getAPIStatus(self): try: result = self._api.add(2, 2) except Exception as e: return repr(e) if result == 4: return True return result gateway_instance = BitMessageGateway() gateway_instance.start() EOFherefile <b>)</b> &gt; <b><span style='color:#0095ff;'>bitmessage_gateway.py</span></b> <span style='color:#644a9b;'>git</span> clone https://github.com/michrob/bitboard <span style='color:#898887;'># modded 8442</span> <b><span style='color:#644a9b;'>cd</span></b> bitboard/ <span style='color:#644a9b;'>mv</span> bitmessage_gateway.py bitmessage_gateway___ORIG.py <span style='color:#644a9b;'>mv</span> ../bitmessage_gateway.py . <span style='color:#898887;'># github version breaks too much</span> <b><span style='color:#644a9b;'>echo</span></b> <span style='color:#bf0303;'>'#!/usr/bin/env python2 '</span> &gt; bb.py <span style='color:#644a9b;'>chmod</span> +x bb.py <span style='color:#644a9b;'>cat</span> ./bitboard.py &gt;&gt; bb.py <b><span style='color:#0095ff;'>python2</span></b> -m pip install --user -r requirements.txt <span style='color:#898887;'># mod gateway aa:aa</span> <span style='color:#898887;'># python2 ./bitmessagemain.py --curses</span> <span style='color:#898887;'># python2 bitboard.py &amp;</span> <span style='color:#898887;'># ./bb.py &amp;</span> <span style='color:#898887;'># env might be elsewhere</span> <b><span style='color:#0095ff;'>python2</span></b> ./bb.py <b>&amp;</b> <span style='color:#644a9b;'>sleep</span> 1.1 <span style='color:#898887;'># wait until web server is ready</span> <b><span style='color:#0095ff;'>kioclient5</span></b> exec <span style='color:#bf0303;'>'http://localhost:8080'</span> <b>&amp;</b> <b><span style='color:#644a9b;'>popd</span></b> <b>}</b> <span style='color:#644a9b;'>menu()</span> <b>{</b> <b><span style='color:#644a9b;'>local</span></b> <span style='color:#0057ae;'>IFS=</span><span style='color:#bf0303;'>$' </span><span style='color:#0057ae;'>\t\n</span><span style='color:#bf0303;'>'</span> <b><span style='color:#644a9b;'>local</span></b> <span style='color:#0057ae;'>num</span> <span style='color:#0057ae;'>n=</span>1 <span style='color:#0057ae;'>opt</span> <span style='color:#0057ae;'>item</span> <span style='color:#0057ae;'>cmd</span> <span style='color:#644a9b;'>clear</span> <span style='color:#898887;'>## Use default setting of IFS, Loop though the command-line arguments</span> <b><span style='color:#644a9b;'>echo</span></b> <b>for</b> <b><span style='color:#0095ff;'>item</span></b> <b>do</b> <b><span style='color:#644a9b;'>printf</span></b> <span style='color:#bf0303;'>&quot; %3d. %s\n&quot;</span> <span style='color:#bf0303;'>&quot;</span><span style='color:#0057ae;'>$n</span><span style='color:#bf0303;'>&quot;</span> <span style='color:#bf0303;'>&quot;</span><span style='color:#0057ae;'>${item%%</span>:*<span style='color:#0057ae;'>}</span><span style='color:#bf0303;'>&quot;</span> <span style='color:#0057ae;'>n=$((</span> <span style='color:#0057ae;'>$n</span> + 1 <span style='color:#0057ae;'>))</span> <b>done</b> <span style='color:#898887;'>## If there are fewer than 10 items, set option to accept key without ENTER</span> <b><span style='color:#644a9b;'>echo</span></b> <b>if</b><b><span style='color:#644a9b;'> [</span></b> <span style='color:#0057ae;'>$#</span> <span style='color:#006e28;'>-lt</span> 10<b><span style='color:#644a9b;'> ]</span></b> <b>then</b> <span style='color:#0057ae;'>opt=</span>-sn1 <b>else</b> <span style='color:#0057ae;'>opt=</span> <b>fi</b> <b><span style='color:#644a9b;'>read</span></b> -p <span style='color:#bf0303;'>&quot;ENTER quits menu - please choose 1 to </span><span style='color:#0057ae;'>$#</span><span style='color:#bf0303;'> ==&gt; &quot;</span> <span style='color:#0057ae;'>$opt</span> <span style='color:#0057ae;'>num</span> <span style='color:#898887;'>## Get response from user</span> <span style='color:#898887;'>## Check that user entry is valid</span> <b>case</b> <span style='color:#0057ae;'>$num</span><b> in</b> [qQ0] <b>|</b> <span style='color:#bf0303;'>&quot;&quot;</span> <b>)</b> <span style='color:#644a9b;'>clear</span> <b>;</b> <b><span style='color:#644a9b;'>return</span></b> <b>;;</b> <span style='color:#898887;'>## q, Q or 0 or &quot;&quot; exits</span> <b><span style='color:#0095ff;'>*</span></b>[!0-9]* <b>|</b> <b><span style='color:#0095ff;'>0*</span></b> ) <span style='color:#898887;'>## invalid entry</span> <b><span style='color:#644a9b;'>printf</span></b> <span style='color:#bf0303;'>&quot;\aInvalid menu choice : %s\n&quot;</span> <span style='color:#bf0303;'>&quot;</span><span style='color:#0057ae;'>$num</span><span style='color:#bf0303;'>&quot;</span> &gt;&amp;2 <b><span style='color:#644a9b;'>return</span></b> 1 <b>;;</b> <b>esac</b> <b><span style='color:#644a9b;'>echo</span></b> <b>if</b> <b><span style='color:#644a9b;'> [</span></b> <span style='color:#bf0303;'>&quot;</span><span style='color:#0057ae;'>$num</span><span style='color:#bf0303;'>&quot;</span> <span style='color:#006e28;'>-le</span> <span style='color:#bf0303;'>&quot;</span><span style='color:#0057ae;'>$#</span><span style='color:#bf0303;'>&quot;</span><b><span style='color:#644a9b;'> ]</span></b> <span style='color:#898887;'>## Check that number is &lt;= to the number of menu items</span> <b>then</b> <b><span style='color:#644a9b;'>eval</span></b> <span style='color:#0057ae;'>${!num}</span> <span style='color:#898887;'>## eval &quot;${!num#*:}&quot; # Execute it using indirect expansion, breaking stuff :-(</span> <b>else</b> <b><span style='color:#644a9b;'>printf</span></b> <span style='color:#bf0303;'>&quot;\aInvalid menu choice: %s\n&quot;</span> <span style='color:#bf0303;'>&quot;</span><span style='color:#0057ae;'>$num</span><span style='color:#bf0303;'>&quot;</span> &gt;&amp;2 <b><span style='color:#644a9b;'>return</span></b> 1 <b>fi</b> <b>}</b> <span style='color:#898887;'>##############################################################################################</span> <span style='color:#898887;'>#-----------------------------------------------------------</span> <span style='color:#898887;'># &quot;Here-document&quot; containing nice standard keys.dat with 3 chans and 1 nuked ID / pml , dropped into thwe cwd, i.e. .</span> <span style='color:#898887;'># note that a nuked address is kind of useless , since its key was published. It still is kinda broadcast fun though.</span> <span style='color:#898887;'># You have no privacy using a nuked key -</span> <span style='color:#898887;'># much like you don't have privacy while using a key which someone has stolen from you.</span> <b>(</b> <span style='color:#644a9b;'>cat</span> &lt;&lt;'EOFherefile' [bitmessagesettings] apienabled = true apiport = 8442 apiinterface = 127.0.0.1 apipassword = aa apiusername = aa blackwhitelist = black daemon = true defaultnoncetrialsperbyte = 1000 defaultpayloadlengthextrabytes = 1000 dontconnect = false dontsendack = False hidetrayconnectionnotifications = True identiconsuffix = AAAAAAAAAAAA keysencrypted = false maxacceptablenoncetrialsperbyte = 20000000000 maxacceptablepayloadlengthextrabytes = 20000000000 maxdownloadrate = 55 maxoutboundconnections = 1 maxuploadrate = 55 messagesencrypted = false minimizeonclose = false minimizetotray = False namecoinrpchost = localhost namecoinrpcpassword = namecoinrpcport = 8336 namecoinrpctype = namecoind namecoinrpcuser = onionbindip = 127.0.0.1 onionhostname = AAAAAAAAAAAAAAAA.onion onionport = 8448 opencl = None port = 8444 replybelow = False sendoutgoingconnections = True settingsversion = 10 showtraynotifications = False smtpdeliver = socksauthentication = False sockshostname = 127.0.0.1 sockslisten = False sockspassword = socksport = 9150 socksproxytype = none socksusername = startintray = False startonlogon = False stopresendingafterxdays = 5.0 stopresendingafterxmonths = 5.0 timeformat = %%a, %%d %%b %%Y %%H:%%M trayonclose = False ttl = 1381224 upnp = False useidenticons = False userlocale = en willinglysendtomobile = False [BM-2cWy7cvHoq3f1rYMerRJp8PT653jjSuEdY] label = [chan] bitmessage enabled = true decoy = false chan = true noncetrialsperbyte = 1000 payloadlengthextrabytes = 1000 privsigningkey = 5K42shDERM5g7Kbi3JT5vsAWpXMqRhWZpX835M2pdSoqQQpJMYm privencryptionkey = 5HwugVWm31gnxtoYcvcK7oywH2ezYTh6Y4tzRxsndAeMi6NHqpA [BM-2cUzsvYoNbKNNuDnJtdPVS2pbSHzNJyqdD] label = [chan] find-new-chan enabled = true decoy = false chan = true noncetrialsperbyte = 1000 payloadlengthextrabytes = 1000 privsigningkey = 5JrsTVeBZYUxYeK5WQgiESBxpfMvqMp2bdvu7FyY356rMqzTdiB privencryptionkey = 5KXBMwknxy585jkR3TVZuYgBjAawtGfWUp98cmaWvFjAZwC2yaN [BM-2cW67GEKkHGonXKZLCzouLLxnLym3azS8r] label = [chan] general enabled = true decoy = false chan = true noncetrialsperbyte = 1000 payloadlengthextrabytes = 1000 privsigningkey = 5Jnbdwc4u4DG9ipJxYLznXSvemkRFueQJNHujAQamtDDoX3N1eQ privencryptionkey = 5JrDcFtQDv5ydcHRW6dfGUEvThoxCCLNEUaxQfy8LXXgTJzVAcq [BM-2cTaRF4nbj4ByCTH13SUMouK8nHXBLaLmS] label = NUKED ADDRESS LmS enabled = true decoy = false chan = false noncetrialsperbyte = 1000 payloadlengthextrabytes = 1000 privsigningkey = 5J9gVWmW9XCjJo1CdymosipSuWRLp2ovaUkJ2JGFc9T1A9SHJvB privencryptionkey = 5HrrrckD7RPYhiBeRPAqmUUv73ajYnHKgsC2Q2f3AqK9hptr7aN mailinglist = false mailinglistname = nuked_PML lastpubkeysendtime = 1469973237 EOFherefile <b>)</b> &gt; <b><span style='color:#0095ff;'>keys.dat</span></b> <span style='color:#898887;'>#-----------------------------------------------------------</span> <span style='color:#898887;'>#'echo &quot; delete unimportant files &quot; ; rm ./PyBitmessage/* ; cd PyBitmessage ; rm -rf man dev build packages desktop ; cd .. ' \</span> <span style='color:#898887;'># useful in click-launch to add ; read WAITNOW # which will wait for keypress before closing Konsole</span> <span style='color:#898887;'># now actually using the menu:</span> <span style='color:#898887;'># modify it to your liking note you are then on MASTER branch , not on the newer ver. 0.6.3 branch</span> <span style='color:#898887;'># run through the options 1 2 3 4 in this order: 1 2 3 4</span> <b><span style='color:#0095ff;'>menu</span></b> \ <span style='color:#bf0303;'>'echo &quot; clone BitMessage repo below current dir &quot; ; git clone -b '</span>v0.6<span style='color:#bf0303;'>' &quot;https://github.com/Bitmessage/PyBitmessage.git&quot; '</span> \ <span style='color:#bf0303;'>'echo &quot; check dependencies i.e. py modules etc. &quot; ; cd ./PyBitmessage/ ; python2 checkdeps.py ; cd .. '</span> \ <span style='color:#bf0303;'>'echo &quot; inject standard KEYS.DAT file &quot; ; cp ./keys.dat PyBitmessage/src '</span> \ <span style='color:#bf0303;'>'echo &quot; run new BM from py source &quot; ; pushd . ; cd PyBitmessage/src ; ./bitmessagemain.py --curses &amp; popd '</span> \ <span style='color:#bf0303;'>'echo &quot; pull BM update from github &quot; ; pushd . ; cd PyBitmessage/ ; git pull ; popd '</span> \ <span style='color:#bf0303;'>'echo &quot; fetch all &quot; ; pushd . ; cd PyBitmessage/ ; git fetch --all; popd '</span> \ <span style='color:#bf0303;'>'echo &quot; git hard reset &quot; ; pushd . ; cd PyBitmessage/ ; git reset --hard origin/master ; popd '</span> \ <span style='color:#bf0303;'>'echo &quot; kill bitboard, pyBM daemon, plus any py2 &quot; ; killall python2 '</span> \ <span style='color:#bf0303;'>'echo &quot; inst bitboard &quot; ; ibitboard '</span> </pre>

[chan] bitmessage
BM-2cWy7cvHoq3f1rYMerRJp8PT653jjSuEdY

Subject Last Count
BM Nov 20 04:26 2
Vuvuzela - anonymous messaging that scales to millions of users Nov 19 11:56 25
How do I benchmark bitmessage PoW Nov 15 22:13 3
Support request -- GPUs (Intel(R) HD Graphics IvyBridge M GT1) did not calculate correctly Nov 15 17:04 2
Spam... Nov 15 17:02 4
Ebola on the rampage in USA again Nov 13 06:47 1
ending the waffle Nov 13 04:56 7
forwarding in BM Nov 12 15:04 5
Dear Freemasons Nov 12 07:13 2
CSS3 in Bitmessage interface Nov 12 06:56 1
Pastwatch & Aqua Distributed Version Control Nov 11 11:56 1
SOLUTION for spam Nov 11 11:56 23
Vuvuzela - Metadata-private messaging Nov 11 11:56 1
tes Nov 9 11:19 2
I'm back Nov 9 03:35 8
Bitmessage Network Health Report Nov 7 23:48 12
nodejs clientr KEWLIO Nov 7 07:26 4
Scalability Idea Nov 7 07:24 7
Do NOT spam Nov 7 03:09 8
here is the trick to run pyBM on a server without trouble Nov 5 18:41 8
Scalability Question?? Nov 5 09:09 3
re Re: Scalability Question?? Nov 5 08:21 1
aaa Nov 5 02:48 1
Bitmessage Plugins Nov 3 21:33 3
Any nodejs interface to the bitmessage api yet? Nov 3 19:12 2
Recent API status bug Nov 2 12:38 9
zero bundle -- 0net Nov 2 10:41 4
zero git on 0net Nov 1 12:43 6
(no subject) Nov 1 02:48 5
greetings Oct 31 23:05 3
Re: Oct 31 22:25 1
{ ^ } break { ^ } Oct 31 22:11 1
(no subject) Oct 31 14:33 4
INVALID FORMAT Oct 31 12:12 6
hello world Oct 31 07:40 1
Is there anybody out there? Oct 30 08:03 1
join the darknet - be badass at leakswldjpesnuvn.onion Oct 29 20:33 5
more cores, slower pyBM Oct 29 01:36 15
new bitboard thread Oct 27 17:17 3
http://leakswldjpesnuvn.onion seems stable Oct 27 16:36 1
spot the spammer Oct 27 09:37 3
oniontkryve46opu.onion Oct 27 09:01 2
3 BM websites and all fucked Oct 26 21:00 12
Newcomer Oct 26 18:36 10
135453 Oct 25 22:06 1
Stay in touch Oct 25 13:06 1
new BM site online Oct 25 10:39 3
134730 Oct 25 09:59 1
BM is flatlining : https://beamstat.com/obj Oct 25 08:13 9
a new bitboard went online Oct 25 02:10 4
BM is flatlining : https://beamstat.com/obj Oct 25 00:23 1
sql Oct 24 22:44 1
how I hacked BM Oct 24 22:11 3
--curses mode with bitboard crashy Oct 24 21:30 5
BMF bug Oct 24 04:21 1
onion4442sx7tvvk.onion ONION 444 new website for BM ! hot shit ! Oct 24 04:21 3
running pyBM as daemon on a remote server Oct 24 04:21 9
post with \ backskash Oct 24 04:21 1
BM is flatlining : https://beamstat.com/obj 1200 bytes the average object Oct 24 04:17 2
how I hacked BM Oct 24 04:17 3
secret bin for Bitmessage people Oct 24 04:16 2
post with \ backskash Oct 24 04:11 1