Wednesday, November 19, 2014

Rotating Backgrounds in Fedora/Linux

If your Linux flavor uses Gnome, there are wallpapers available that change throughout the day.


Great.

But, what if you want your own?

There are applications that allow you do to this, but here's a script to do it simply.

First, put the pictures you want to use in a ~/Pictures/Backgrounds directory:


Create this script somewhere handy:


Then run it:
chmod +x ./build_background_xml3.sh
./build_background_xml3.sh

Done!

Wednesday, August 27, 2014

Automating Passwordless Access

Assuming you have generated rsa keys (ssh-keygen) and assuming that ssh-copy-id is NOT working for you...

Here's the command:
cat ~/.ssh/id_rsa.pub | ssh -p 22 <login>@<dest> "cat >> .ssh/authorized_keys";
Where <login> is your username and <dest> is the server to which you're sending the public key.

OR, if you do this often, create passwordless.sh:

To run it:
chmod +x passwordless.sh
./passwordless.sh <login> <dest>

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.