Saturday, April 23, 2011

Installing Adobe Flash "Square" on a 64-bit Linux Distribution, Firefox 4

In the past month I set myself up a beautiful pure 64-bit Gentoo system on my Thinkpad X61. It's not completely ready yet, as I have yet to compile my custom kernel that should allow the wacom screen to be recognized.

Installing 64-bit Flash "Square" should be the exact same procedure on any major GNU/Linux distribution, so there shouldn't be any specific instructions. Also, this instruction set ignores the "proper" distro way of doing things.

Ubuntu has an install-flashplayer deb that does things for the user. Which is preferrable, as the way I am about to describe does not provide automatic updates. And before we continue, I should stress that Flash Square is a PREVIEW and flash is inherantly insecure due to it being a proprietary offering and ubiquitous on the web.

This method installs flash in "userspace", or in a way that does not require admin privileges. This method reduces the consequences if your computer is comprimised through flash by not being able to touch your system.

1. Download Flash Player "Square" from Adobe's web site: http://labs.adobe.com/downloads/flashplayer10_square.html

Check under the heading "64-bit Release Flash Player Downloads" and choose what should be the last option: plugin for 64-bit linux

(I shake my head at Adobe. Flash doesn't run in the kernel; they should change it to "linux-based OS" or the proper "GNU/Linux" label)

2. Extract the .tar.gz download. This can be done via command line by typing "tar -xvf [file]".

3. Make sure that the plugins folder exists. It didn't by default for my system. "mkdir -p ~/.mozilla/plugins/"

My first attempt at this failed because I created the plugins directory in .mozilla/firefox/.

4. Copy the libflashplayer.so file to the user's plugin folder. This command should work: "cp libflashplayer* ~/.mozilla/plugins/"

If you get any errors in the previous commands, you are probably in the wrong directory when typing them, you are typing the double-quotes (don't), or you aren't in the shell/command line. As well, this is for Firefox 4. Theoretically it should work for previous versions of Firefox, but I'm a little lazy to make sure.

And if you haven't checked out Mozilla's newest browser version, you really should. Startup times alone are much improved. Having a default page already cached helps, but the option to load your previously viewed tabs on last exit is convenient.

I have been doing some introductory coding in OpenGL, Freeglut and C++/QT lately. I hope to come out with some tutorials for those as well in the near future.

=-=-=-=-=
Powered by Blogilo

Friday, February 11, 2011

Gentoo Users, QT pt 2

QT 4.6 is officially out for Gentoo's portage. It needs to be unmasked, mind you. But I've now installed it and it looks damned great.

I reinstalled Gentoo over the past week, upgrading to an ext4 filesystem along with all my applications. There is a noticable speed difference with the filesystem upgrade alone, but 4.6 also is improved.

The K3B issue I was having in the last post was solved. Until it gets a newer QT port, I probably won't install it. Plus I installed Gentoo without HAL support, so I may not even be able to use my cd/dvdrom until later. I previously mentioned the drive was having issues. At some point, it got fixed, probably through an update.

While doing this re-install, I had some trouble with my Radeon X1400 mobility card.

I couldn't use desktop effects as they were full of artifacts and my screen was off-kilter. Long story short, I installed xorg-server as opposed to xorg-x11. This installs more of xorg (fonts, etc.) that not everybody needs. I also modified my custom kernel to use pci video card support as a module, which was probably the culprit. After using this new kernel and enabling desktop effects, things run faster than they did previously on my old install.

All in all, quite impressive and great job to KDE and Gentoo teams.

On a slightly related note, it's quite upsetting to see Microsoft executives infiltrate Nokia, bring down their stock, add their retarded phone OS to the mix (which barely anybody wants), possibly comprimising QT and its development (which is probably what they want anyhow) and looking the fool.

The sooner M$ is buried under their incompetance, the better. It's a shame that they act the bully because they cannot compete in the marketplace.

They already drain resources from samsung and lg off their android phones under false pretences of patent infringement.

Quite foolish, and most disappointing, coming from an IT giant. Then again, Canada's ISP giants are also looking like the retards they are. Usage based billing my ass.

They shant get away with it.

=-=-=-=-=
Powered by Blogilo

Thursday, January 20, 2011

Gentoo Users, QT

I was recently updating my gentoo system when I came across a puzzling issue. I was getting updates for QT 4.6.x as well as 4.7.x and there were conflicts all over the place. At least 12 were listed when attempting to emerge world.

I removed all QT 4.7.x packages rather foolishly to see if the conflicts would clear up, which they didn't. After looking closely at some of the packages, it seems that K3b was bringing in all these older qt updates. I removed it from my system, but the problem still persisted. That's why I'm writing this down. I had to explicitly mask the package in order for the problem to go away.

(as root)

echo "app-cdr/k3b" >> /etc/portage/package.mask

My laptop's already not allowing me to use my cdrom very well, perhaps it's dying. I can't burn or play dvd's on it. Keeps giving me HAL errors, regardless of whether it's running. Other burners don't see the drive either.

Anyway, I'll be heading up for the Global Game Jam soon. Cheers, y'all.

Thursday, December 23, 2010

Still Alive

Finished graduating my course as of this December.

During the time I've been at school, I've also been working full time, so that leaves very little left over to work on my projects. Even less since I moved in October.

Not to worry, once I get paid I will be purchasing a domain to use strictly for gaming/programming projects, whereas this blog will probably include fixes for certain issues I face, cool ideas and things that peak my interest, as well as more anti-M$ rants... most likely. I may also get a little more political in my blog.

That last paragraph implies that I will be working more on projects, which I intend to.

I may be using sourceforge to host projects, Also, they will probably fall under the GPL 3 license.

There's a lot of cool ideas I'm holding in for now. In the meantime, I must rest.

Tuesday, October 12, 2010

Quickie bug fix

I was recently having the following issue while fiddling around with expect and spawn:

send: spawn id exp6 not open
while executing
"send "$password\r""
(file "changepw" line 9)

in a script to auto-change passwords for some work I'm doing.

The reason I encountered this error is because my file I was reading from (in the changepw plain-text file), there was no newline character at the bottom.
The fix for this is to always have a clean new line in the file that needs to be read in.

I realize I haven't done much blogging recently. There should be more to come later on, once I'm more settled.

Saturday, July 24, 2010

FFROGG - FFmpeg Recursive Ogg Encoding Script

What happens when you have thousands of songs that you want encoded, but either you

a) Have a command line system where no gui app can encode them for you?

b) Want more efficient use of your processor therefore do not use a gui?

c) are not good at computing and just want to get'r done?

This is one itch I just had to scratch. Now I'm aware of great apps like handbreak and I know amarok 1.4.x used to have a script to encode songs in a playlist. However, not only am I a big fan off ffmpeg, I needed to test out my bash-fu.

The scenario is this:

Joe user has tons of music spread out all over his hard drive. Lets say he has 10 000, none of which are contained in any one folder as more OCD folks would do. (Or an organized heirarchy of folders even)

Joe decides that one day, he wants to move to a patent-free codec such as .OGG format, but not only does he not have the time to FIND all his mp3's, he's clueless about how to encode them and knows of no gui apps (except for above mentioned in this article).

Joe user visits this article and decides that he wants all his files encoded into one folder on an external hard drive (which could be his mp3 player).

All Joe has to do is ensure that ffmpeg and libvorbis/libtheora are installed correctly on his *nix system and he can go about watching TV or playing with his dog/kids/wife while the machine does all the work.

Here's How:

1) Download the script @ [ http://www.mediafire.com/?lc023alg2bsfx9x ] to your home folder

2) Make sure it's executable, use chmod +x ffrogg.sh to do so.

3) Use the command sh ffrogg.sh --input=/home/$USER/ --output=/media/externaldisk/encoded --export --recursive (as long as your --input is linked to the top folder where your music is located, it should be fine)

4) Navigate to your output folder, in Joe User's case, it's /media/externaldisk/encoded/. There should be a script called "ffrogg-encodethis-[numbers].sh".

5) At his/your convenience, run the script. Example: sh ffrogg-encodethis-1279967631.sh

Technical Aspect:

Here's the really cool technical details of the script.

THIS SCRIPT IS CURRENTLY IN ALPHA, IT DOES NOT WORK 100%!

This script at its greatest potential will dynamically produce a script using the ffmpeg and theora-vorbis backend that can be run which will encode ALL RECOGNIZED AUDIO FILES that were found when it was invoked. It can recursively find all audio files starting at the specified input directory. Since this is alpha software, below is a list of what DOES work in the current version (0.01.05 ALPHA):

sh ffrogg.sh [commands]

  • --input=[folder or file]
  • --output=[folder only]
  • --logging (this is for debugging purposes only, can specify a folder with --logging=[folder] if directory is read-only)
  • --recursive (this flag is required to go into directories to find audio files. Otherwise it just looks at contents of specified directories)
  • --export (Create the script and exit. Omitting this flag will cause the script to encode before exiting, although it gives a period to exit before starting)
  • --force (No use for it yet, as the recovery handling bit is not quite implemented. Will remove temp files if they get in your way)
  • --help (Gives a list of options, some of which will not work yet)
  • --version (displays version of program)

This script creates a few temporary files which is inefficient, but this is by no means a professional work. It's also licensed under the GPL version 2 (although I may have omitted that in the script itself).

If the --output and --logging= and --save-state= flags are given without parameters, the current folder is automatically used "." .

Running the script without parameters will cause it to exit.

I may not get around to improving it much, and I do have a graphical user interface planned which would require basically a re-write of the script into a QT application, so it may not get past Alpha. Feel free to take it on yourselves as long as you give credit in the comments at the very least, to PeonDevelopments 2010.

Thanks, and happy listening.

Since I don't usually look at comments, send them to my gmail.

peon.developments --at-- gmail --dot-- com.

=-=-=-=-=
Powered by Blogilo

Friday, July 23, 2010

Scripting in Bash: Arrays, Files and Spaces

I recently encountered some strange behaviour in my bash shell while writing a script.

My script would take the contents of a folder and store them into an array. Sounds simple enough, as it should be. But it's not.

If you type verbatim:

" declare -a ARRAY=`ls -1 -x $directory` "

You will find that every space in every filename will produce its own entry in the array.

A file called "An Introduction To Bash.txt" would be seen in the array as

An

Introduction

To

Bash.txt

which is an abomination for what I need these the filenames for. It does make sense why this behaviour appears, but if we want the entire filename per entry, we need to take the filename before it's put into the $ARRAY variable and do something with it to ensure spaces either do not exist or do not denote the start of a new array token.

The former being the easiest and resourced method, I converted all spaces to underscores (temporarily) to prove my point.

The command is now " declare -a ARRAY=`ls -1 -x $directory | sed 's/ /_/g'` " and it will output filename entries properly, albeit with underscores, no spaces.

To ensure this effect is permanent and not just for show, one would need to rename (using the 'mv' command) all the files in that directory so no spaces are in the filenames.

Bash isn't one of my stronger languages, so I may have missed a blaringly obvious detail.

Also of note: I'm still working on the freeworld project, albeit slowly after gaining employment. My 1st revision document is approximately 70-80 pages, but that's not including proper use case tables and UML/flowchart diagrams. Least of all the prototypes for necessary components.

I hope to make another entry soon enough, in the coming couple weeks.

Peon out.

=-=-=-=-=
Powered by Blogilo