Thursday, January 25, 2018

World of Bullshit - Oscillococcinum







This is actually pretty old nonsense - but I actually saw this in a real store here.  Not a crazy hippy store, not someplace full of patchouli and crystals - but a place that somebody would go in the middle of the night and grab things  for a sick loved one.


There actually is stuff that helps with flu - flu's a nasty virus that kills a lot of people every year and makes you feel like crap for days.  This isn't it.  The antivirals are expensive and the result of a lot of research by smart people.  These are sugar pills laced with dead animals.

Oscillococcinum was 'found' by Joseph Roy by peering through an old school microscope like you probably used in high school.  He claimed that he found it in flu sufferers, and he also found it in ducks.  Not chickens, not goats, not orangutans.  Ducks.  So he found something that looks like something, and boom, we've got pills.



Flu is caused by a virus.  You can't see a virus on a crappy optical microscope.  All you see on those are amoebas and your own eyelashes.

Compounding a silly thing, this packet of pills is homeopathic.  To create them, they are made by tossing dead duck guts into water and diluting to ridiculous levels.  Just for perspective, the effective ratio is one to ten cendotrigintillion (1/1^^400).   There's only 1.2x10^^21 liters of water on Earth.  If my friend in Australia battles her way past the venomous koalas and baleful drop bears to toss a dead duck into the sea, and I go to the Gulf here and suck up some silty water, I'm getting a lot more duck magic than I get from these pills.

And they aren't cheap - you can buy real medicine that does stuff for less than these duck pills.  I really hope people with limited funds aren't not getting something they really need to buy these.  If I had a sick kid at home who was miserable with flu and might buy these just because they look like medicine.  Placebo effect is a real thing, and kids are dumb.  They can eat the entire packet and it's not going to do anything, so this would make them feel better while doing nothing.

But magic duck pills aren't going to do a damn thing really.  Just get some ice cream.  It's cheaper and will probably make everyone feel better.
Image result for blue bell ice cream

Tuesday, January 16, 2018

Want to use Font Awesome in Android?



It's actually pretty easy - ignore the Stackoverflow posts since they are from Studio 1.x:

1) Add the TTF to the font directory
2) Rename and lose the dashes so it will build
3) Add a fontawesome.xml font resource file with (right click)->New from the font directory:


<?xml version="1.0" encoding="utf-8"?><font-family xmlns:android="http://schemas.android.com/apk/res/android">    <font        android:fontStyle="normal"        android:fontWeight="400"        android:font="@font/fontawesomewebfont" /></font-family>


4) Now add my gist that maps the Unicode to Java-safe strings:

https://gist.github.com/lpreimesberger/043f529734389b385b65f11394dc8d60

5) Boom - switch the fonts to Font Awesome for what you want to iconize and use the fa_* strings and you'll have pretty icons that scale:




Sunday, June 18, 2017

Minimal Burning Man Pickle Bucket Sink


I'm slowly replacing some older camp stuff with upgrades - but a real 'camp sink' is just too heavy to lug around.  I saw some cool designs online but they also looked too heavy.   It took a couple of false starts, but here's mine, with a parts list, which others usually didn't have.

Main part is the buckets.  You can just buy them from your favorite home improvement store, but it's cheaper and better just to use something that would get tossed otherwise.  Donut shops have piles of these for free or a couple of bucks - or if you have a Firehouse Subs nearby, they sell their buckets for a $2 donation to a local charity.  Be forewarned though - these smell, really, really pickley.  I left them in my trunk for an hour and my car smelled like the Vlasic bird's socks for a week.

Image result for vlasic stork

A couple weeks in the sun and the smell is mostly gone though.  Here are the parts with approximate prices:


3 Smelly Buckets$6.00
Fuel siphon bulb$4.00
~ 5 feet of vinyl 1/2" hose$2.50
1/2" barb to 3/4" brass male fitting (threaded)$2.00
1/2" brass barb splice connector$2.00
3/4" PVC pipe for 'spout' (scrap for me)$1.00
2 2" 'U' Clamps
Total$17.50


One bucket will be chopped up - it's the 'bowl' of the sink.  Food grade plastic is 'squishy' - you really can't Dremel it because it melts.  I just used a hand saw and a 'junk' serrated knife I use for carpet and such.  Chop off the 'head' of the bucket a little under the 'rings' the keep it solid.  The pickle bucket has a seam there - that's what I used.



I took the handle off because it bothered me, but you don't need to.   Then you need to trim the 'outside' of the lid of that bucket to stuff it into the 'bowl'.  Cut at the smooth inner part and toss the outside.  This goes inside the 'dirty' water bucket.


You then take that disc and stuff it into the 'bowl' to make the bottom.  Most walkthroughs have you smearing silicone on the seam, but I don't think you need to.


Time to break out the drill - make a drain hole with a 1/2" or 3/4" bit right in the middle.


Time also to install the U clamps, if you don't recognize the name - you'll recognize the picture when you see them:


Other walkthroughs use ones that screw into the plastic, but this seemed stronger given how soft the bucket is, and also I didn't want pointy screws scratching anyone.   Mount the two parallel on the plastic 'bumps' of the 'sink' and 'gray' bucket so they clamp levelly.  You want the spout pressing against the highest parts - not the lowest.



This is where the PVC 'spout' will go.  Some designs use metal lines, but that sounds dangerous if somebody stumbles on them.


Other designs also use fittings to give it a curve, but I'm cheap and I don't want the weight, so I bent it into what should have been a graceful curve.    PVC is very pliable - it has a lot of wiggle and stays bent.  I used a heat gun because I'm impatient - but if you weight or clamp it for a day or two it will take on a new shape.  The extra tubing goes inside - again, I don't want to spend money on weird fittings that might break.


Last 'hard' step is putting the barb fitting into on bucket to make it the 'clean' water tank.  I used one extra bucket trying to use smaller fittings, but they seem leaky/fragile and I don't trust using it.  The 3/4" fitting is solid and can take some abuse.  Drill a 3/4" hole in the button and just screw it in.  I'll silicone it probably to make sure, but it's not going anywhere.



Final part is just connecting the bulb pump to the clean tank and the 'faucet' line using the extra barb sitting and you're done.  Clean on bottom, grey water on top of that, and 'sink' at the very top.  I will use hose clamps to be safe, but this is pretty solid.


Some people also make a 'pedal' - but I don't see the need.  Just squish the bulb with your foot and water comes out.  You could mount the soap on the outside too - but again - there's a flat surface right there and I don't need to carry anything else.


This packs down really nicely into a single bucket size, which can hold all the wash stuff in a single place.



Saturday, June 17, 2017

WAND! What is it good for? (absolutely nothing?)


The Amazon Wand is 'free' currently if you order one.  I like free, so I did.


Plus side, it's super easy to set up.  Open, install the batteries, and press the shiny button:

Then, go to your phone and open the URL the device demands of you:


And then you scan stuff to add to your Amazon cart.  This is awesome if you are inside the extremely limited Amazon Fresh area but otherwise...



Prices are insane since although I'm in one of the largest US cities, no Fresh Delivery here - I'm in walking distance of a Whole Foods (Amazon) store.  Everything is bulk and more expensive than getting off my butt of driving and walking to the store.

I'm glad I got it when it's free.  Maybe things will improve later, but this thing is worthless right now.






Sunday, June 11, 2017

Ethereum Coding Adventures


You'll notice that a lot of stuff just doesn't damn work.  Remix doesn't do anything beyond being the only syntax checking editor.  Mix was supposedly usable, but the binaries are taken down and I wasted hours trying to make the older code build at all (it doesn't).

Any contract beyond a basic 'Hello World' cannot be built in Mist because it's badly broken and won't allow you to move the default 'gas' beyond the laughable default.  Remix will barf out JavaScript code for Web3.  Okay, we can live with that.  Except Web3 doesn't work.  Oops.

Command line geth and the Mist wallet UI don't seem to know anything about each other.  If you run geth all by itself, it doesn't use the same wallets that Mist does.  If you run Mist, you can't write anything Web3 related because it runs geth in the background in IPC mode.

Don't believe me?  Run `ps -eaf` in a window, or looks in TaskMan if you a Windows dude:


/home/lpreimesberger/.config/Ethereum Wallet/binaries/Geth/unpacked/geth --rpc --testnet --fast --ipcpath /home/lpreimesberger/.ethereum/geth.ipc

Yup - no --rpc option.  Easy to fix.

$ killall geth
$ "/home/lpreimesberger/.config/Ethereum Wallet/binaries/Geth/unpacked/geth" --rpc --testnet --fast --ipcpath /home/lpreimesberger/.ethereum/geth.ipc --rpc

Okay - you can now use Web3.   Oh - snap.   What's this?

Error: authentication needed: password or unlock  at Object.InvalidResponse /home/lpreimesberger/projects/caprica-e/node_modules/web3/lib/web3/errors.js:38:16)

Hmm - yeah, not useful.  Try to use the Wiki documented login routine.  Good luck with that - it's gone.  No worries, there's an --unlock option.  The password option is documented as a string input in the Wiki  It's not.  Just damn file.   That are just toying with you again.  Put the wallet password in a file and try again:

"/home/lpreimesberger/.config/Ethereum Wallet/binaries/Geth/unpacked/geth" --rpc --testnet --fast --ipcpath /home/lpreimesberger/.ethereum/geth.ipc --unlock 0xE066F3a4BfAa155Bcb1F528BD9fb8266B86CCce8 --password ~/projects/caprica-e/pw

Whee!  Yeah, finally the JavaScript output will work.



Saturday, February 11, 2017

Android USB debugging sucks - using a kvm image


If you use Android Studio, you probably have tried to use the default Android images that it offers you.  They work pretty well, but they are really, really slow.   Unbearably slow if you are running anything complex - which is why are are nice companies like Genymotion who offer a snappy debug image along with a more industrial set up for serious coding.  I'm not going to blow $140 for my part time Android stuff though.

Pros use dedicated debug phones that are set to never turn off connected with good debug cables.  I'm not a pro by any stretch, but I do that with my own Pixel, but since I'm elderly it's just a pain since I've got desk arrangement and just eye focus problems looking from big screen to little screen, and I just don't like debug crap on my real phone.

So I just make my own Android image that doesn't suck.  It's actually pretty easy.  Assuming of course that you are running Linux (Windows is hideously slow for most tasks) - just install the kvm modules.

$ sudo apt-get install qemu-kvm

If you like typing lots of numbers, you can use the command line - but it's 2017 so I use the GUI - search for 'virtual' and you'll get the app:



Grab your favorite Android image from http://www.android-x86.org/download and install.  You can get by on 512MB memory for the image, but just use whatever works for your app.  1GB and 1-2 cores seems fine for me.

Once booted, Android is just Linux - switch to the text console with alt-F1 and get the IP


You can then connect with adb and use like usual in Android Studio:

lpreimesberger@ubuntu:~$ ./Android/Sdk/platform-tools/adb connect 192.168.122.69:5555
connected to 192.168.122.69:5555





Saturday, December 10, 2016

Getting modern NodeJS apps to run on the Pi 3


The default Debian doesn't have working stuff to run any Node apps on it (yeah, I know the Pi isn't the best thing for this, but work with me here).   Login as pi and open a root shell with sudo and out of paranoia - switch to /tmp.  This prevents npm from leaving files in your working directory with the wrong permissions.


First update Node to a non-hilariously old version (the included one is junk).  This is pulling from the official distribution site (see https://github.com/nodesource/distributions):


curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
apt-get update
apt-get upgrade
apt-get install nodejs

Then install npm - it's always included now, but it's always obsolete in the package:

curl -L https://www.npmjs.com/install.sh | sh


Then install bower as root still (don't do other things as root):

npm -g install bower

Type `exit` or hit control-d to exit the root shell.  Checkout the source of whatever and it should just work now.