Saturday, August 23, 2014

Android: 'Insufficient Storage Available'

I HATE this message. But this article has helped me to resolve it.

I'm tired of removing apps so I can install another one, when I know there's ample space for them.

Finally, I've had enough; thanks, Google, IT World, and Kevin Purdy:

There is a kind of clean-sweep method of wiping out the cache on all your apps at once. You'll have to clear enough space for it, of course, but if you can fit the 1.31 MB App Cache Cleaner on your Android, you'll free up much more space in return. It's an ad-supported product, with occasional pop-ups. But ignore whatever goofy game it wants you to install, look at the "Total" count in the upper-right corner, and then click the big green "Clean" button at the bottom. That's a bit more space, so try installing that app that wouldn't fly once more.

I'm in love with my Android again.

Tuesday, April 29, 2014

Google Hangouts Video Call - Allow both talk plugins...

Ok, I just spent 30 minutes tinkering with Google Hangouts (Fedora, Chrome) to try to get video calling working.  Every time I tried to initiate a video call, a new window would pop up with a message that read:

Select "Allow" for both Google Talk plugins in order to access the video call.

Of course, there isn't anything to click to enable the plugins.  Weird.

Eventually, I found out that by telling Chrome to automatically run all plugins, it would work.

chrome://settings/content

Scroll down to "Plug-ins" and select "Run automatically (recommended)"

Once that's done, start a video call; works fine.

Since I'm paranoid, I went back and changed the Plug-ins setting back to "Click to play" and, guess what?  Video calling still works!

(Lustre) Best practice for changing file permissions

On a Lustre filesystem, don't use chmod/chgrp/chown by themselves.

The best method incorporates the lfs find command:
lfs find <subdirectory> | xargs chgrp <new group>
chmod or chown commands with -R option (or using the normal find) are not very fast if the subdirectory contains lots of files.

Friday, October 25, 2013

Capturing RTMP video (aka Flowplayer) (in Fedora)

It may not be very elegant, but it works.

First, install rtmpdump:
sudo yum install -y rtmpdump

Then, create this script somewhere handy:
#!/bin/bash
sudo iptables -t nat -A OUTPUT -p tcp --dport 1935 -j REDIRECT
echo starting
rtmpsrv | tee rtmp.txt
echo ended
sudo iptables -t nat -D OUTPUT -p tcp --dport 1935 -j REDIRECT

Run the script, then, while it is running, try to watch the video in your browser.  If it is an RTMP stream, the terminal should show some capture information.  Ctrl+C in the terminal.

Now, you may have to edit the rtmp.txt output file to remove extra text, but leave the "rtmpdump" commandlines.

Finally, execute:
sh ./rtmp.txt

...to download the video.

(Create an alias:  alias capture='~/path/to/rtmpdump/script.sh')

Monday, June 10, 2013

Google Docs - Inserting Date in the Footer

Now that Google Drive Documents support scripts, it is possible to, say, create a footer that contains the date that the document was last accessed.

In your Google Doc, click Tools | Script Editor.

Copy/paste the code below, and save the script.


/**
 * The onOpen function runs automatically when the Google Docs document is
 * opened. It will add a "Tools" menu with an "Update Footer" option. It also
 * (automatically) updates the date in the footer as soon as the documents is
 * opened. (WARNING: Any footer content will be removed/deleted.)
 */
function onOpen() {
  // Add a menu with some items, some separators, and a sub-menu.
  DocumentApp.getUi().createMenu('Scripts')
      .addItem('Update Footer', 'onEdit')
      .addToUi();
  onEdit();
};
function onEdit() {
  var doc = DocumentApp.getActiveDocument();
  var footer = (doc.getFooter()) ? doc.getFooter() : doc.addFooter(); // Thanks, Martin!
  footer.setText("");
  var divider = footer.appendHorizontalRule();
  var footerText = footer.appendParagraph('Confidential and Proprietary - Accessed ' + new Date());
  footerText.setFontSize(9);
  footerText.setForegroundColor('#4a86e8');
  footerText.setAlignment(DocumentApp.HorizontalAlignment.RIGHT);
  return doc;
};


Return to your document, and reload it; the footer will automatically be created.  (NOW it will! Thanks, Martin!)  If you want to update the footer, you can click the Script | Update Footer menu item.

That I know of, there isn't yet an "onSave" or "onEdit" trigger in Google Documents - but, if that comes about, this will be an even more awesome tool! (*hint,hint, Google!)  You CAN, however, use a "clock tick event" but I haven't gone there yet.

Thursday, April 11, 2013

Nuvola Player on Fedora

Nuvola Player is a nifty interface for Google Music.

Due to dependencies and such, I found this page helpful: https://launchpad.net/nuvola-player/+download

I downloaded NuvolaPlayer version 1.1.2, though it is not the latest...


Extract:
tar -xvf nuvolaplayer-1.1.2.tar.gz 
cd nuvolaplayer-1.1.2/

Run the configuration:
./waf configure

In my case, there were some dependencies that I don't need/can't use, so:
/waf configure --no-lastfm --no-unity-quick-list --no-svg-optimization

Build and Install:
./waf build
sudo ./waf install

I also had to install the Gnome extension:
sudo yum install gnome-shell-extension-mediaplayers

Run NuvolaPlayer (either via terminal or Applications in Gnome).

Aaaaand, awesomeness.


Wednesday, February 20, 2013

Editing / Creating Bookmarklets



Bookmarklets are really cool.

I've updated the Bookmarklet Editor; drag this link to your bookmark toolbar:


So, what does it do?

Well, editing bookmarklets can be difficult, so the editor helps you to make edits and test them.

When you click the Bedit bookmark a new window should popup that looks something like this:


Click "Populate" to generate sample bookmarklet code.  Then, in your browser, create a new bookmark, and paste the code from Bedit into the URL.  The sample bookmarklet simply sends you to a page, depending upon which day of the month it is.

Some bookmarklets are WAY more complicated.  For example, check out www.supergenpass.com.  If you copy the "URL" bookmarklet code and paste it into Bedit, you can parse the code into (slightly) more readable javascript, make some changes, then run it from within Bedit!

Right click the bookmarklet (this one is from www.supergenpass.com):
Copy the entire entry in the URL field:

And paste it into the Bookmarklet Editor window: 

Click "Run" to test it: 

Editing it in its compressed form is difficult, so parse it first:

---

At the risk of confusion and paradox, the URL code for the bookmarklet editor is below; feel free to copy it and paste it into the Bedit window...

javascript:
W8=open('','B','width=400,height=350,resizable');
W8.focus();
with(W8.document){
write('
<html>
<body bgcolor=\'#CCCCCC\'>
<script>function setTemplate () {
var myX=this.document.getElementsByTagName("textarea");
/* var myText=document.body.outerHTML;
myText=myText + "boo";*/
var myText="javascript:(function(){
var today=new Date();
var dd=today.getDate();
window.location.assign(\'https://www.blueletterbible.org/Bible.cfm?b=Pro&c=\'+dd+\'&t=NIV\');

}
())";
myX[0].value=myText
}
function setX(){
var myX=this.document.getElementsByTagName("textarea");
myX[0].value=p4rse(myX[0].value)
}
function resetX(){
var myX=this.document.getElementsByTagName("textarea");
myX[0].value=colap5e(myX[0].value)
}
function colap5e(v){
v=v.split("\\t").join("");
v=v.split("\\n").join("");
v=v.split(" ").join(escape(" "));
v=v.split("\'").join(escape("\'"));
v=v.split(\'"\').join(escape(\'"\'));
v=v.split("\\r").join("");
return(v)
}
function tabMe(s){
var reg = /[\%7D\%7B]/;
var sa = s.split("\\n");
var isfor = /^for/;
for(var i in sa){
if(!reg.test(sa[i])&&i!=0&&!isfor.test(sa[i])){
sa[i]="\\t"+sa[i]  
}

}
sa[0] = sa[0].replace(/(javascript:)([\\S ]+)/,"$1\\n$2");
s=sa.join("\\n");
var r = s.replace(/for[\(]([\\S ]+%3B)[\\s]+([\\S ]+%3B)[\\s]+([\\S\)]+%7B)[\\s]+/g,"for($1$2$3\\n");
return(r)
}
function p4rse(v){
v=v.split("%3B*%2F").join("**%2F");
v=v.split("%3B").join("%3B\\n");
v=v.split("**%2F").join("%3B*%2F");
v=v.split("%7D").join("\\n%7D\\n");
v=v.split("%7B").join("%7B\\n");
/*  Parse Comments */
v=v.split("*%2F").join("*%2F\\n");
/*  Parse Tags */
v=v.split("%3C").join("\\n%3C");
v=tabMe(v);
v=v.split(escape(" ")).join(" ");
v=v.split(escape("\'")).join("\'");
v=v.split(escape(\'"\')).join(\'"\');
/* v=v.split("\\n\\n\\n").join("\\n");*/
return(v)
}

</script>
<center>
<form>
<textarea style=\'width:100%;
height:90%\' name=X rows=30 cols=34 wrap>javascript:
</textarea>
<p>
<input type=button value=Parse onclick=setX()> 
<input type=button value=Compress onclick=resetX()> 
<input type=button value=Run onclick=opener.location=X.value> 
<input type=button id=populate value=Populate onclick=this.disabled=true;
setTemplate()> <a style="font-size:.75em" target=_new href="http://goo.gl/3t2EjH">08.27.2014</a>
</form>
</center>
</body>
</html>');
setTimeout("W8.focus()",0);
void(close())
}