A patch for db4.8 on gcc8+
The march of "progress" sometimes brings about a lot of headaches, especially when I am forced to work on heathen systems such as Debian and Ubuntu. This became readily apparent while installing bitcoind (core) to a server equipped with gcc-9.1.0 this past week. While building the dependencies, db-4.8.30.NC promptly shat out this error:
definition of 'int __atomic_compare_exchange(db_atomic_t*, atomic_value_t, atomic_value_t)' ambiguates built-in declaration 'bool __atomic_compare_exchange(long unsigned int, volatile void*, void*, void*, int, int)' static inline int __atomic_compare_exchange
A relatively simple patch allowed me continue building error-free. I have included in the /library/ here for future reference. Place it in the root of the db-4.8.30.NC folder and apply manually as you would any other patch.
While impossible to completely rid the world of such fuckery, I consider this just another tool in the box to make things slightly less painful
Docker gentoo env recipe
This page is just a note on reliable ways to get a working gentoo environment using Dockerfiles. Useful mainly for making decent working shell that you don't care about for testing things. :)
The recipe can also easily be modified to use own stage3 and not be reliant on dockerhub, though abuse of the autobuild scripts sometimes spawns a shellbot over irc.
docker pull btcinfo/stage3-gentoo-amd64 docker run -it btcinfo/stage3-gentoo-amd64
This gives you a root shell
37b0f185b13d ~ #
Populate the portage tree with the latest official portage snapshot, or use your own archived snapshot.
cd usr/ wget -c http://distfiles.gentoo.org/snapshots/portage-latest.tar.xz tar xvf portage-latest.tar.xz
You can now emerge the packages you need and build from sources. Do what thou will.
Official Alpine Linux Docker image found to allow NULL password for root users
Docker woes continue as security researchers discover that all "Official images" of Alpine linux (since v3.3) allow NULL passwords for the root user. This event, along with Docker Hub being hacked serve as a wonderful reminder of only running code from trusted sources and personal libraries.
Tags: News, Insecurity, Lulz, UNIX
Converting magnet links to .torrent files in bash
I like simple things that do their job well, and I adore bash. A tool was sorely needed in my arsenal that could convert magnet links from torrent sites to a useable .torrent file. The site magnet2torrent.me is often down, and few options exist on the web to do convert files locally that aren't pythonshit. My search led me to a Shithub repository owned by Isis Buttcruft, and while the tool appears to work as advertised it has been neglected and is heavily commented and contains a few unnecessary parts. Let's trim it up a bit and make it a function.
magnet() { [[ "$1" =~ xt=urn:btih:([^&/]+) ]] || exit hashh=${BASH_REMATCH[1]} if [[ "$1" =~ dn=([^&/]+) ]];then filename=${BASH_REMATCH[1]} else filename=$hashh fi fn="meta-"$filename".torrent" touch $fn echo "d10:magnet-uri${#1}:${1}e" | cat > $fn }
Adding this to my .bash_aliases file now allows me to simply do `magnet "<URL>"` and get a torrent file instantly that can be loaded up into rtorrent or streamed using peerflix.
Tags: Entertainment, UNIX, Bash
Building Unobtanium on Docker
This docker recipe has so far proved a stable way to get repeatable results when building Unobtanium binaries for 64-bit Linux and Windows. I am mainly making this post to reference the steps I took, as the method is applicable to most coins.
Download my unobtanium-devenv and untar it.
curl http://btcinfo.sdf.org/library/bitcoin/alts/uno/unobtanium-devenv.tar.gz | tar zxvf -
Enter devenv and build the docker image
cd unobtanium-devenv/ docker-compose -f docker-compose.yml -f unobtanium/docker-compose.windows.yml build
Go have a coffee and smoke while the container builds.
When that build finishes, start the container.
docker-compose -f docker-compose.yml -f unobtanium/docker-compose.windows.yml up -d
Find your container id and connect (as root)
docker container ls --all
docker exec -u root -t -i <container-id> /bin/bash
From the docker shell, go clone my Unobtanium repo.
git clone https://github.com/Shinoa-Fores/Unobtanium.git && cd Unobtanium/depends/
Let's do a Windows build, just for fun.
make HOST=x86_64-w64-mingw32
The process of compiling the dependncies takes about 2 hours. I usually also invoke `import colombian websluts` at this point. When I return to the terminal we are ready to build the UNO qt and cli .exe's
cd ..
./autogen.sh
./configure --prefix="$PWD/depends/x86_64-w64-mingw32/"
make
Kill another hour drinking coffee, smoking, and looking at cats on internet.
mkdir -p bin
cp src/*.exe bin/
cp src/qt/unobtanium-qt.exe bin/
Enjoy your shiny new Windows wallet. Repeat the depends step and rebuild to produce binary for any arch you have a config for.
The x86_64 Linux version lets you do nice things, like run custom .qss so I darkened the wallet. I will post this config to the blog shortly.
Have fun, and feel free to complain about this build method on irc or telegram.
Tags: News, Bitcoin, Cryptocurrency, UNIX
Weechat logs to html
weechat-log-to-html is a Haskell script that converts weechat logs to no-nonsense html. This addition to the /library/ is part of this years goal to excise as much pythonshit as possible from everything I use on a regular basis. Individuals that have Bitlbee hooked up to their weechat will be pleased to know that this script also beautifully parses things such as telegram or discord logs, for which no suitable logger (at least not one written in the aforementioned pythonshit or nodejs) can be found.
To use:
Compile the script using `ghc` - I used version 8.0.2 with good results. Then simply run something like the following:
./weechat-log-to-html < (weechatlog) > output.html
Example output:
Once verified that it works for you, you can simply add the script to a cronjob to monitor the irc channels and other chats you wish to log.
TRB Keccak regrind - test results and notes
I had originally intended this to be a better version of the build instructions I mirrored from the foundation website, but decided to wait for the regrind before making a post, since the foundation planned on updating everything anyway. A few days later mod6 published a blog post detailing the steps he took to update the trb vtree from SHA512 to Keccak vpatches, so that is what will be covered in this post. What I did was, I went through all the similar steps just as in mod6's post, and I created my own keccak trb vtree, just as mod6 did. I then was able to confirm that my keccak trb vtree and his keccak trb tree are a mechanical match. I also did a diff of my keccak trb vtree against the original SHA512 vpatches, and we can see that only difference is the removal of the UTF8 character from genesis.vpatch.
You will need all of the dependencies listed on the bitcoin foundation website in the "how-to" section. A modified version of mod6's `v.pl` (that produces Keccak hashes) and a few other tools are also needed: these can be obtained from diana_coman's website. I no longer use nor support any other flavor of Linux besides Gentoo for any projects discussed on this site , so users of other distros will be required to do their own research to make all this work. I am using a Cuntoo chroot here, and for the sake of thoroughness, here is a list of the exact versions of the dependencies I used:
* sys-devel/bc 1.06.95-r2 * sys-devel/gcc 4.9.4 * app-crypt/gnupg 1.4.10 * net-misc/wget 1.19.5 * net-misc/curl 7.61.1 * dev-lang/perl 5.24.3-r1 * sys-devel/patch 2.7.6-r2 * net-misc/rsync 3.1.3 * sys-apps/coreutils 8.29-r1 * app-arch/unzip 6.0_p21-r2 * app-arch/bzip2 1.0.6-r10 * app-arch/cpio 2.12-r1
A working Ada setup is required to build vk.pl and the tools from diana-coman's starter pack. mod6 also wrote a handy and very detailed guide to doing this here. Since I am using a clean chroot to perform all these steps, I needed to install a new copy of Adacore, so I proceeded to grab a copy of the gnat-gpl-2016-x86_64 version from the AdaCore website here, though for some reason the page 404'd at the time I was doing these tests. Fortunately diana_coman also has this preserved on her website here for those that might need it in the future.
Once that was installed, I checked to ensure it was, in fact, the proper version:
Perfect! Building the starter pack is very painless and took less than a minute for me.
Now I moved on to the actual regrind by setting up the suggested sandbox and moving down the list of steps in mod6's blog post. This also went quite painlessly, my only snafu being I forgot to add back a hyphen "-" for the utf-8 char removed from line 118 of util.h, which caused a byte mismatch later in the process. Once that was done, I had no other problems with the process and was ready to test using mod6's experimental patchset and seals which he handily provides here, along with the signature for same. This part requires one follow the `OFFLINE` build steps from the foundation website, so it will be necessary to download the dependencies from deedbot if you don't have a copy stored somewhere already. I put all the links inside a bash script, intentionally leaving off the -sSL flags so I could observe their download progress.
cd deps/ cat >eu.sh<<EOF curl http://deedbot.org/deed-430460-2.txt > rotor.tar.gz.asc curl http://deedbot.org/deed-430460-1.txt > rotor-db-configure-fix.patch.asc curl http://deedbot.org/deed-422651-1.txt > boost_1_52_0.tar.bz2.asc curl http://deedbot.org/deed-422651-2.txt > buildroot-2015.05.tar.gz.asc curl http://deedbot.org/deed-422651-3.txt > db-4.8.30.tar.gz.asc curl http://deedbot.org/deed-422651-4.txt > openssl-1.0.1g.tar.gz.asc curl http://deedbot.org/deed-427443-1.txt > binutils-2.24.tar.bz2.asc curl http://deedbot.org/deed-427443-2.txt > busybox-1.23.2.tar.bz2.asc curl http://deedbot.org/deed-427443-3.txt > expat-2.1.0.tar.gz.asc curl http://deedbot.org/deed-427443-4.txt > fakeroot_1.18.4.orig.tar.bz2.asc curl http://deedbot.org/deed-427443-5.txt > gcc-4.9.2.tar.bz2.asc curl http://deedbot.org/deed-427443-6.txt > gdb-7.8.2.tar.xz.asc curl http://deedbot.org/deed-427443-7.txt > gmp-6.0.0a.tar.xz.asc curl http://deedbot.org/deed-427443-8.txt > linux-3.18.14.tar.xz.asc curl http://deedbot.org/deed-427443-9.txt > m4-1.4.17.tar.xz.asc curl http://deedbot.org/deed-427443-10.txt> mpc-1.0.3.tar.gz.asc curl http://deedbot.org/deed-427443-11.txt> mpfr-3.1.2.tar.xz.asc curl http://deedbot.org/deed-427443-12.txt> musl-1.1.8.tar.gz.asc curl http://deedbot.org/deed-427443-13.txt> ncurses-5.9.tar.gz.asc curl http://deedbot.org/deed-427443-14.txt> pkgconf-0.8.9.tar.bz2.asc EOF chmod +x deps.sh ./deps.sh
After enjoying un cafecito, the dependencies were finished downloading, so I deleted the script and changed back to the bitcoin directory. A simple `make` completes the process. I encountered no hiccups, and roughly a half hour or so later had a nice shiny bitcoind produced using vk.pl and the keccak patchset only.
In the interests of science, and to ensure repeatable results I went a step further and redid all the regrind steps in a fresh sandbox, and signed a copy of all the patches with my gpg key. Before performing a press I put mod6's copy of the patches in a directory `a` and mine in a directory `b` and ran `diff -uNr a b` against them to ensure they matched, which they did. This build also went fine with no errors, and output a 4.7M to bin/. Now let's test it:
In conclusion, this work represents an outstanding effort on the part of mod6 to ensure trb remains unmolested in the future. I have uploaded my copies of the resulting patches and the corresponding seals here for those that wish to compare them with their own during testing.
Building the Eulora client with Gentoo
Having gotten trinque's excellent Cuntoo bootstrap working on a few different machines, I decided I'd try building a Eulora client with it. This post is to document the steps I followed to get to a working state, as the instructions on the minigame website are outdated and contain dead links.
In this guide, I am using gcc 4.9.4 - I'm pretty sure this is a hard requirement. Crystalspace for whatever reason requires you have the nvidia-cg-toolkit installed even if you use an ATI card, so go ahead and get that via portage:
emerge -av nvidia-cg-toolkit
I have a ~/devel directory already from building trb, so I'll start there and make a eulora directory beside it:
mkdir -p eulora/ && cd $_
Grab cal3d, crystalspace, and the Eulora client files from the minigame site:
wget http://minigame.biz/eulora/source/cal3d.tar.gz wget http://minigame.biz/eulora/source/cs_July24.tar.gz curl http://minigame.biz/eulora/source/eulora-v0.1.2b.tar.gz > eulora-v0.1.2b.tar.gz
Untar that shit.
tar -zxvf cal3d.tar.gz tar -zxvf cs_July24.tar.gz tar -zxvf eulora-v0.1.2b.tar.gz
Navigate to cal3d/ and run the following commands to build:
autoreconf --install --force ./configure --prefix=$HOME/devel/eulora/cal3d make make install
Tell other programs where to find the cal3d things we just built:
export LD_LIBRARY_PATH=$HOME/devel/eulora/cal3d/src/cal3d/.libs/:$LD_LIBRARY_PATH
Go back to ~/devel/eulora/ and enter the cs-forupload folder:
cd ../cs-forupload/
To build crystalspace I had to adjust the configure step to avoid anything bullet related, or the jam build step will barf. Use the following commands:
./configure \ --without-java \ --without-perl \ --without-python \ --without-3ds \ --without-bullet \ --with-cal3d=/$HOME/devel/eulora/cal3d jam -aq libs plugins cs-config walktest
Export the crystalspace environment variable:
export CRYSTAL=$HOME/devel/eulora/cs-forupload
Finally, go back to ~/devel/eulora/ and enter the EuloraV0.1.2 folder ...
cd ../EuloraV0.1.2/
...and build the client:
./autogen.sh ./configure \ --with-cal3d=$HOME/devel/eulora/cal3d \ --with-cs-prefix=$CRYSTAL \ --without-mysqlclient \ --without-sqlite3 \ --without-pq \ --without-hunspell jam -aq client
Eulora servers got a new home in 2018, so we must edit the server ip in data/servers.xml:
sed -i 's/50.115.127.84/161.0.121.201/' data/servers.xml
Now, to avoid having to manually enter the environment variables each time we want to play, we will create a shell script containing those and make it executable:
cat >eu.sh<<EOF export LD_LIBRARY_PATH="$HOME/devel/eulora/cal3d/src/cal3d/ \ .libs:$HOME/devel/eulora/cs-forupload/:"$LD_LIBRARY_PATH export CRYSTAL=$HOME/devel/eulora/cs-forupload ./euclient EOF chmod + eu.sh ./eu.sh
It was night in Eulora when I finished, so I only took a single screenshot of client startup. More to come as I test further.
May your journey be prosperous ....
Handheld game roms
While searching for the Basic games collection the other day, I stumbled upon a forgotten archive containing roms for a bunch of old handheld electronic games from the 70's and 80's. If you had any of the games on the list below, your childhood was likely pretty awesum. I have used MESS to run these, but feel free to try on other platforms (as I did not include any MESS-specific xml files with this archive).
List of games contained in archive:
ROM NAME: GAME: --------------------------------------------------------------- advision "Adventure Vision" alnattck "Alien Attack" alnchase "Alien Chase" amaztron "Amaze-A-Tron" astro "Astro" astrocmd "Astro Command" bambball "Dribble Away Basketball" bankshot "Bank Shot - Electronic Pool" bcclimbr "Crazy Climber (Bandai)" bdoramon "Dokodemo Dorayaki Doraemon" bfriskyt "Frisky Tom (Bandai)" bmboxing "Knock-Em Out Boxing" bmsafari "Safari (Bambino)" bmsoccer "Kick The Goal Soccer" cdkong "Donkey Kong (Coleco)" cgalaxn "Galaxian (Coleco)" cmspacmn "Ms. Pac-Man (Coleco)" comp4 "Comp IV" cpacman "Pac-Man (Coleco, Rev. 29)" cpacmanr1 "Pac-Man (Coleco, Rev. 28)" ebball "Electronic Baseball (Entex)" ebball2 "Electronic Baseball 2 (Entex)" ebball3 "Electronic Baseball 3 (Entex)" edracula "Dracula (Epoch)" efball "Electronic Football (Epoch)" egalaxn2 "Galaxian 2 (Entex)" einvader "Space Invader (Entex, TMS1100)" epacman2 "Pac Man 2 (Entex)" galaxy2 "Galaxy II" gckong "Crazy Kong (Gakken)" gdigdug "Dig Dug (Gakken)" ghalien "Heiankyo Alien (Gakken)" gjackpot "Jackpot: Gin Rummy & Black Jack" gpoker "Poker (Gakken, 1979 version)" h2hbaseb "Head to Head Baseball" h2hfootb "Head to Head Football" invspace "Invader From Space" kingman "Kingman" machiman "Machine Man" maniac "Maniac" mathmagi "Mathemagician" merlin "Merlin - The Electronic Wizard" microvsn "MicroVision" mmerlin "Master Merlin" msthawk "Star Hawk (Mattel)" mvbfree "Mini-Vid Break Free" mwcbaseb "World Championship Baseball" packmon "Packri Monster" pbqbert "Q*Bert (Parker Brothers)" raisedvl "Raise The Devil" simon "Simon (Rev. A)" splasfgt "Space Laser Fight" splitsec "Split Second" ssfball "Superstar Football" ssimon "Super Simon" starwbc "Star Wars - Electronic Battle Command" starwbcp "Star Wars - Electronic Battle Command (prototype)" tandy12 "Tandy-12: Computerized Arcade" tc4 "Total Control 4" tcaveman "Caveman (Tomy)" tccombat "Cosmic Combat" tmpacman "Pac Man (Tomy)" tmscramb "Scramble (Tomy)" tmtennis "Tennis (Tomy)" tmtron "Tron (Tomy)" ufombs "UFO Master-Blaster Station" vinvader "Invaders (VTech)" wildfire "Wildfire (prototype)" zackman "Zackman" |