HURDED!

May. 24th, 2013 11:16 am
tonybaldwin: tony baldwin (Default)
I am posting to redmatrix, friendica, pumpio and libertree,
using a bash script, on a Debian GNU/HURD system (running in
a virtual machine with virtual box on a Debian GNU/Linux 7.0 Wheezy system).

Yes, and wearing my GEEK badge proudly.
:-D

#gnu #hurd #debian #bash
tonybaldwin: tony baldwin (Default)
I updated my friendi.sh script
for posting to friendica over API with bash and curl,
with configuration of xposting options.
Now it asks, first, if you want to xpost, before asking you silly questions about where you'd like xpost.
Also, it will use a conf file, in which you will store the directory where you want to save posts,
your preferred browser and editor, and, of course, your username, password, and the url for your friendica site.
That's about it for changes, really.

#bash #friendica
tonybaldwin: tony baldwin (Default)
climagic
find $HOME -uid $( id -u ) -type s |sort|uniq -c| grep -v " 1 " # Find a pair of matching socks. I wish I could use this in the mornings
link

and all this time I've been looking in the dryer lint trap...

#socks #bash
tonybaldwin: tony baldwin (Default)
So, why is it I can post to posterous with this script: http://tonyb.us/ppost

but can not with this php code: http://tonyb.us/cE

??

Granted, I'm no php wizard, but I can't find any syntax errors, and I get no error messages back,

but posts sent with this code do not come through?



Anyone? Anyone?

Bueller?



#api #posterous #bash #php #curl
tonybaldwin: tony baldwin (Default)

Originally published at tony baldwin | baldwinsoftware.com. Please leave any comments there.

Someone asked me what this:

was all about…having astutely noticed it in the last screenshot I posted.

I often have to quick math on the fly while generating estimates for clients and doing other off the cuff calculations.
Previously, while using openbox or fluxbox, I had a keybinding bring up a calculator and did the math and then killed the calculator with ctrl+q.
But, I’m all about efficiency, and lately have been learning more and more of the powerful tools in bash to do various things, from navigating the file system to handling files and manipulating text. In wmii, I always have at least one bash terminal open (my preferred terminal emulator currently being roxterm).
So, I figured there had to be an efficient means of doing math without bringing up a gui calculator, too, but bash doesn’t like floating point numbers so well.
Now, with expr or echo or let one can do some basic math (ie. expr 220+34, or echo $((220+34))), but not with floating point numbers (with decimal points), which I need.
But bc can do it. One would have to type in something like:
echo ‘5467 * 0.09′ | bc
or
bc -l <<< 5467*0.09
to get the result....
Not really quick-n-dirty...
So, I scripted it:

#!/bin/bash
# do math with bc
echo “Enter your equation:”
read e
echo “The result is:”
bc -l <<< $e

I called the script ‘M’ (for ‘Math’), and stuck it in /usr/local/bin.
Now, I just type
$ M
and I see:

Enter your equation:
(enter equation here)
The result is:
(result appears)
$
all done.
I type 1 letter (two keys, shift+m), and my equation.

tony@deathstar:~$ M
Enter your equation:
3452*0.09
The result is:
310.68
tony@deathstar:~$

./tony

Profile

tonybaldwin: tony baldwin (Default)
tonybaldwin

December 2013

S M T W T F S
1234567
8 91011121314
15161718192021
22232425262728
293031    

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags