Wednesday, October 13, 2010

How To Post to Blogger with GoogleCL and BASH

#!/bin/bash

### Geeky Blogs for The Inquisitive Sheep ###

# Close Gedit so that you won't post an empty blog
# Get name of blog post [TITLE]
# Get labels for blog post
# Gedit a text file in $HOME/Documents/Blog/[TITLE]
# Upload a labeled blog via googlecl with "google blogger post $HOME/Documents/Blog/[TITLE]"

xcowsay "Warning! killall gedit"

killall gedit

clear

echo ""
echo "What is the name of this blog?"
echo ""
read TITLE
echo ""
echo "$TITLE"
echo ""
echo "Any labels besides geeky? (e.g. 'label1, label2,' )"
echo ""
read LABELS
echo "$LABELS"

gedit $HOME/Documents/Blog/"$TITLE"

gnome-terminal -x xcowsay --monitor=0 """Your blog post $TITLE
is being posted via googlecl,
and its labels are
geeky, $LABELS"""

google blogger post --tags "geeky,"$LABELS"" $HOME/Documents/Blog/"$TITLE"


Friday, October 8, 2010

The New And Improved Clockwork PC Webcasting Script

WARNING: THIS IS A VERY GEEKY POST! READ AT YOUR OWN PERIL!!!

#!/bin/bash

### The Clockwork PC Webcasting Script###

# This script is the fruit of many hours of research into FFMPEG.

# You will need ffmpeg with x11grab, and a number of libraries that should be installed automatically.

# You will need a custom directory ~/Videos/Screencasts, otherwise change the output directory in the commands.

# You will also need to download and install the newest xcowsay from its homepage,
# because the older xcowsay from the Ubuntu repositories (2010-08-31 at the time of writing) will not work with the --monitor option.

# The chained command creates THREE separate files:
# x11grab for your desktop,
# video4linux2 for your webcam,
# alsa for your microphone or headset.
# This is very important to me because I use Openshot Video Editor, which cannot split audio and video yet, but can combine them very well.
# If this is not important to you, there are many fine commands that combine audio and video streams into a single file, so you don't have to use mine.

# However, this chained command will record everything synchronously, including webcam and audio.

# Enjoy!

# Alexander,
# linux@clockworkpc.com.au

###

# Create a temporary folder called "video bin"
mkdir $HOME/Videos/Screencasts/video_bin/

#!/bin/bash

# Record the desktop at 1440x900 (change to your resolution) using ffmpeg
gnome-terminal -x ffmpeg -f x11grab -r 25 -s 1440x900 -i :0.0 -qscale 1 -vcodec libx264 -vpre lossless_ultrafast $HOME/Videos/X11Grab/X11Grab_on_$(date +%F_%A_at_%H:%M:%S).m4v ;
#!/bin/bash

# Record the microphone audio using ffmpeg && Open a GUVcview recording to the same folder as the other two
gnome-terminal -x ffmpeg -f alsa -ac 2 -i pulse -acodec pcm_s16le $HOME/Videos/Audio/Audio_on_$(date +%F_%A_at_%H:%M:%S).wav ;
#!/bin/bash

# Open a GUVcview recording to the GUVCView and video_bin folders
guvcview --device=/dev/video0 --video=$HOME/Videos/GUVCView/capture.mkv &&
cp $HOME/Videos/GUVCView/capture.mkv $HOME/Videos/GUVCView/webcam_on_$(date +%F_%A_at_%H:%M:%S).mkv && mv $HOME/Videos/GUVCView/capture.mkv $HOME/Videos/Screencasts/video_bin/webcam_on_$(date +%F_%A_at_%H:%M:%S).mkv
#!/bin/bash

# Copy the X11grab into the video_bin
cd $HOME/Videos/X11Grab && cp `ls -x1tr *.m4v | tail -n 1` newest.m4v &&
cp $HOME/Videos/X11Grab/newest.m4v $HOME/Videos/Screencasts/video_bin/x11grab_$(date +%F_%A_at_%H:%M:%S).m4v &&

# Copy the Audio into the video_bin
cd $HOME/Videos/Audio && cp `ls -x1tr *.wav | tail -n 1` newest.wav &&
cp $HOME/Videos/Audio/newest.wav $HOME/Videos/Screencasts/video_bin/audio_$(date +%F_%A_at_%H:%M:%S) &&

# Rename "video bin" to a "bin [date stamp]"
mv $HOME/Videos/Screencasts/video_bin/ $HOME/Videos/Screencasts/bin_$(date +%F_%A_at_%H:%M:%S)
#!/bin/bash

# Call up a cute cow with a message
(gnome-terminal -x xcowsay --cow-size=large --time=3 --monitor=0 "Your video has been recorded :)"&);

# Play an audio track of your choice (Moo!)
(gnome-terminal -x mplayer $HOME/Videos/Sound_effects/moo.wav)

Ubuntu In Business: The Dream of Clockwork PC

Over the coming weeks I will use this blog to explore and express the philosophy from which Clockwork PC's values are derived.

Clockwork PC was founded out of a desire provide a working commercial model for realisation of potential.

Not the phrase for realisation of potential: the ultimate aim of Clockwork PC is higher than maximal utilisation of employees' talents; rather, our dream is to have a commercially successful enterprise whose greatest goal is to help those it employs to be the best they can be.  Achievement of this goal will both entail and result in maximal utilisation of our employees' talents, which will be the bedrock of our success.

In the following articles we will explore how open source software development provides a working model for democratisation of an organisation, be it a government bureaucracy, a corporation, an institution, or an SME:

  • Democratisation of an organisation is the key to maximal utilisation of its employees' talents;
  • Democratisation of an organisation can only occur if it be the organisation's leaders' primary goal, in and of itself.
  • Organisational leaders whose primary goal in and of itself is democratisation of the organisation cannot be products of the traditional, hierarchical power relations to which most organisations default.
  • Organisational leaders who do take it upon themselves to create democratic institutions that do not descend into anarchy or management by committee require sophisticated mechanisms for collection of, processing of, and acting upon employees' feedback.
  • Moreover, the organisation must establish incentives that reward free, open, honest discussion.
As we will see in the case of Canonical and the GNU/Linux Ubuntu operating system, this instance of open source software development offers a working model for precisely the democratisation described above.

These thoughts, like all software, are a work in progress.  I do not pretend to have all the answers and welcome any thoughtful feedback.